Skip to content

Commit 48ed351

Browse files
Update to jupytelite.github that has a new xarray version (#681)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent df85ace commit 48ed351

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/components/repl.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ import { nord } from 'react-syntax-highlighter/dist/cjs/styles/prism'
66
//TODO: We could remove xarrray installation step by requesting xarray to be added to the Pyodide standard lib
77
//TODO: Or wait until jupyterlite has streamlined the installation process of user-specified packages
88

9-
// use for install xarray via micropip
10-
const preRun =
11-
'import%20micropip%0Aawait%20micropip.install%28%5B%27xarray%27%2C%20%27matplotlib%27%5D%29'
12-
139
// See: https://github.com/jupyterlite/jupyterlite/issues/151
14-
const preRunCode = `%23%20Import%20packages%0Aimport%20xarray%20as%20xr%0Aimport%20numpy%20as%20np%0Aimport%20pandas%20as%20pd%0A%25matplotlib%20inline`
10+
const preRunCode = `%23%20Import%20packages%0Aimport%20xarray%20as%20xr%0Aimport%20numpy%20as%20np%0Aimport%20pandas%20as%20pd`
1511

1612
// https://github.com/jobovy/jupyterlite-repl-prerun
17-
const jupyterliteInstance =
18-
'https://jupyterlite-repl-prerun.readthedocs.io/en/latest/lite/repl'
13+
const jupyterliteInstance = 'https://jupyterlite.github.io/demo/repl'
1914

2015
const sampleCode = `"""
2116
To try Xarray in the browser,
@@ -91,7 +86,7 @@ export const Repl = () => {
9186
<AspectRatio ratio={4 / 3}>
9287
<iframe
9388
title='repl'
94-
src={`${jupyterliteInstance}/?toolbar=1&kernel=python&prerun=${preRun}&prerun-code=${preRunCode}`}
89+
src={`${jupyterliteInstance}/?toolbar=1&kernel=python&code=${preRunCode}`}
9590
alt='demo'
9691
/>
9792
</AspectRatio>

0 commit comments

Comments
 (0)