64 add default parameter sweep to run notebook command#65
64 add default parameter sweep to run notebook command#65capn-freako wants to merge 2 commits intomasterfrom
Conversation
jdpatt
left a comment
There was a problem hiding this comment.
I don't make use of this feature but giving feedback where I can!
|
|
||
| # Write parameter sweep specification template file. | ||
| root_name = str(pcfg.input_ami_params[ParamName("root_name")]) | ||
| run_file_path = Path(root_name + ".run").resolve() |
| if not notebook.exists(): | ||
| raise RuntimeError(f"Can't find notebook file, {notebook}!") | ||
| if "params" not in notebook_params or notebook_params["params"] == "": | ||
| dummy_run_file_name = mk_dummy_run_file( |
There was a problem hiding this comment.
If out_dir is provided, shouldn't we write the run file to that file path?
| "Run a *Jupyter* notebook on an IBIS-AMI model file." | ||
| arguments_list = sys.argv | ||
| full_command_line = "run-notebook " + " ".join(shlex.quote(arg) for arg in arguments_list[1:]) | ||
| if out_dir: |
There was a problem hiding this comment.
We should just set this once. I would add an else that sets it to the ibis file and remove the second update of it in run_notebook.
if out_dir:
out_dir=Path(out_dir).resolve()
else:
out_dir = Path(ibis_file).resolve().parent
out_dir.mkdir(exist_ok=True)
| @click.option("--fig-x", default=10, show_default=True, help="x-dimmension for plot figures (in).") | ||
| @click.option("--fig-y", default=3, show_default=True, help="y-dimmension for plot figures (in).") |
| # Write parameter sweep specification template file. | ||
| root_name = str(pcfg.input_ami_params[ParamName("root_name")]) | ||
| run_file_path = Path(root_name + ".run").resolve() | ||
| with open(run_file_path, mode="wt", encoding="utf-8") as run_file: |
There was a problem hiding this comment.
I believe we already generate *.run files in the mk_tests function; can we extract this to a write_run_file(filepath, dict) helper that does the same for both? Just have to give each the proper formatted dictonary so if we make edits later; both outputs are lock step and not segmented. This can be a future improvement if required.
No description provided.