-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
base: main
Are you sure you want to change the base?
Add a JupyterLite-powered interactive shell for the pandas
website (reprise of #47428)
#60758
Conversation
Co-Authored-By: Jeremy Tuloup <[email protected]>
Co-Authored-By: Jeremy Tuloup <[email protected]>
cc @datapythonista if you're interested in taking a look, I plan to review in the next few days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
|
||
**Running it requires a reasonable amount of bandwidth and resources, so it may not work properly on all devices or networks.** | ||
|
||
<iframe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will start loading on the Getting Started page, is that right? If so, I think we should perhaps move to its own page so that users don't have to spend the bandwidth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it won't start loading on the page. The &execute=0
URL parameter ensures that the bandwidth consumption will start only at the moment users press Enter in the import pandas as pd
cell.
I would be happy to move to another page if you insist we should further reduce the bandwidth consumption from loading the JupyterLite assets themselves (which would be much smaller than the WASM wheels for pandas
and its dependencies).
environment.yml
Outdated
# which in-turn comes with pandas 2.2.3: | ||
# 1. https://jupyterlite-pyodide-kernel.readthedocs.io/en/stable/#compatibility | ||
# 2. https://pyodide.org/en/stable/usage/packages-in-pyodide.html | ||
# We constrain/pin here to avoid breaking changes on rebuilds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We typically do not do this because hard pinning for some time and then doing a major upgrade is often harder than addressing each break as it comes in. Is there a reason we should take a different approach here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to me. I think I kept this so that there are no unexpected changes to the pandas
version provided in the shell. We could unpin this so that pandas
is at the latest version available in Pyodide, which makes sense for a user-facing change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unpinned in 391ce1e for now, thanks!
environment.yml
Outdated
# Pyodide kernel version 0.5.2 comes with Pyodide 0.27.1 | ||
# which in-turn comes with pandas 2.2.3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this comment is attempting to convey - is there a reason this is important? Also, not sure if it's relevant but what comes with pandas 2.2.3 doesn't seem important here; this is used for dev envs, not releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be more relevant when I will write a PR (hopefully soon!) to enable interactive docs for pandas
, where it might make sense for the version of pandas
in pandas
's examples to be in sync with the one readers browse the documentation for. However, it is not useful here, and I can suggest doing this as a part of greater discussion when that happens.
Many thanks for the review, @rhshadrach! I'm sorry for not having responded earlier than I could; I was on vacation recently. This should be ready for another look whenever you get a chance. |
Also, re-requesting a review from @jtpio, just in case I missed something. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.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 withpandas
version 2.2.3.The differences in the changes from the previous PR are as follows:
jupyterlite-pyodide-kernel
have been incorporated, i.e., 0.5.0 and 0.5.2 respectivelyAs 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!