Skip to content

feat: add marimo notebooks#37

Merged
domoritz merged 3 commits into
uwdata:mainfrom
gvwilson:adding-marimo-notebooks
Apr 30, 2026
Merged

feat: add marimo notebooks#37
domoritz merged 3 commits into
uwdata:mainfrom
gvwilson:adding-marimo-notebooks

Conversation

@gvwilson
Copy link
Copy Markdown
Collaborator

This PR adds marimo notebook versions of the .ipynb files in the ./marimo directory, and adds URLs to README.md to launch those notebooks in molab. The URLs currently refer to the author's repo (gvwilson) and this branch (adding-marimo-notebooks) so that the PR can be tested. Those URLs will have to be adjusted to make this work on main before the PR is merged.

Note that these notebooks load datasets from URLs rather than from altair.datasets so that the same notebooks can be used via WASM (which can't load altair.datasets because of Pyodide/C-package issues).

This PR is an alternative to #36.

This PR adds marimo notebook versions of the .ipynb files in the
`./marimo` directory, and adds URLs to `README.md` to launch those
notebooks in molab.  The URLs currently refer to the author's repo
(`gvwilson`) and this branch (`adding-marimo-notebooks`) so that the
PR can be tested.  Those URLs will have to be adjusted to make this
work on `main` before the PR is merged.

Note that these notebooks load datasets from URLs rather than from
`altair.datasets` so that the same notebooks can be used via WASM
(which can't load `altair.datasets` because of Pyodide/C-package
issues).
Copy link
Copy Markdown
Member

@domoritz domoritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Can you add instructions for running the notebooks locally to the readme?

Bonus points for adding a workflow in https://github.com/uwdata/visualization-curriculum/tree/main/.github/workflows to run these notebooks so we can make sure they run with the specified versions.

Comment thread marimo/01_introduction.py
Comment on lines +1 to +8
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "altair==6.1.0",
# "marimo",
# "pandas==3.0.1",
# ]
# ///
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this header if we have the pypackage.toml already? I'm worried about keeping the versions in sync.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PEP 732 header allows people to run the notebook with (e.g.) uv run marimo run notebook.py without having to set up a virtual environment, while still being able to run it within a virtual environment if they'd rather.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't uv run marimo run notebook.py pick up the top level pypackage.toml we have in this repo? I notice that we for example already have a discrepancy in pandas versions ("pandas>=3.0.2"). But we can address this later. Let's get the marimo notebooks merged.

@gvwilson
Copy link
Copy Markdown
Collaborator Author

  1. Added instructions to README.md - please let me know what you think.
  2. README links to the altair section of the marimo website - the target for the link should be deployed later today (2026-04-30).
  3. Added a new workflow to run the marimo notebooks (expecting the debugging notebook to produce errors). Seems to work for me, but feedback would be greatly appreciated.

@domoritz domoritz merged commit 837dfee into uwdata:main Apr 30, 2026
1 check passed
@domoritz
Copy link
Copy Markdown
Member

Thank you @gvwilson!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants