From 4c3df0f9e6405da06dc2b901f97cd6d1d580bcc2 Mon Sep 17 00:00:00 2001 From: Jeremy Magland Date: Thu, 25 Jul 2024 12:20:49 -0400 Subject: [PATCH] Update message for data.json and lp__ hist plotting --- .../DataGenerationWindow/DataRFileEditor.tsx | 2 +- gui/src/app/pyodide/AnalysisPyFileEditor.tsx | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/gui/src/app/pages/HomePage/DataGenerationWindow/DataRFileEditor.tsx b/gui/src/app/pages/HomePage/DataGenerationWindow/DataRFileEditor.tsx index 72b25e17..a8cb7841 100644 --- a/gui/src/app/pages/HomePage/DataGenerationWindow/DataRFileEditor.tsx +++ b/gui/src/app/pages/HomePage/DataGenerationWindow/DataRFileEditor.tsx @@ -124,7 +124,7 @@ if (typeof(data) != "list") { const contentOnEmpty = useMemo(() => { const spanElement = document.createElement("span"); const t1 = document.createTextNode( - "Define a dictionary called data to update the data.json. ", + "Define a list called data to update the data.json. ", ); const a1 = document.createElement("a"); a1.onclick = () => { diff --git a/gui/src/app/pyodide/AnalysisPyFileEditor.tsx b/gui/src/app/pyodide/AnalysisPyFileEditor.tsx index 187a6543..17cf0f32 100644 --- a/gui/src/app/pyodide/AnalysisPyFileEditor.tsx +++ b/gui/src/app/pyodide/AnalysisPyFileEditor.tsx @@ -191,17 +191,14 @@ const AnalysisPyFileEditor: FunctionComponent = ({ const analysisPyTemplate = `import matplotlib.pyplot as plt # Get the parameter names -pnames = draws.parameter_names - -# Show histogram for first parameter -for pname in pnames: - print(pname) - samples = draws.get(pname) - print(samples.shape) - plt.hist(samples.ravel(), bins=30) - plt.title(pname) - plt.show() - break +print(draws.parameter_names) + +# plot the lp parameter +samples = draws.get("lp__") +print(samples.shape) +plt.hist(samples.ravel(), bins=30) +plt.title("lp__") +plt.show() `; type ConsoleOutType = "stdout" | "stderr";