Skip to content

Commit

Permalink
Update message for data.json and lp__ hist plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Jul 25, 2024
1 parent 7b768e5 commit 4c3df0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
19 changes: 8 additions & 11 deletions gui/src/app/pyodide/AnalysisPyFileEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,14 @@ const AnalysisPyFileEditor: FunctionComponent<Props> = ({
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";
Expand Down

0 comments on commit 4c3df0f

Please sign in to comment.