diff --git a/gui/src/app/Scripting/Runtime/load_args.py b/gui/src/app/Scripting/Runtime/load_args.py index bde5d8c..9d1bb47 100644 --- a/gui/src/app/Scripting/Runtime/load_args.py +++ b/gui/src/app/Scripting/Runtime/load_args.py @@ -12,6 +12,8 @@ def rename_sampling_options(k): return "iter_sampling" if k == "num_chains": return "chains" + if k == "seed": + return "seed" raise ValueError(f"Unknown sampling option: {k}") diff --git a/gui/src/app/Scripting/Runtime/makePyRuntime.ts b/gui/src/app/Scripting/Runtime/makePyRuntime.ts index 1faf81c..a164300 100644 --- a/gui/src/app/Scripting/Runtime/makePyRuntime.ts +++ b/gui/src/app/Scripting/Runtime/makePyRuntime.ts @@ -35,7 +35,7 @@ const makePyRuntimeScript = (project: ProjectDataModel) => { script += `if args.ignore_saved_data:\n`; script += indent(spRunData); script += `\nelse:\n`; - script += ` print("Loading data from data.json, pass --ignore--saved-data to run data.py instead")\n`; + script += ` print("Loading data from data.json, pass --ignore-saved-data to run data.py instead")\n`; script += ` data = os.path.join(HERE, 'data.json')\n\n`; } else if (hasDataJson) { script += `data = os.path.join(HERE, 'data.json')\n\n`; diff --git a/gui/src/app/Scripting/Runtime/run_analysis.py b/gui/src/app/Scripting/Runtime/run_analysis.py index 757d6d2..3ccfbc0 100644 --- a/gui/src/app/Scripting/Runtime/run_analysis.py +++ b/gui/src/app/Scripting/Runtime/run_analysis.py @@ -3,7 +3,7 @@ print("executing analysis.py") sp_data = { - "draws": fit.draws(concat_chains=True), + "draws": fit.draws(concat_chains=True).transpose(), "paramNames": fit.metadata.cmdstan_config["raw_header"].split(","), "numChains": fit.chains, } diff --git a/gui/test/app/Scripting/makePyRuntime.test.ts b/gui/test/app/Scripting/makePyRuntime.test.ts index ec0178a..3b885d6 100644 --- a/gui/test/app/Scripting/makePyRuntime.test.ts +++ b/gui/test/app/Scripting/makePyRuntime.test.ts @@ -33,7 +33,7 @@ if args.ignore_saved_data: if "data" not in locals(): raise ValueError("data variable not defined in data.py") else: - print("Loading data from data.json, pass --ignore--saved-data to run data.py instead") + print("Loading data from data.json, pass --ignore-saved-data to run data.py instead") data = os.path.join(HERE, 'data.json') def rename_sampling_options(k): @@ -50,6 +50,8 @@ def rename_sampling_options(k): return "iter_sampling" if k == "num_chains": return "chains" + if k == "seed": + return "seed" raise ValueError(f"Unknown sampling option: {k}") @@ -170,7 +172,7 @@ import matplotlib.pyplot as plt print("executing analysis.py") sp_data = { - "draws": fit.draws(concat_chains=True), + "draws": fit.draws(concat_chains=True).transpose(), "paramNames": fit.metadata.cmdstan_config["raw_header"].split(","), "numChains": fit.chains, } @@ -217,7 +219,7 @@ describe("Python runtime", () => { const runPy = makePyRuntimeScript(noAnalysis); // we expect the same output, truncated after the sampling part - const analysisless = full.split("\n").slice(0, 65).join("\n") + "\n"; + const analysisless = full.split("\n").slice(0, 67).join("\n") + "\n"; expect(runPy).toEqual(analysisless); });