Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyodide notebooks support #3603

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Pyodide notebooks support #3603

wants to merge 1 commit into from

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented May 13, 2024

This PR is only a proof of concept at this stage - it demonstrates using pandas inside pyodide based notebooks on grapher pages - i.e. python and the pandas/numpy stack run entirely in the browser, without any server component. Data is fetched via our file based API just like grapher (the data is fetched again but should be fast due to client side caching).

To play with it, open the staging server at a /grapher/ url and scroll to the bottom.

There are a lot of things that are not ideal about this proof of concept, e.g.:

  • The "library code" that is taken from Lars' recent new pythonic api to access data for grapher charts is copied verbatim into the first cell instead of used from a library
  • The notebook infrastructure we use, starboard, has not been developed further since early 2023 or so. It is thus stuck at pyodide version 0.20. The current version, 0.25, comes with a bunch of nice additions, e.g. transparent support for the requests library
  • If we had access to 0.25 then Lars' pythonic api code could be used verbatim - as is, http requests had to be replaced in the code with pyodide.http.open_url
  • The notebook text is hardcoded in the GrapherPage.tsx file

@owidbot
Copy link
Contributor

owidbot commented May 14, 2024

Quick links (staging server):

Site Admin Wizard

Login: ssh owid@staging-site-wasm-notebooks

SVG tester:

Number of differences (default views): 0
Number of differences (all views): 0

Edited: 2024-07-31 08:03:08 UTC
Execution time: 1.26 seconds

Copy link

This PR has had no activity within the last two weeks. It is considered stale and will be closed in 3 days if no further activity is detected.

@github-actions github-actions bot added the stale label Jun 13, 2024
@danyx23 danyx23 added pinned and removed stale labels Jun 13, 2024 — with Graphite App
@danyx23 danyx23 changed the base branch from master to server-side-csv July 24, 2024 11:23
Copy link
Contributor Author

danyx23 commented Jul 24, 2024

@danyx23 danyx23 force-pushed the wasm-notebooks branch 2 times, most recently from 94db4fd to 13164b2 Compare August 12, 2024 11:57
@danyx23 danyx23 changed the base branch from server-side-csv to server-side-csv-download-ui October 4, 2024 20:50
@danyx23 danyx23 force-pushed the server-side-csv-download-ui branch from d969e24 to 5883108 Compare October 5, 2024 13:30
@danyx23 danyx23 force-pushed the server-side-csv-download-ui branch from 5883108 to 4f7e0f5 Compare October 5, 2024 15:12
@danyx23 danyx23 force-pushed the server-side-csv-download-ui branch from 4f7e0f5 to d5f368f Compare October 5, 2024 16:23
@danyx23 danyx23 changed the base branch from server-side-csv-download-ui to server-side-csv-file-restructure October 24, 2024 15:00
@danyx23 danyx23 force-pushed the server-side-csv-file-restructure branch from 19e2195 to 7220fe7 Compare October 24, 2024 15:23
Base automatically changed from server-side-csv-file-restructure to master October 28, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants