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

Add a JupyterLite-powered interactive shell for the pandas website (reprise of #47428) #60758

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

agriyakhetarpal
Copy link
Contributor

@agriyakhetarpal agriyakhetarpal commented Jan 22, 2025

This pull request aims to reinstate the machinery for adding a JupyterLite shell for the pandas website, based on discussions in #60747 and on Slack, please see them for a rationale on this change (short answer: it's been a while in 2025 and things might be smoother now).

An interactive shell was first discussed in #46682 and later removed in #49807. There was a request to reinstate this in #49807 (comment) which might not have been noticed, so I hope #60747 and this PR bring more visibility to the proposal.

In particular, this PR adds back the previous changes from #47428, with only minor differences in the configuration. I've used (and pinned) the jupyterlite-pyodide-kernel for the REPL, which in-turn provides Pyodide version 0.5.2, which comes with pandas version 2.2.3.

The differences in the changes from the previous PR are as follows:

  • newer versions of JupyterLite and jupyterlite-pyodide-kernel have been incorporated, i.e., 0.5.0 and 0.5.2 respectively
  • source maps have been disabled when building JuptyerLite, which should reduce the size of static assets significantly and allow for faster load times
  • the word "Experimental" has been added to the REPL's Markdown heading to indicate it as such

As mentioned in #60747, it is also possible to use the https://jupyterlite.github.io/demo/ REPL in the iframe to remove dependencies, however, it would come at the cost of disabled optimisations and a general lack of control for how the REPL is built.

cc: @jtpio, please feel free to add any suggestions!

@mroeschke mroeschke added the Web pandas website label Jan 22, 2025
@agriyakhetarpal
Copy link
Contributor Author

Well, looking at the website from the downloaded artifact, having it at 100% width definitely doesn't look great:

pandas website displayed from the documentation build artifact from the build from gh-60758. This image is that of the Getting Started section, where a heading 'Experimental, try pandas in your browser' is displayed, with an interactive shell to run pandas code in the browser. It occupies the entire width of the website area from the left margin to the right

and reducing the width to 50% would affect mobile devices and/or narrower screen sizes. I'll try to fix this by adding some inline CSS.

@agriyakhetarpal
Copy link
Contributor Author

I hope it looks better now:

pandas website displayed from the documentation build artifact from the build from gh-60758. This image is that of the Getting Started section, where a heading 'Experimental, try pandas in your browser' is displayed, with an interactive shell to run pandas code in the browser. It now occupies a smaller portion of the screen and stays true to its given width, with a maximum width of 650px. This retains the aspect ratio and makes the REPL look cleaner. There is also a dark blue border around the REPL, as it is

I also fixed a scaling issue for narrower screens for the YouTube video a few sections above this, which also affected how the REPL looked on mobile devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web pandas website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Reinstate the JupyterLite-based live shell for the pandas website
3 participants