-
Notifications
You must be signed in to change notification settings - Fork 169
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
SCHEMA: Reorganize file objects and rules #1288
Conversation
649c391
to
46e0755
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.
I like the changes.
Just going to make this note to refer back to whenever the file_type
thing confuses me:
A Linux system, just like UNIX, makes no difference between a file and a directory, since a directory is just a file containing names of other files.
46e0755
to
4a65d1d
Compare
3764e85
to
74f47f8
Compare
Codecov ReportBase: 88.69% // Head: 88.44% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1288 +/- ##
==========================================
- Coverage 88.69% 88.44% -0.26%
==========================================
Files 11 11
Lines 1150 1073 -77
==========================================
- Hits 1020 949 -71
+ Misses 130 124 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
bf448b5
to
3f15c26
Compare
d42b30d
to
f679c09
Compare
e5f4d5c
to
098c3f2
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.
Just have one thought about the new make_filename_template
parameter.
a18d757
to
ea010f6
Compare
- nirs | ||
entities: | ||
subject: required | ||
session: optional | ||
acquisition: optional |
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.
@rob-luke @sappelhoff I didn't follow the discussion of photo.*
closely. Was there a reason that nirs photos were missing the optional acquisition flag? I can break this back out into a separate rule, but I wanted to check that this wasn't an oversight first.
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.
Actually, now I'm seeing that the rule was never rendered, and there's no mention in the text. Should I just remove it?
Some entries in rules.files.* have corresponding entries in objects (everything in common) and others don't (everything in raw and deriv). This is not a problem. What do we imagine happening if a directory becomes a valid entry in a datatype directory? And then we need to specify rules for can be in that directory? I suppose there's no reason that any given raw or deriv rule couldn't have a corresponding entry in objects if it really needs to. Not something that I'd like to write for every single thing. Also with an eye towards the idea of something like None of this is blocking. All the rules in this PR are interpretable and make a lot of things easier as a consumer of the schema. (My secret agenda is to get rules specifying that subject directories are legal at the root of the dataset. and whats legal inside of them and so on.) |
@@ -360,20 +306,16 @@ def load_all( | |||
------- | |||
all_regex : list of dict | |||
A list of dictionaries, with keys including 'regex' and 'mandatory'. | |||
my_schema : list of dict | |||
my_schema : Mapping | |||
Nested dictionaries representing the full schema. | |||
""" |
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.
@TheChymera Do you want to look over the changes to the validator code at all?
I guess you're talking about #1280? From the rule perspective, then the thing that would change is adding file_template:
directories:
- type: entity
key: subject
- type: entity
key: session
- type: datatype
parts:
- type: entity
key: subject
- type: entity
key: session
- type: entity
key: sample
- type: entity
key: task
...
- type: suffix
- type: extension Then we would just change it to: file_template:
directories:
- type: entity
key: subject
- type: entity
key: session
- type: datatype
- type: entity
key: model
... Not sure if this is the best way to go, but at the very least, this would extend the current
If we went with something like the above, we'd need to permit multiple construction rules, where we replace I can't see a plausible way to do something like what we're currently doing with references to replace subject with group.
I'll try to think more about this, especially looking at #1108. |
This is a significant refactoring of the schema. I'm not sure if it justifies a minor version bump, since it will break things, but we haven't released a minor release since the last breakage.
Builds off of #1287, which was separated out from these drastic changes.
Summary:
objects.files
objects.top_level_files
andobjects.associated_data
name
field, addsfile_type
, which is eitherregular
ordirectory
rules.files
common
,raw
andderiv
rules.files.common
level
field, replacingrequired: true
rules.files.common.core
combinesrules.top_level_files
andrules.associated_data
, minus participants and samplesrules.files.common.tables
combinesrules.tabular_metadata
and participants and samplesrules.files.raw
rules.datatypes.*
rules.files.raw.channels
- contains channels, coordsystem, electrodes (will contain optodes with nirs)rules.files.raw.photo
- contains photosrules.files.raw.task
- contains events and timeseriesrules.files.deriv
rules.files.deriv.preprocessed_data
- wasrules.datatypes.derivatives.common_derivatives
, but removed a lot of derivatives of things wherespace
wouldn't apply (such as events and photos). We can consider re-adding these withdesc-
, but I'm not sure how much these will ever occur. They're also not "data files" in the way that derivatives discusses, so it's not clear that they're specifically provided for, either.rules.files.deriv.imaging
- wasrules.datatypes.derivatives.common_imaging_derivatives
preprocessed_data
. I've run out of energy in this effort, though, and it's already pretty big.This will break tests. I'll get to them, but I wanted to get comments. @bids-standard/schema-users