docs(notebooks): add google colab badge and install cell to model construction notebook#406
Conversation
| "import sys\n", | ||
| "if \"google.colab\" in sys.modules:\n", | ||
| " %pip install \"inferactively-pymdp\" -q" |
There was a problem hiding this comment.
logic:
- we only run this install if we are in a colab space
- we can install the vanilla dependencies, as colab ships with JAX and CUDA support already there. (in fact if you try
%pip install "inferactively-pymdp[gpu]" -qyou get an error)
|
@conorheins I can't remember what we decided on notebook outputs? it does make the diffs much more painful to evaluate, but I think for tutorial notebooks especially they're worth keeping so that people can see what the expected results are without necessarily having to run it. |
|
This is a nice idea and agree will make quick experimentation for users and demo-ing during presentations much more frictionless.
good question -- yeah the policy was to keep saved outputs. the relevant prior work are PRs #367 and #375. Short version of the policy:
So keeping outputs in the uv sync --group dev
uv run --group dev pre-commit install
uv run --group dev pre-commit run --all-filesit'll fix the metadata + renumber the execution counts, and the diff will get a lot easier to review. Worth installing before you push #407 too since it touches all 20 notebooks. Docs for all of this are in FYI the hooks aren't wired into a CI job ( only the ruff linting runs there) so this won't block the merge, but it's the documented convention. |
|
ok that's done for this one, once this is merged I'll update the PR stacked on top. |
conorheins
left a comment
There was a problem hiding this comment.
LGTM!
One heads-up for #407: most of the other 19 notebooks haven't been touched since the notebook standardization rule landed in #375, so when you run the hooks on that stacked PR you'll see each notebook diff come out bigger than just "add 2 cells"; there'll be incidental kernelspec/language_info stripping and exec-count renumbering baked in alongside the badge + install cell. That's expected and fine, just don't be surprised by the diff sizes
…407) Follow on from #406 Diff is a bit larger than expected because of #406 (review)
🤖 I have created a release *beep* *boop* --- ## [1.0.3](v1.0.2...v1.0.3) (2026-06-08) ### Documentation * **notebooks:** add colab badge and install cell to other notebooks ([#407](#407)) ([c9f8ef9](c9f8ef9)) * **notebooks:** add google colab badge and install cell to model construction notebook ([#406](#406)) ([be658c2](be658c2)) * remove legacy docs folder ([#409](#409)) ([57b09cf](57b09cf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
It would be good to be able to run our notebooks in google colab (makes talks and live demos much easier).
This change modifies the
model_construction_tutorialnotebook so that this works.I'll do the others in a follow-up PR, just wanted this one to be small to make the changes obvious