streamlined approach to creating smoke tests by executing noteboks "as is" from the tests and asserting on values of local notebook vars #1233
slayoo
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@claresinger @edejong-caltech @abulenok @AgnieszkaMakulska
We've introduced a new utility that will likely make it easier to accompany notebooks with smoke tests. It's a function called
notebook_vars
that executes a given notebook and returns a dictionary mapping notebook variables to their values at the end of notebook execution: https://open-atmos.github.io/PySDM/PySDM_examples/utils/notebook_vars.htmlHere's an new test using this approach just contributed by @bhiogade (https://github.com/open-atmos/PySDM/blob/main/tests/smoke_tests/parcel/graf_et_al_2019/test_fig_4.py):
As exemplified above, the new tool automagically handles the
plot
flag, so debugging the failing tests one can easily turn plotting on, getting all the notebook plots, without ever starting Jupyter. The relevant notebook looks like this:Beta Was this translation helpful? Give feedback.
All reactions