Skip to content

Commit 3f1593d

Browse files
committed
Improves the way the plotting function handles maverick Qmatrix files. Fixes #77
1 parent 1307bdc commit 3f1593d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

structure_threader/structure_threader.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,13 @@ def create_plts(wrapped_prog, bestk, arg):
220220

221221
def plots_only(arg):
222222
"""
223-
Handles arrugments and wraps things up for drawing the plots without Running
224-
any wrapped programs.
223+
Handles arrugments and wraps things up for drawing the plots without
224+
running any wrapped programs.
225225
"""
226+
# Relative to abs path
227+
prefix_abs_path = os.path.abspath(arg.prefix)
226228
# Get all files matching the provided prefix
227-
prefix_dir, prefix_name = os.path.split(arg.prefix)
229+
prefix_dir, prefix_name = os.path.split(prefix_abs_path)
228230

229231
if prefix_dir == "":
230232
prefix_dir = "."
@@ -240,10 +242,10 @@ def plots_only(arg):
240242
x.startswith(prefix_name) and
241243
"rep1_" in x]
242244
else:
243-
infiles = [os.path.join(prefix_dir, x)
244-
for x in os.listdir(prefix_dir) if
245-
x.startswith(prefix_name) and
246-
x.endswith(".csv")]
245+
k_vals = arg.bestk
246+
infiles = [os.path.join(os.path.join(prefix_abs_path, "mav_K" + x),
247+
"outputQmatrix_ind_K" + x + ".csv")
248+
for x in k_vals]
247249

248250
for filename in infiles:
249251
sanity.file_checker(filename, "There was a problem with the deduced "

0 commit comments

Comments
 (0)