From 0f6b5ba85861ffc0a428078b913bb5effea8b4e2 Mon Sep 17 00:00:00 2001 From: Jeremy Magland Date: Wed, 3 Jul 2024 21:49:33 -0400 Subject: [PATCH] Formatting --- .../HomePage/AnalysisPyWindow/AnalysisPyWindow.tsx | 6 +++--- gui/src/app/pyodide/pyodideWorker/pyodideWorker.ts | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gui/src/app/pages/HomePage/AnalysisPyWindow/AnalysisPyWindow.tsx b/gui/src/app/pages/HomePage/AnalysisPyWindow/AnalysisPyWindow.tsx index 74bada30..5a8c4cdf 100644 --- a/gui/src/app/pages/HomePage/AnalysisPyWindow/AnalysisPyWindow.tsx +++ b/gui/src/app/pages/HomePage/AnalysisPyWindow/AnalysisPyWindow.tsx @@ -58,7 +58,7 @@ const LeftPane: FunctionComponent = ({ 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++) { @@ -72,10 +72,10 @@ const LeftPane: FunctionComponent = ({ draws: transpose(draws), paramNames, numChains, - chainIds + chainIds, }, }, - scriptHeader: '', + scriptHeader: "", }; } else { return { diff --git a/gui/src/app/pyodide/pyodideWorker/pyodideWorker.ts b/gui/src/app/pyodide/pyodideWorker/pyodideWorker.ts index 158a2ffb..d07e6d83 100644 --- a/gui/src/app/pyodide/pyodideWorker/pyodideWorker.ts +++ b/gui/src/app/pyodide/pyodideWorker/pyodideWorker.ts @@ -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 { @@ -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) { @@ -272,5 +276,5 @@ def load_draws_v1(): with open('_sp_data.json') as f: _sp_data = json.load(f) return _DrawsV1(_sp_data) -` -} +`; +};