Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Jul 4, 2024
1 parent 097b68d commit 0f6b5ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const LeftPane: FunctionComponent<LeftPaneProps> = ({
stanSampler || undefined,
);
const { spData, scriptHeader } = useMemo(() => {
if ((draws) && (numChains)) {
if (draws && numChains) {
const numDrawsPerChain = draws[0].length / numChains;
const chainIds: number[] = [];
for (let i = 0; i < numChains; i++) {
Expand All @@ -72,10 +72,10 @@ const LeftPane: FunctionComponent<LeftPaneProps> = ({
draws: transpose(draws),
paramNames,
numChains,
chainIds
chainIds,
},
},
scriptHeader: '',
scriptHeader: "",
};
} else {
return {
Expand Down
12 changes: 8 additions & 4 deletions gui/src/app/pyodide/pyodideWorker/pyodideWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const loadPyodideInstance = async () => {
await micropip.install("stanio");
}
if (pyodideWorkerMode === "analysis.py") {
pyodide.FS.writeFile('sp_util.py', get_sp_util_content(), { encoding: 'utf-8' })
pyodide.FS.writeFile("sp_util.py", get_sp_util_content(), {
encoding: "utf-8",
});
}
return pyodide;
} else {
Expand Down Expand Up @@ -128,7 +130,9 @@ const run = async (code: string, spData: any) => {
setStatus("running");
}
}
pyodide.FS.writeFile('_sp_data.json', JSON.stringify(spData), { encoding: 'utf-8' })
pyodide.FS.writeFile("_sp_data.json", JSON.stringify(spData), {
encoding: "utf-8",
});
pyodide.runPython(script, { globals });
succeeded = true;
} catch (e: any) {
Expand Down Expand Up @@ -272,5 +276,5 @@ def load_draws_v1():
with open('_sp_data.json') as f:
_sp_data = json.load(f)
return _DrawsV1(_sp_data)
`
}
`;
};

0 comments on commit 0f6b5ba

Please sign in to comment.