-
-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test notebooks #294
Comments
Hi @alejandrosame I wonder if you're working on this? Or are you open for newbies like me to try and tackle this? I created a file in tests/notebooks/test_carrots.py containing this:
basically just to run carrots_demo.ipynb when doing py.test. Although maybe need to add assert certain values in the notebook itself to check for correctness? Not sure if this is aligned with your thoughts. |
@edwardelson you are more than welcomed to work on the task! As far as I can tell, all notebooks are under ./examples and every future notebook should also en up somewhere under that folder (@chinmayshah99, just to double check). What I had envisioned was a generic version of that script that:
That way the configuration can be maintained in the repository .env file and the script can easily be called from a make target and a dedicated workflow file. The script and the new workflow YAML will already suffice to fulfill the goal of this task (to help keeping track of outdated notebooks). |
On another hand, you raise an important point with:
Since notebooks are prepared with an expected outcome in mind, they can serve as additional regression/validation tests. However, I find it worth creating a separate issue due to workload (it will require changing current notebooks and documenting in guidelines so future contributors can apply it to new notebooks). Whatever the possible solutions are, we need to keep in mind that they are primarily meant as demos to learn how to use the library, so we shouldn't sacrifice readability when we already have tests in place. So yeah, if you also are interested in working on that, I would suggest that we make a new issue to properly tackle it! |
I've submitted a PR @alejandrosame. Not sure how to encode the path in env though (still hardcoded the example/ path), need your advice. Yes I agree that notebook validation test would probably be another interesting issue. Maybe we can use papermill to inject values and check the output of these notebooks without adding plenty of assertions in the notebook? (I've never used papermill yet though but been reading about it) |
Is this similar to |
I mean reading the PATH from an environment variable like shown here. If you find yourself too lost with that part, simply leave the path defined in a variable (instead of directly hard-coded in the function call) and a new task to integrate it with the .env file can be filed. However, I encourage you to ask for more guidance, if you have time for it :) |
Description
When developing the codebase, it is easy for notebooks to become outdated. We should add test to our CI that warn us when notebooks stop working due to API changes. This is crucial, since notebooks are important pieces of documentation.
Type of Test
Expected Behavior
When a contributor makes a change in PyDP, I want the CI to avoid merging the change until notebooks are up to date with the changes.
Additional Context
The text was updated successfully, but these errors were encountered: