Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Al-Saffar committed Nov 29, 2024
2 parents f2fc5cc + 45fb05f commit 3979616
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/machineconfig/scripts/python/fire_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def main() -> None:
elif platform.system() in ["Linux", "Darwin"]:
command = f"{exe} -m pudb {choice_file} " # TODO: functions not supported yet in debug mode.
else: raise NotImplementedError(f"Platform {platform.system()} not supported.")
elif choice_function is not None and not args.module: # if args.module, then kwargs are handled in the impot script, no need to pass them in fire command.
elif choice_function is not None and (not args.module and args.Nprocess == 1):
# if args.module, then kwargs are handled in the impot script, no need to pass them in fire command.
# https://google.github.io/python-fire/guide/
# https://github.com/google/python-fire/blob/master/docs/guide.md#argument-parsing
if not kwargs: # empty dict
Expand Down Expand Up @@ -222,7 +223,8 @@ def main() -> None:
command = f"""
. $HOME/scripts/activate_ve {args.ve}
python -m crocodile.cluster.templates.cli_click --file {choice_file} """
if choice_function is not None: command += f"--function {choice_function} "
if choice_function is not None:
command += f"--function {choice_function} "
try: install_n_import("clipboard").copy(command)
except Exception as ex: print(f"Failed to copy command to clipboard. {ex}")

Expand Down

0 comments on commit 3979616

Please sign in to comment.