networkx / nx-guides

Examples and Jupyter Notebooks about NetworkX
https://networkx.org/nx-guides/
Creative Commons Zero v1.0 Universal
188 stars 104 forks source link

Setting up networkx-notebooks site #21

Closed rossbar closed 3 years ago

rossbar commented 3 years ago

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:

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 commented 3 years ago

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 commented 3 years ago

~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 commented 3 years ago

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.