-
Notifications
You must be signed in to change notification settings - Fork 14
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
Implement Bids Spec files #324
Conversation
In fact, this PR does introduce a slight behaviour change. Previously, if bids(root=".", subject="001") == "sub-001/sub-001" Now, the bids(root=".", subject="001") == "./sub-001/sub-001" Practically speaking, this shouldn't make much of a difference, as the paths are still canonically the same (It got me in some of my tests, but they are more strict about paths being exactly correct). But I think this change is more correct than previous behaviour. |
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.
At a glance, this seems largely good to me. A few minor comments and questions.
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.
One minor comment and a question, but this looks good and I won't need to see it again.
0effe84
to
a9516a1
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.
Should be good - up to you about the minor comment but pending fixing the doc build error, this lgtm.
6a60932
to
ef3570e
Compare
Add spec files and getters
Bids() is refactored to use the new bids specs, paving the way for future customizable bids functions, plus speeds it up 2-3 fold. Also adds a brand new test suite.
ef3570e
to
bb8be7d
Compare
This is the first out of two PRs for the resolution of #245. Here, we add define the spec file and add a
0.0.0
file to represent the bids function as it's been until now. The api does not change at all here, but the bids function has been refactored to use the spec.I also added an extensive test suite for the bids function.
The spec
The spec takes the following form (in yaml)
The order of entries determines the order entities will be placed in by the bids function.
datatype
,suffix
,extension
, andprefix
are considered nonstandard entities and must not be specified in the config. Unrecognized entities are, by default, placed at the end of the path before the suffix. However, at most one entry in the spec may be specified as:This indicates a placeholder determining the insertion point of unrecognized entities.
Currently, no validation of the above specifications is enforced. The
bids()
function is hard-coded to use the0.0.0
spec, which I already know is valid. In the future, when we support custom spec files, we will need to implement validation.