Skip to content

Commit a3a1e0f

Browse files
committed
Corrected the plotter function for the new argument.
1 parent 8134c23 commit a3a1e0f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

structure_threader/structure_threader.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ def structure_harvester(resultsdir, wrapped_prog):
171171
sh.main(resultsdir, outdir)
172172

173173

174-
def create_plts(resultsdir, wrapped_prog):
174+
def create_plts(resultsdir, wrapped_prog, Ks):
175175
"""Create plots from result dir.
176176
:param resultsdir: path to results directory"""
177177

178+
plt_list = [x for x in Ks if x != 1] # Don't plot K=1
179+
178180
outdir = os.path.join(resultsdir, "plots")
179181
if not os.path.exists(outdir):
180182
os.mkdir(outdir)
@@ -188,10 +190,10 @@ def create_plts(resultsdir, wrapped_prog):
188190
file_to_plot = str(randrange(arg.minK, arg.replicates))
189191
plt_files = [os.path.join(resultsdir, "K") + str(i) + "_rep" +
190192
file_to_plot + "_f"
191-
for i in range(arg.minK, arg.Ks + 1)]
193+
for i in plt_list]
192194
else:
193195
plt_files = [os.path.join(resultsdir, "fS_run_K.") + str(i) + ".meanQ"
194-
for i in range(max(arg.minK, 2), arg.Ks + 1)]
196+
for i in plt_list]
195197

196198
sp.main(plt_files, wrapped_prog, outdir, arg.popfile)
197199

@@ -341,7 +343,7 @@ def main():
341343
structure_harvester(arg.outpath, wrapped_prog)
342344

343345
if arg.noplot is False:
344-
create_plts(arg.outpath, wrapped_prog)
346+
create_plts(arg.outpath, wrapped_prog, Ks)
345347

346348

347349
if __name__ == "__main__":

0 commit comments

Comments
 (0)