Skip to content
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] Implement some fairly easy rules #1410

Merged
merged 14 commits into from Mar 2, 2023

Conversation

effigies
Copy link
Collaborator

@effigies effigies commented Feb 8, 2023

Builds on #1406. Working through #1402.

@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.64 🎉

Comparison is base (d41fefa) 88.00% compared to head (a7c86f1) 88.65%.

❗ Current head a7c86f1 differs from pull request most recent head 4e2cd72. Consider uploading reports for the commit 4e2cd72 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1410      +/-   ##
==========================================
+ Coverage   88.00%   88.65%   +0.64%     
==========================================
  Files          14       11       -3     
  Lines        1267     1084     -183     
==========================================
- Hits         1115      961     -154     
+ Misses        152      123      -29     
Impacted Files Coverage Δ
tools/schemacode/bidsschematools/schema.py 75.55% <0.00%> (-4.24%) ⬇️
tools/schemacode/bidsschematools/render/text.py 97.47% <0.00%> (ø)
tools/schemacode/bidsschematools/render/utils.py 85.18% <0.00%> (ø)
...ools/schemacode/bidsschematools/types/namespace.py 91.09% <0.00%> (ø)
tools/schemacode/bidsschematools/conftest.py
tools/schemacode/bidsschematools/expressions.py
tools/schemacode/bidsschematools/rules.py
tools/schemacode/bidsschematools/validator.py 96.24% <0.00%> (+12.05%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@bendhouseart bendhouseart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As much fun to read as it was to write I'm sure.

selectors:
- type(sidecar.VolumeTiming) != null
checks:
- type(sidecar.DelayTime) == null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer the in notation for clarity. If we wanted to avoid infix notation then I'd prefer the exists function being extended to support this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case of null being put in an actual json file should be covered by format type checking on sidecar entries.

The image/file will be considered invalid or assumed to be in LAS orientation.
level: warning
selectors:
- nifti_header != null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nifti_header != null
vs
type(nifti_header) != "null"

should be functionally equivalent, should one style be preferred over the other?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess type() should be preferred since it makes it easier for me to control null semantics in the validators expression language implementation.

@rwblair rwblair merged commit fa127f5 into bids-standard:master Mar 2, 2023
@effigies effigies deleted the schema/low_hanging_fruit branch March 2, 2023 19:07
@sappelhoff sappelhoff changed the title SCHEMA: Implement some fairly easy rules [SCHEMA] Implement some fairly easy rules Nov 13, 2023
@sappelhoff sappelhoff added the exclude-from-changelog This item will not feature in the automatically generated changelog label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-from-changelog This item will not feature in the automatically generated changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants