Skip to content
Notebooks demonstrating access to Swarm data for scientific analyses. To be deployed on the VRE.
Jupyter Notebook
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
01a__Intro-Jupyter-Python.ipynb
02a__Intro-Swarm-viresclient.ipynb
02b__viresclient-Available-Data.ipynb
02c__viresclient-API.ipynb
02d__viresclient-Large-Data.ipynb
02z1__Template-Basic.ipynb
03a1_Demo-MAGx_LR_1B.ipynb
03a2_Demo-MAGx_HR_1B.ipynb
03b__Demo-EFIx_LP_1B.ipynb
03c__Demo-IPDxIRR_2F.ipynb
03d__Demo-TECxTMS_2F.ipynb
03e1_Demo-FACxTMS_2F.ipynb
03e2_Demo-FAC_TMS_2F.ipynb
03f__Demo-EEFxTMS_2F.ipynb
03g__Demo-IBIxTMS_2F.ipynb
04a1_Geomag-Models-VirES.ipynb
04b1_Geomag-Models-eoxmagmod.ipynb
05a1_Polar-Region-Plots.ipynb
LICENSE
README.md
notebooks.json

README.md

Swarm_notebooks

VRE-Interact nbviewer

Notebooks demonstrating access to Swarm data for scientific analyses. For more info, and to view them, go to https://swarm-vre.readthedocs.io/en/staging/notebooks_preface.html

Execution of notebooks (nbconvert)

Convert to executed state in place:

jupyter nbconvert --to notebook --inplace --execute 03*.ipynb

but be careful about cells that can't be handled by the automation (e.g. set_token, widgets...).

By default, errors will cause nbconvert to halt. To allow errors (and execution will continue onto the following cells), use allow_errors:

jupyter nbconvert --to notebook --inplace --execute --ExecutePreprocessor.allow_errors=True 02a__Intro-Swarm-viresclient.ipynb

To be determined whether the automated execution works well enough.

Testing of notebooks (nbval)

Use nbval to just verify that notebooks complete without error (nbval-lax). nbval can also verify that cell outputs do not change, but that would be overly complicated to work with as the outputs will often change (e.g. change in progress bars, change in exact figure contents).

Quickstart:

  • pip install pytest nbval
  • pytest --nbval-lax *.ipynb
  • Mark cells to be skipped with # NBVAL_SKIP like:
# NBVAL_SKIP
from viresclient import set_token
set_token("https://vires.services/ows", set_default=True)
# (user is now prompted to enter the token)
You can’t perform that action at this time.