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

Enforce uniqueness of data files in a directory. #2071

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rwblair
Copy link
Member

@rwblair rwblair commented Aug 7, 2024

https://bids-specification.readthedocs.io/en/stable/common-principles.html#uniqueness-of-data-files
fixes #1107

Added in src/valdiators/filenameValidate.ts. This check sees if another file exists in the parent directory of the context that has the contexts exact entities and sufiix but a different valid (non-sidecar) extension from the rules.files.* rule that the context matched.

Unfortunately there is a problem with relying on the rules.files.*. It does not state which extensions are mutually exclusive. One ieeg format for instance states Each recording consists of a .vhdr, .vmrk, .eeg file triplet as valid:
https://bids-specification.readthedocs.io/en/stable/modality-specific-files/intracranial-electroencephalography.html#ieeg-recording-data
https://github.com/bids-standard/bids-specification/blob/master/src/schema/rules/files/raw/ieeg.yaml

Maintaing list of sidecar extensions in filenameValidate.ts is no good and should probably be pulled from the schema if possible.

@rwblair rwblair added the schema label Aug 7, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.25%. Comparing base (a4e1a09) to head (a16a234).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2071      +/-   ##
==========================================
+ Coverage   85.69%   87.25%   +1.55%     
==========================================
  Files          91      139      +48     
  Lines        3782     6763    +2981     
  Branches     1220     1600     +380     
==========================================
+ Hits         3241     5901    +2660     
- Misses        455      772     +317     
- Partials       86       90       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@effigies effigies left a comment

Choose a reason for hiding this comment

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

We should check that .eeg+.vhdr+.vmrk don't trigger this.

Also, there is bids-standard/bids-specification#1492. Might be worth getting that working again and using that? I believe the schema was in good shape and the rendering code just gathered merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator MUST NOT accept identical files under different extensions
2 participants