-
Notifications
You must be signed in to change notification settings - Fork 26
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
Logging validation warnings and errors #992
Conversation
9ba61e5
to
1afd408
Compare
Codecov Report
@@ Coverage Diff @@
## master #992 +/- ##
==========================================
+ Coverage 87.49% 87.60% +0.11%
==========================================
Files 64 65 +1
Lines 8110 8151 +41
==========================================
+ Hits 7096 7141 +45
+ Misses 1014 1010 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
per our brief zoom chat -- let's add |
@yarikoptic should be in, issue being that validation can fail due to 2 separate reasons:
The issue is that since we raise errors, it will stop on the first. I imagine someone might fix the first, and then get confused by running into the second. Demo output for the archive from the linked issue: chymera@decohost ~ $ dandi validate-bids test -r
2022-05-02 05:41:54,190 [ INFO] Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2022-05-02 05:41:54,191 [ INFO] NumExpr defaulting to 8 threads.
2022-05-02 05:41:55,452 [ WARNING] BIDSVersion 1.5.0 is less than the minimal working 1.7.0+012+dandi001. Falling back to 1.7.0+012+dandi001. To force the usage of earlier versions specify them explicitly when calling the validator.
2022-05-02 05:41:56,231 [ INFO] BIDS validation log written to /home/chymera/.cache/dandi-cli/log/bids-validator-report_20220502094156Z-17211.log
2022-05-02 05:41:56,231 [ ERROR] The `.*?/README$` regex pattern file required by BIDS was not found.
2022-05-02 05:41:56,231 [ ERROR] The `.*?/CHANGES$` regex pattern file required by BIDS was not found.
2022-05-02 05:41:56,231 [ WARNING] The `/home/chymera/test/sub-MITU02/ses-MR2/sub-MITU01_ses-MR_SSSPDmap.nii.gz` file was not matched by any regex schema entry.
Summary: 2 BIDS required filename patterns could not be found.
2022-05-02 05:41:56,231 [ INFO] Logs saved in /home/chymera/.cache/dandi-cli/log/20220502094153Z-17211.log |
Actually, let me set up some extra logic to put everything together in one message. |
Ok, it integrates both kinds now and also speaks proper english: chymera@decohost ~ $ dandi validate-bids test -r
2022-05-02 06:12:22,296 [ INFO] Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2022-05-02 06:12:22,296 [ INFO] NumExpr defaulting to 8 threads.
2022-05-02 06:12:23,543 [ WARNING] BIDSVersion 1.5.0 is less than the minimal working 1.7.0+012+dandi001. Falling back to 1.7.0+012+dandi001. To force the usage of earlier versions specify them explicitly when calling the validator.
2022-05-02 06:12:24,321 [ INFO] BIDS validation log written to /home/chymera/.cache/dandi-cli/log/bids-validator-report_20220502101224Z-18698.log
2022-05-02 06:12:24,321 [ ERROR] The `.*?/README$` regex pattern file required by BIDS was not found.
2022-05-02 06:12:24,321 [ ERROR] The `.*?/CHANGES$` regex pattern file required by BIDS was not found.
2022-05-02 06:12:24,321 [ WARNING] The `/home/chymera/test/sub-MITU02/ses-MR2/sub-MITU01_ses-MR_SSSPDmap.nii.gz` file was not matched by any regex schema entry.
Summary: 2 BIDS required filename patterns could not be found and 1 filename did not match any pattern known to BIDS.
2022-05-02 06:12:24,322 [ INFO] Logs saved in /home/chymera/.cache/dandi-cli/log/20220502101221Z-18698.log |
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!
I left some comments without bundling into this review. Overall -- seems to achieve desired (for now) output, but code could benefit from a bit of more Python-ification - I left some hints.
edit: also filed independent #997 which could be done separately or along with this PR to ensure that CLI code at least has some testing.
Errors don't look like they're related to the PR :-/ |
59c8e60
to
54c252b
Compare
54c252b
to
6b06dad
Compare
de543e0
to
c442d3a
Compare
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.
a few more RFs I requested in individual comments. We are converging.
c442d3a
to
803de15
Compare
@yarikoptic done, I don't think list comprehension for |
right, it is not a "loopy thing", my bad. Let's proceed. Thanks! |
🚀 PR was released in |
Addressing #991