add plate compression and validation notebook, helper module, and unit tests#364
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “plate compression and validation” notebook plus shared helper utilities and tests to support running/validating notebook-driven workflows and comparing their generated outputs against committed fixtures.
Changes:
- Added
plate_compression_and_validation.ipynband a corresponding notebook execution test. - Introduced
metapool/notebook_utils.py(and unit tests) to share notebook helper functions. - Added new expected output fixtures for the notebook (
plate_df+expt_info).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
notebooks/plate_compression_and_validation.ipynb |
New notebook implementing compression + controls + validation and writing outputs. |
notebooks/tests/test_plate_compression_and_validation.py |
Executes the new notebook via the shared test harness and verifies expected outputs. |
notebooks/tests/notebook_test_helpers.py |
Extends notebook test harness to better support auto-constructed paths and directory creation. |
metapool/notebook_utils.py |
New shared helpers for notebooks (attribute extraction + delimiter inference). |
metapool/tests/test_notebook_utils.py |
Unit tests for the new notebook utility helpers. |
notebooks/test_output/QC/ShotgunMetag_plate_df_compvalid.txt |
Fixture output for plate dataframe produced by the new notebook. |
notebooks/test_output/QC/ShotgunMetag_expt_info.yml |
Fixture output for experiment metadata produced by the new notebook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request Test Coverage Report for Build 21840935318Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
antgonza
left a comment
There was a problem hiding this comment.
Looks good, thank you @AmandaBirmingham - just a few questions.
| - Email: r@gmail.com | ||
| HumanFiltering: 'False' | ||
| Project Abbreviation: ADAPT | ||
| Project Name: Celeste_Adaptation_12986 |
There was a problem hiding this comment.
Are these values OK to add to a repo?
There was a problem hiding this comment.
Fair; as test values, these aren't exactly naughty but they also aren't exactly nice. I can't clean these values out of the whole repo, but I can stop propagating them into new test files like these.
| _OUT_PARAM_VARIABLE_KEY = "param_variable" | ||
| _FILE_PATH_KEY = "is_filepath" # key for file path parameters | ||
| _AUTOCONSTRUCTED_KEY = "is_autoconstructed" # if param not set explicitly | ||
| _AUTOCONSTRUCTED_FPS_KEY = "__TestNotebook_autoconstructed_fps" |
There was a problem hiding this comment.
Wonder if the double underscore is needed or would it be fine to only have one?
There was a problem hiding this comment.
I used the double underscore to try to differentiate this even more from "real" variable names that anyone might put into a notebook (since those are essentially unconstrained and might be anything).
|
|
||
| 'studies_info': [ | ||
| { | ||
| 'Project Name': 'Celeste_Adaptation_12986', |
There was a problem hiding this comment.
FWIW, as it's show in this list, in the past we used TestProjA or TestProjB and fake study ids to minimize overlap with values in qiita.
There was a problem hiding this comment.
TestProjB is used here too, for one of the studies. Sadly, the two Celeste studies are completely entwined with our test data; I can change the names by which they are called in the notebook (which I have done), but to change their study ids would require modifying quite lot of known-good files. I don't think I can take that on yet ;)
This PR:
sample_validation_and_plate_compression.ipynbnotebook and associated unit testsmetapool/notebook_utils.pymodule that houses some helper functions used in notebooks and adds unit tests