Skip to content
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

Improved docs for NDSL examples #63

Conversation

romanc
Copy link
Collaborator

@romanc romanc commented Aug 5, 2024

Description

Tutorials are in important step in on-boarding new library users. While working through the examples, I noticed a couple of typos and broken links. In the bigger picture, we figured that examples should use the boilerplate code that the middleware already exposes in ndsl.boilerplate. I've also added a README file with a little bit of context and a quickstart guide to get people up and running with minimal overhead. And we agreed to remove the output currently stored in the Jupyter notebooks. This was one in the first commit such that we can see the actual changes when looking at the other commits.

In summary

  • Removed all output from the Jupyter notebooks
  • Moved plot_filed_at_kN from examples/NDSL/basic_boilerplate.py to ndsl/boilerplate.py. This adds matplotlib to the list of dependnecies.
  • Refactored Jupyter notebooks get all boilerplate code from ndsl.boilerplate.
  • Removed examples/NDSL/*_boilerplate.py
  • Added examples/NDSL/README.md with a bit of context.
  • Fixed typos and broken links in Jupyter notebooks.

It is recommended to exclude the first commit when looking at the diff, e.g. this view is much nicer to look at.

Regarding the previous addition of a .tool-versions file a python version manager: With the install instructions as simple as pip install ndsl[demos], I don't think we need this complexity anymore. The middleware's README already specifies the need for python 3.11. How developers ensure this should be up to them.

Fixes: N/A

How Has This Been Tested?

I ran all the notebooks locally against a local version of NDSL.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included

Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

I am for removing all results here and encoding them in the markdown and/or rendering the plots.

examples/NDSL/requirements.txt Outdated Show resolved Hide resolved
examples/NDSL/basic_boilerplate.py Outdated Show resolved Hide resolved
@romanc romanc force-pushed the feature/better-docs-for-ndsl-examples branch 2 times, most recently from bb539e5 to 97ee945 Compare August 6, 2024 10:23
Roman Cattaneo added 3 commits August 6, 2024 12:41
- Use boilerplate from ndsl.boilerplate
- Fix typos & broken links in notebooks
- Added README with quickstart guide
@romanc romanc force-pushed the feature/better-docs-for-ndsl-examples branch from 97ee945 to 8c6b4e0 Compare August 6, 2024 10:44
Copy link
Collaborator Author

@romanc romanc left a comment

Choose a reason for hiding this comment

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

Some notes/questions inline

examples/NDSL/02_NDSL_basics.ipynb Show resolved Hide resolved
examples/NDSL/02_NDSL_basics.ipynb Show resolved Hide resolved
setup.py Show resolved Hide resolved
@romanc romanc marked this pull request as ready for review August 6, 2024 10:54
ndsl/boilerplate.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
@romanc romanc changed the title RFC: Improved docs for NDSL examples Improved docs for NDSL examples Aug 6, 2024
For some reason, this file was had the executable flag, marking it an
executable under linux-based filesystem. Since notebooks aren't directly
executed and rather read by Jupyter (or whatever platform), this is
unnecessary. Other notebooks didn't have the executable flag (which is
what I would expect).
@romanc
Copy link
Collaborator Author

romanc commented Aug 6, 2024

Sorry, for yet another commit. Just realized that one of the notebooks was marked as executable

image

Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

Looking good, merging this

@FlorianDeconinck FlorianDeconinck merged commit 4b16dd4 into NOAA-GFDL:develop Aug 7, 2024
5 checks passed
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