-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
- all validation functions just take an atlas object - means we don't need a parameters list - also simplify output list to be dicts of lists mapping the atlas name to values - another advantage of this is that it simplifies mocking of atlas functions in the tests
for more information, see https://pre-commit.ci
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main brainglobe/bg-atlasgen#113 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 24 24
Lines 1943 1943
=====================================
Misses 1943 1943 ☔ View full report in Codecov by Sentry. |
bg_atlasgen/validate_atlases.py
Outdated
try: | ||
validation_function(*validation_function_parameters[i]) | ||
successful_validations.append((atlas_name, validation_function)) | ||
validation_function(atlas_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried running the individual functions locally on "allen_mouse_100um"
. They all worked. When I tried validate_atlases
it gave me an error. I think line 161 should be: validation_function(BrainGlobeAtlas(atlas_name))
instead of validation_function(atlas_name)
. It works when I change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this solution. Just one tiny comment in validate_atlases.py
, line 161
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on HPC. It ran with the expected output.
Description
What is this PR
Why is this PR needed?
New validation functions currently require a change in two places of the main validation script
validate_atlases.py
.What does this PR do?
This PR makes all validation functions just take a single argument, which has to be atlas object - this is a requirement from now on. This means we don't need to build and maintain an ordered parameters list for each validation function in
validate_atlases.py
. Another advantage of this is that it simplifies mocking of atlas functions in the testsThis PR also simplify output list to be dicts of lists mapping the atlas name to values, so a possible output of a successful validations of atlas "allen_mouse_100um" would look like:
instead of
reducing repetition.
References
Closes #112
How has this PR been tested?
Existing tests have been adapted to fit new validation function signature.
Two new test fixtures have been added to reduce code length and increase flexibility.
Is this a breaking change?
Yes, the signature of the validation functions has changed.
Does this PR require an update to the documentation?
To be tackled in brainglobe/brainglobe-atlasapi#209
Checklist: