Skip to content

Commit

Permalink
TOPP tool location for input widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
axelwalter committed Jun 18, 2024
1 parent 56269ad commit 2f8d27b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/workflow/CommandExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def run_topp(self, tool: str, input_output: dict, custom_params: dict = {}) -> N
n_processes = max(io_lengths)

tool_full_path = tool # in case it is globally available (lowest priority)
possible_paths = [ # potential SIRIUS locations in increasing priority
possible_paths = [ # potential TOPP tool locations in increasing priority
str(Path(sys.prefix, "bin", tool)), # in current conda environment
str(Path(".", "bin", f"{tool}.exe")), # in case of Windows executables
]
Expand Down
10 changes: 9 additions & 1 deletion src/workflow/StreamlitUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,15 @@ def input_TOPP(
# write defaults ini files
ini_file_path = Path(self.parameter_manager.ini_dir, f"{topp_tool_name}.ini")
if not ini_file_path.exists():
subprocess.call([topp_tool_name, "-write_ini", str(ini_file_path)])
tool_full_path = topp_tool_name # in case it is globally available (lowest priority)
possible_paths = [ # potential TOPP tool locations in increasing priority
str(Path(sys.prefix, "bin", topp_tool_name)), # in current conda environment
str(Path(".", "bin", f"{topp_tool_name}.exe")), # in case of Windows executables
]
for path in possible_paths:
if shutil.which(path) is not None:
tool_full_path = path
subprocess.call([tool_full_path, "-write_ini", str(ini_file_path)])
# update custom defaults if necessary
if custom_defaults:
param = poms.Param()
Expand Down

0 comments on commit 2f8d27b

Please sign in to comment.