-
Notifications
You must be signed in to change notification settings - Fork 163
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
[FIX][SCHEMA] Add conditionals for PET ReconMethod* and ReconFilter #1299
[FIX][SCHEMA] Add conditionals for PET ReconMethod* and ReconFilter #1299
Conversation
* add conditionals for ReconMethod Metadata * add min and max values to scatter fraction * add conditional for ReconFilterSize
Codecov ReportBase: 88.39% // Head: 88.33% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1299 +/- ##
==========================================
- Coverage 88.39% 88.33% -0.07%
==========================================
Files 11 11
Lines 1086 1080 -6
==========================================
- Hits 960 954 -6
Misses 126 126
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. |
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 think the rules need to be reconfigured a bit.
@bendhouseart While working through some examples, we've found that it's going to be very difficult to both render and enforce rules that have
PETReconstruction:
selectors:
- modality == "pet"
- suffix == "pet"
fields:
ReconMethodParameterLabels:
level: required
ReconMethodParameterUnits:
level: optional
level_addendum: |
required if `ReconMethodParameterLabels` does not contain 'none'
PETReconstructionReq:
selectors:
- modality == "pet"
- suffix == "pet"
- '!intersects(sidecar.ReconMethodParameterLabels, ["none"])'
fields:
ReconMethodParameterUnits: required
PETReconstruction:
selectors:
- modality == "pet"
- suffix == "pet"
fields:
ReconMethodParameterLabels:
level: required
PETReconstructionReq:
selectors:
- modality == "pet"
- suffix == "pet"
- '!intersects(sidecar.ReconMethodParameterLabels, ["none"])'
fields:
ReconMethodParameterUnits:
level: required
level_addendum: |
optional if `ReconMethodParameterLabels` does not contain 'none'
PETReconstructionOpt:
selectors:
- modality == "pet"
- suffix == "pet"
- intersects(sidecar.ReconMethodParameterLabels, ["none"])
ReconMethodParameterUnits: optional {{ MACROS___make_sidecar_table(["pet.PETReconstruction". "pet.PETReconstructionReq"]) }} |
@effigies isn't |
Yes, these are equivalent approaches in terms of enforcement. The choice between the two is which way PET maintainers would prefer it to be rendered. Note that if you make a field RECOMMENDED, there will be warnings when it is missing. (The current validator does not follow this rule, but the schematized one will.) |
@effigies, so we just discussed this again in the OpenNeuroDev meeting and we agreed upon going for |
…dhouseart/bids-specification into update-pet-recon-method-recon-filter Update with suggestions to use recommended instead of optional as we want to raise warnings if ReconMethod* fields are missing when ReconMethodParameterLabels does not contain "None". This change allows users to proceed when they are unable to source the specifics relating to a reconstruction method apart from the name.
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.
Looks right. Some styling fixes for the table.
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@melanieganz @CPernet @mnoergaard Any of you up for giving this another review and a green check if you're happy with it? |
tagging again: @melanieganz @CPernet @mnoergaard |
yep that's what we discussed, if not then recommended (to avoid validation error) - thx @effigies |
Thanks all! |
Adds conditionals to change required PET fields to optional when "parent" fields are unknown or "none", specifically:
add conditionals for ReconMethod Metadata
add min and max values to scatter fraction
add conditional for ReconFilterSize
Intention is to avoid users adding unnecessary place holders to pass validation, e.g. [0, 0], ["none", "none"], hopefully avoids ambiguity instead of increasing it.
Arguments could be made that fields should always be required, but several recent use cases have prompted this minor change to the spec. Additionally, it's more straight forward (to this user) to toggle optional than to define
null
placeholders for values and datatypes.