Skip to content

Add ipympl example#219

Merged
jtpio merged 1 commit intojupyterlite:mainfrom
martinRenou:ipympl
Jul 7, 2021
Merged

Add ipympl example#219
jtpio merged 1 commit intojupyterlite:mainfrom
martinRenou:ipympl

Conversation

@martinRenou
Copy link
Copy Markdown
Member

@martinRenou martinRenou commented Jul 6, 2021

ipympl.mp4

@jtpio jtpio added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 6, 2021
@martinRenou martinRenou marked this pull request as ready for review July 6, 2021 15:43
@martinRenou
Copy link
Copy Markdown
Member Author

It seems to work only with this ugly workaround for now:

import sys
import types

sys.modules['tornado'] = types.ModuleType('tornadofake')

Tracking this in ipympl directly: matplotlib/ipympl#334

@jtpio
Copy link
Copy Markdown
Member

jtpio commented Jul 6, 2021

It seems to work only with this ugly workaround for now:

It would be totally fine to have that in the examples for now.

Or maybe we should even bake that in https://github.com/jtpio/jupyterlite/blob/main/packages/pyolite-kernel/py/pyolite/pyolite/__init__.py directly?

@martinRenou
Copy link
Copy Markdown
Member Author

Yes! I can do that :)

@bollwyvl
Copy link
Copy Markdown
Collaborator

bollwyvl commented Jul 6, 2021

Not to pick on this PR (which is raaaad), but could we, to the extent possible, be more intentional about some of the imports hacks so that these things run under nbconvert --execute and nbval? e.g.

try:
    import pyolite
    # do hacky things
except ImportError:
    pass

It's also worth adding a <details><summary>Limitations</summary>...</details> markdown cell above any cells like these to all of our examples. Totally aside, but dang i sure wish there was a good markdown flavor that supported details...

@martinRenou
Copy link
Copy Markdown
Member Author

be more intentional about some of the imports hacks so that these things run under nbconvert --execute and nbval?

Yeah! I guess all the micropip.install commands should go there as well, for all notebooks?

@jtpio
Copy link
Copy Markdown
Member

jtpio commented Jul 7, 2021

Yeah! I guess all the micropip.install commands should go there as well, for all notebooks?

Maybe, at the expense of making the code less readable?

be more intentional about some of the imports hacks so that these things run under nbconvert --execute and nbval?

Maybe we could track this in a separate issue. For now the example notebooks are really meant to be used in JupyterLite so they could probably stay as they are?

@jtpio
Copy link
Copy Markdown
Member

jtpio commented Jul 7, 2021

@martinRenou should we go ahead and merge this PR? I guess we can always go back to it later once matplotlib/matplotlib#20591 is fixed

@martinRenou
Copy link
Copy Markdown
Member Author

If there is no other blocker, yes :)

@jtpio
Copy link
Copy Markdown
Member

jtpio commented Jul 7, 2021

I've added a screencast to the top comment for reference.

Copy link
Copy Markdown
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

@jtpio jtpio merged commit 63e15ac into jupyterlite:main Jul 7, 2021
@martinRenou martinRenou deleted the ipympl branch July 7, 2021 14:42
@jtpio jtpio added this to the 0.1.0 milestone Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants