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

Setting up networkx-notebooks site #21

Merged
merged 9 commits into from
Apr 15, 2021
Merged

Conversation

rossbar
Copy link
Contributor

@rossbar rossbar commented Apr 15, 2021

Supersedes #11. This infrastructure is based on that used by numpy-tutorials

Sets up the notebooks repository to generate a sphinx site using tooling from the executablebooks project.

Features include:

  • Text-based notebook format for easy authorship & review
  • Integration with cloud-based notebook execution platforms (binder in this case, though can easily add others like JupyterHub if desired. Note however that the binder links won't work until this is merged)
  • Generates a static site that can be added to the networkx.org domain (if desired).
  • Additionally, since it's a sphinx site it integrates well with official documentation allowing us to reference and/or embed this site as e.g. a gallery in the official docs (if desired).
  • CI for testing notebook execution for every new addition/change.

Note: In this PR, I didn't add or remove any of the original content from the notebooks that were already in this repo; however, I did convert them to the text-based notebook format.

An example of the rendered site: https://rossbar.github.io/notebooks-1/

@rossbar
Copy link
Contributor Author

rossbar commented Apr 15, 2021

The test failures are from pytest --nbval-lax, which fails to pick up any tests in this case since the .ipynb files have all been converted to .md.

AIUI, the --nbval-lax flag just executes the notebooks and reports the failures of any given cell. You get the same behavior with myst-nb, albeit via a sphinx extension instead of pytest.

I've added a workaround in 42eef17 so that the current CI testing infrastructure still works, though as I said --nbval-lax would be redundant with the sphinx-build process. It would be nice to investigate more rigorous testing, either via nbval or other executablebook features; see executablebooks/MyST-NB#290 for example.

@MridulS
Copy link
Member

MridulS commented Apr 15, 2021

just a quick comment - could you also configure binder links on individual notebook pages on the website?

ahh scratch that, it looks like it's the config is in the PR but the generated website https://rossbar.github.io/notebooks-1/ didn't.

Thanks!

@rossbar
Copy link
Contributor Author

rossbar commented Apr 15, 2021

ahh scratch that, it looks like it's the config is in the PR but the generated website https://rossbar.github.io/notebooks-1/ didn't.

Yeah the cloud-based notebook services are all wrapped up in the "rocket icon" that should be in the upper-right hand of each page (or at least each page that has a code cell in it). There's probably a way to change that icon to an explicit binder badge to make it more obvious.

@jarrodmillman jarrodmillman merged commit 6c7c55d into networkx:main Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants