-
Notifications
You must be signed in to change notification settings - Fork 23
printing data frames with validation function information #115
Conversation
for more information, see https://pre-commit.ci
…re implemented on another branch
…re implemented on another branch
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 24 24
Lines 1943 1952 +9
=====================================
- Misses 1943 1952 +9 ☔ View full report in Codecov by Sentry. |
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.
Could you motivate the reason for needing better printing more (in the "Why is this PR needed" section of the description)?
pass additional information is stored
I don't understand what extra information is stored? I think all the info required is in our output now (the outputs are dictionaries, not lists, now, I think) but it may not be displayed nicely when printing.
Furthermore, I am not sure adding pandas
as an extra dependency is necessary what you'd like achieve here.
We may want to move away from printing to writing a structured text file as output anyway - what do you think?
Thanks @alessandrofelder for the quick review. I'm a bit confused. I'm on the main branch and as far as I understand our outputs at the moment are the
I just made this branch to help me debug the test functions as I don't fully understand their behaviour and it would be nice to see in a lookup table what validation functions pass or fail on each atlas. |
Also, writing a structured text file is a great idea! I'm fully on board 🙂 |
Sorry, yes, you're right - they are lists (of dictionaries).
We are, indirectly, right, because we append them to the aforementioned lists? Maybe we actually want one object, containing all the necessary info to be able to generate:
|
…y the name of the successful and failed functions (not the function object) to lists in validate_atlases function
for more information, see https://pre-commit.ci
Looks like it works as expected. @alessandrofelder, is there a convention on where to save output files? For now, they are in the |
I think they should go in |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
Two tiny comments for you to consider:
- discussion point for a possible refactoring we could add on here
- I think we can delete some variables that we've stopped using?
Looks great otherwise!
bg_atlasgen/validate_atlases.py
Outdated
successful_validations[atlas_name].append( | ||
validation_function.__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.
successful_validations[atlas_name].append( | |
validation_function.__name__ | |
) | |
validations[atlas_name].append( | |
validation_function.__name__, None | |
) |
(:arrow_up: Just a sketch... and just a discussion point)
Should we combine the two lists while we're refactoring this, and have them have the same format (str(error)
if failed, and None
if valid)? The advantage would be simplicity
- just one file
- shorter and easier to read code
But it's entirely possible there's value in keeping the things separate? What do you think?
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.
Thanks for this suggestion! I was also thinking about doing this but wanted to have a chat first, as I wasn't sure how to implement it. I think it would be much better to have only one file with all the necessary information.
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.
@alessandrofelder, I implemented these changes and tested them locally and on the HPC. Could you check them, please? 🙂
I think it's ready to be merged if you approve the changes.
result file:
validation_results.json
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.
Thanks @viktorpm - As per our developer's guide around PRs, you have the liberty to merge if your reviewer approves with optional comments without asking for another round of review :) I have had another look though and looks great!
Co-authored-by: Alessandro Felder <[email protected]>
removing unused variables Co-authored-by: Alessandro Felder <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Description
Implementing a new way of printing validation function results
What is this PR
Why is this PR needed?
Currently, only the lists of valid and invalid atlases are printed. One atlas can be in both lists as it might pass one validation function but not the other.
What does this PR do?
To get more information on why an atlas is invalid and which validation function it did not pass additional information is stored and printed in data frames.
How has this PR been tested?
It was tested locally and on the HPC
Is this a breaking change?
No
Does this PR require an update to the documentation?
No
Checklist: