-
Notifications
You must be signed in to change notification settings - Fork 87
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
[MRG] ENH: Ignore entities from derivatives
subfolder
#470
[MRG] ENH: Ignore entities from derivatives
subfolder
#470
Conversation
When calling `get_entity_vals()`, we now ignore the `derivatives` folder in the BIDS root directory. This is important as the derivatives may, for example, contain "mock" subjects like "sub-grand_average" or similar things, which we are typically not interested in when looking at the BIDS root. If the users wants to process the data in `derivatives/`, they can just set the `bids_root` kwarg to `bids_root/derivatives`, and everything will work as expected.
Forgot to add: |
Codecov Report
@@ Coverage Diff @@
## master #470 +/- ##
==========================================
- Coverage 93.59% 93.54% -0.05%
==========================================
Files 12 12
Lines 1749 1751 +2
==========================================
+ Hits 1637 1638 +1
- Misses 112 113 +1
Continue to review full report at Codecov.
|
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.
LGTM in principle, but we may have to adjust this in the future, once we start implementing derivatives also in MNE-BIDS.
Absolutely! |
@sappelhoff An alternative could be to have |
these options sound at least more flexible, perhaps |
Yes this is what I was thinking. However I'm worried this could be a little "too" flexible, like the |
not right now ... and when we do, we'll probably face challenges we cannot really anticipate right now 🤷♂️ I would be okay with not offering any flexibility ... but we should be aware that we may break the function in a couple of months (or a year) |
I guess that's alright for now… Will probably not be the only thing that breaks once we implement derivatives support! That said, feel free to merge if you're happy ;) |
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.
okay :-) thanks @hoechenberger
derivatives
subfolderderivatives
subfolder
Notes | ||
----- | ||
This function will scan the entire ``bids_root``, except for a | ||
``derivatives`` subfolder placed directly under ``bids_root``. |
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'm sorry I'm late to the party. Why do you make this "exception" rather than look at .bidsignore
?
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.
see: https://github.com/bids-standard/bids-validator#bidsignore. Unfortunately it's not mentioned in the specification :-( I think there was some disagreement whether there should be software specific ignore files or a general ignore file.
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.
you probably mean bids-standard/bids-specification#131 @jasmainak
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.
This sounds interesting! But as long as it's not part of the BIDS standard, … :/
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.
whenever we have a use case, it may be worth reviving that discussion :-)
but big discussions like that (in BIDS) usually need at least one person who REALLY wants stuff to happen ... because otherwise it just goes stale ...
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.
oh God yes, let's not go there again :-)
My personal opinion is that it's safe to exclude anything that's in .bidsignore
because it has not been validated, and MNE-BIDS assumes that the data is BIDS-valid. Maybe other applications assume that full BIDS-compliance is not necessary and they can have .whateverignore
. So we can locally take the decision without opening that big discussion again !
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 but my dream is that ideally, the derivatives/
we create will be just another root of a valid BIDS dataset
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.
that's probably already happening ... but I didn't follow very closely :)
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, there is a big validator project to track the slow move to having BIDS-validated derivatives: https://github.com/bids-standard/bids-validator/projects/1
but note: it will always be possible to have "random" derivatives (unvalidated) as part of a BIDS raw directory ... only as soon as you put at dataset_description.json
into the derivatives directory, it will get validated. (once we are there in the future)
PR Description
When calling
get_entity_vals()
, we now ignore thederivatives
folder in the BIDS root directory. This is important as thederivatives may, for example, contain "mock" subjects like "sub-grand_average" or similar things, which we are typically
not interested in when looking at the BIDS root. If the users wants to process the data in
derivatives/
, they can just set thebids_root
kwarg tobids_root/derivatives
, and everything will work as expected.The way I've coded the solution is not elegant at all, but it's simple and does do the trick…
Merge checklist
Maintainer, please confirm the following before merging: