Skip to content

JupyterLite support#14

Open
jtpio wants to merge 2 commits into
matplotlib:mainfrom
jtpio:jupyterlite
Open

JupyterLite support#14
jtpio wants to merge 2 commits into
matplotlib:mainfrom
jtpio:jupyterlite

Conversation

@jtpio
Copy link
Copy Markdown

@jtpio jtpio commented Jan 14, 2026

For matplotlib/mpl-brochure-site#112

Live version: https://jtpio.github.io/mpl-brochure-binder/lab/index.html?path=MatplotlibExample.ipynb

image

For this to work on this repo you will need to enable GitHub Pages as follows:

image

changes

@github-actions
Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch jtpio/mpl-brochure-binder/jupyterlite

@jtpio jtpio changed the title Jupyterlite support JupyterLite support Jan 14, 2026
story645
story645 previously approved these changes Mar 20, 2026
Copy link
Copy Markdown
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

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

Sorry this got lost!

ax1.plot(datetime, solar, label='hourly')
ax1.plot(datetime, solar_low, label='smoothed')
ax1.legend(loc='upper right')
ax1.set_ylabel('Solar radiation $[W\,m^{-2}]$') # note the use of TeX math formatting
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.

This needs escaping/raw string:

<>:13: SyntaxWarning: invalid escape sequence '\,'
/tmp/xpython_42/3616412460.py:13: SyntaxWarning: invalid escape sequence '\,'
  ax1.set_ylabel('Solar radiation $[W\,m^{-2}]$')   # note the use of TeX math formatting

Comment on lines +89 to +96
ax0.set_xlabel('Solar Radiation $[W\,m^{-2}]$')
ax0.set_ylabel('Temperature $[^oC]$')
ax0.set_title('Hourly', loc='left')


ax1.set_facecolor('0.6')
sc = ax1.scatter(solar_low[::24], temp_low[::24], c=dayofyear[::24], s=4, cmap='RdBu_r')
ax1.set_xlabel('Solar Radiation $[W\,m^{-2}]$')
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.

More escaping:

<>:5: SyntaxWarning: invalid escape sequence '\,'
<>:12: SyntaxWarning: invalid escape sequence '\,'
/tmp/xpython_42/4276427300.py:5: SyntaxWarning: invalid escape sequence '\,'
  ax0.set_xlabel('Solar Radiation $[W\,m^{-2}]$')
/tmp/xpython_42/4276427300.py:12: SyntaxWarning: invalid escape sequence '\,'
  ax1.set_xlabel('Solar Radiation $[W\,m^{-2}]$')

Comment thread .nojekyll
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.

Why is this added? This branch isn't published on GitHub Pages.

Comment thread _PreProcess.ipynb
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.

Why do we still need these files if you've moved them to content? Or do we even need content?

Comment thread environment.yml
@@ -1,11 +1,9 @@
name: mpl_brochure_binder
name: xeus-kernel
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.

Why change the name?

Comment thread README.md

Try it in your browser (no installation required):

[![JupyterLite](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://matplotlib.github.io/mpl-brochure-binder/lab/index.html?path=MatplotlibExample.ipynb)
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.

We don't use GitHub Pages URLs; this link is broken.

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
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.

This (and all other actions) is outdated, and should use SHA hashes instead of rolling tags.

cache-environment: true

- name: Build the JupyterLite site
shell: bash -l {0}
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.

Should keep the error check

Suggested change
shell: bash -l {0}
shell: bash -e -l {0}


runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
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.

We don't use GitHub Pages, so this deployment is not necessary. You should push the results to the gh-pages branch instead (probably overwriting any existing commit.)

@story645 story645 dismissed their stale review March 24, 2026 02:44

Apparently don't know enough about the deployment, was just basing on it working

@QuLogic
Copy link
Copy Markdown
Member

QuLogic commented Mar 25, 2026

Note, if we need to publish this on the website instead of loading the repo itself through binder, it will need to be added to the matplotlib.org repo and we should decide at which path.

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.

3 participants