-
Notifications
You must be signed in to change notification settings - Fork 2
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
[MAINT] transfer tests from pybids #8
Conversation
Remi-Gau
commented
Aug 14, 2024
•
edited
Loading
edited
- transfer tests cases that were run in pybids
- split between valid and invalid tests
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8 +/- ##
==========================================
+ Coverage 85.90% 93.19% +7.28%
==========================================
Files 3 3
Lines 149 191 +42
Branches 43 55 +12
==========================================
+ Hits 128 178 +50
+ Misses 9 5 -4
+ Partials 12 8 -4 ☔ View full report in Codecov by Sentry. |
I'm surprised this is passing. |
('/sub-01/anat/sub-01_T1w.nii.gz', False), | ||
('/RADME', False), # typo | ||
('/CANGES', False), # typo | ||
], | ||
) | ||
def test_top_level(validator, fname, matches): |
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.
In retrospect, I don't like parametrizing on matches
. I would rather just split it into two functions, e.g.,
@pytest.mark.parametrize('fname', valid_list)
def test_is_top_level(validator, fname):
assert validator.is_top_level(fname)
@pytest.mark.parametrize('fname', invalid_list)
def test_is_not_top_level(validator, fname):
assert not validator.is_top_level(fname)
If you've got the energy, would you do this? If not, I'll just create an issue, and might sooner or later get around to 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.
do you want to apply this to all tests?
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.
Yes.
@Remi-Gau I assume you're looking through the failing entries, but I can if you'd rather. |
yeah I will have a look |
I suspect that what's happening is that more targeted regexes were expected, and valid BIDS files were being passed to see whether they triggered only the right ones. Checking |
OK from my understanding it seems that all the failures are due to the fact that the validaton in pybids used to include methods methods such as I would suggest just removing the test case that fail unless we have any intention of adding those methods back at some point (and even then adding those tests would be easy, so I am very much in favor of removing those test cases). |
hahaha look at us independently coming to the same conclusion #reproducibility |
Yeah, no we definitely aren't going to make more and more precise groupings of regexes, so let's get rid of these. I see the regexes as a stopgap until we implement parsing that can tell people what they got wrong, not just "is it BIDS?". Possibly we'll keep them around for fast filtering of non-BIDS files from a layout, as in pybids. |
why the failure on 3.8 with minimum dependencies ? |
Bad regex generation in earlier bidsschematools. Bump to 0.11 in pyproject.toml and tox.ini. |
It's pleasing that the |
nothing else to do on my side for this one |
Thanks! |