Test first_notebook_cell
See original GitHub issueWould it be possible to run first_notebook_cell
when running each of the examples to test that the contents are valid?
I imagine having Jupyter magic like %matplotlib inline
might be a problem when executing examples in the test environment, but perhaps there is a way in which we could verify the code in first_notebook_cell
such that projects aren’t shipping broken examples like what happened in https://github.com/pyvista/pyvista/issues/1711
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Testing and debugging - Azure Quantum - Microsoft Learn
Learn how to use unit tests, facts and assertions, and dump functions to test and debug quantum programs.
Read more >Adapting Your Own Training Container - Amazon SageMaker
Run the following command in the first notebook cell to change to the ... To test the container locally in the notebook instance,...
Read more >Databricks Utilities | Databricks on AWS
Understand and learn how to use Databricks Utilities to work with object storage, to chain and parameterize notebooks, and to work with ...
Read more >Common problems and solutions—ArcGIS Notebook Server
Check your network connection or notebook server configuration. ... When I run the default first notebook cell (including the string gis = GIS("home")), ......
Read more >Quick Start — OceanSpy 0.2.0 documentation - Read the Docs
Copy and paste the following lines in the first notebook cell to import OceanSpy, ... Check out Tutorial, Use Cases, and API reference...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Correct
We have https://sphinx-gallery.github.io/stable/configuration.html#reset-modules which might or might not do what you want already
Am I understanding that
first_notebook_cell
isn’t actual run per example when generating the documentation? It is only added when users download the notebook? This isn’t clear to me in the documentation https://sphinx-gallery.github.io/stable/configuration.html#add-your-own-first-and-last-notebook-cell. This seems to be true in my testing, but I wanted to confirm it.If this interpretation is correct, I will open another feature request for having setup and teardown sections that are run when generating the documentation but not when downloading the example. This is the mirror functionality to
first_notebook_cell
andlast_notebook_cell
. This is useful when there is code that is modifying global settings in an example like in the aforementioned https://github.com/pyvista/pyvista/issues/1711, and we want to make sure that these settings do not leak out of the example when an error is raised.