You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To help ensure that our tutorial notebooks stay up-to-date with each new release, we should add a testing script that runs each notebook in the docs/tutorials folder. Here's a rough outline of a test that will do just that and clean things up afterward.
import os
import hera_sim
def test_tutorial_notebooks():
base_path = os.path.split(hera_sim.__path__[0])[0]
nb_path = os.path.join(base_path, "docs/tutorials")
nb_names = [nb for nb in os.listdir(nb_path) if nb.endswith(".ipynb")]
nb_files = [os.path.join(nb_path, nb_name) for nb_name in nb_names]
for nb_file in nb_files:
os.system("jupyter nbconvert --execute %s" % nb_file)
# clean up all of the html files created by the above command
nb_names_html = [nb for nb in os.listdir(nb_path) if nb.endswith(".html")]
nb_files_html = [os.path.join(nb_path, nb_name) for nb_name in nb_names_html]
assert len(nb_files) == len(nb_files_html)
for nb_file_html in nb_files_html:
os.remove(nb_file_html)
This should be the bare minimum needed for a test script that ensures each tutorial notebook runs successfully, but there will likely be complications (in particular, some fine tuning might be needed to make sure that none of the cells in the VisibilitySimulator tutorial time out). When this is implemented, the travis build will need to be updated to ensure that any extra dependencies (e.g. pygsm), as well as jupyter and nbconvert, are installed.
The text was updated successfully, but these errors were encountered:
To help ensure that our tutorial notebooks stay up-to-date with each new release, we should add a testing script that runs each notebook in the
docs/tutorials
folder. Here's a rough outline of a test that will do just that and clean things up afterward.This should be the bare minimum needed for a test script that ensures each tutorial notebook runs successfully, but there will likely be complications (in particular, some fine tuning might be needed to make sure that none of the cells in the
VisibilitySimulator
tutorial time out). When this is implemented, the travis build will need to be updated to ensure that any extra dependencies (e.g.pygsm
), as well asjupyter
andnbconvert
, are installed.The text was updated successfully, but these errors were encountered: