-
-
Notifications
You must be signed in to change notification settings - Fork 206
Begin incorporating myst features into notebooks #279
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
base: main
Are you sure you want to change the base?
Conversation
bsipocz
left a comment
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 do like what I see so far.
| If you prefer, you can use your own image as you work through this tutorial. | ||
| In order to transform your image into a NumPy array that can be manipulated, you | ||
| can use the `imread` function from the | ||
| [matplotlib.pyplot](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot) submodule. | ||
| Alternatively, you can use the | ||
| [imageio.imread](https://imageio.readthedocs.io/en/stable/_autosummary/imageio.v3.imread.html) | ||
| function from the `imageio` library. | ||
| Be aware that if you use your own image, you'll likely need to adapt the steps below. | ||
| For more information on how images are treated when converted to NumPy arrays, | ||
| see [A crash course on NumPy for images](https://scikit-image.org/docs/stable/user_guide/numpy_images.html) from the `scikit-image` documentation. |
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 would recommend to follow standard(?) markdown style and put one sentence on one line. That would help with future review by limiting the diff.
(and if you think a line is way too long it would just nicely nudge you to cut it into two sentences :) )
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.
Yeah ideally we find a linter to automagically enforce some reasonable line breaks, then update all the notebooks in one PR and add that commit to the .git-blame-ignore-revs.
9899143 to
f2a177a
Compare
To this point, numpy-tutorials made the policy decision to limit markup that wouldn't work within notebooks themselves. The Jupyter community generally seems to be moving towards better integrating MyST into the Jupyter ecosystem, and we certainly want to make use of/encourage these developments for richer scientific communication! Now that the
jupyterlab_mystextension exists, markdown features beyond commonmark are supported in notebooks themselves.This PR includes integration of 2 main features of MyST:
I resisted the temptation to improve cross-linking as I don't think the underlying tooling is consistent across the JB1/JB2 boundary: JB1 allows us to make use of
intersphinx, but the story in JB2 is not yet as clear.The use of admonitions should be relatively unobjectionable as they are (IMO) now well-supported both in rendered outputs and in interactive notebooks (albeit requiring an extension [for now]). The execution skipping/exception rendering is more experimental as I suspect the testing tools are not fully up-to-speed to support it. Nevertheless it's a nice feature and something I think we should work towards ensuring is supported in the JB2 universe!
A minor note about the admonitions: the diffs make it look like content has changed but in practice the only thing that's different (aside from the admonitions themselves) is that I added linebreaks. We should look into adding a linter to handle line length, but that's a separate issue. If the added newlines are a blocker for adding admonitions I'm happy to back them out - just LMK!