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

"Add suffixes" to schema? #1050

Open
yarikoptic opened this issue Mar 31, 2022 · 2 comments
Open

"Add suffixes" to schema? #1050

yarikoptic opened this issue Mar 31, 2022 · 2 comments
Labels
schema Issues related to the YAML schema representation of the specification. Patch version release.

Comments

@yarikoptic
Copy link
Collaborator

yarikoptic commented Mar 31, 2022

#1049 (and recently merged #1036) inspired me to look at re-used suffixes which ATM might have duplicate and varying specification (in terms of extensions) across different data types:

$> git grep -e '^- suffixes' -A1 -h | grep -v -e 'suffixes' -e -- | sort | uniq -c | sort -n | grep -v '^ *1 '
      2   - electrodes
      3   - channels
      3   - coordsystem
      4   - photo
      5   - meg
      6   - events
      7   - physio

NB due to -A1 could be an incomplete list

so I thought that may be such definitions could somehow also be centralized?

and alternative to centralization could be just a unittest which verifies that identical suffixes, which are present in different data types, have identical extensions across datatypes etc?

or may be it is just impossible anyways since some suffixes (like `meg`) might have quite complicated rules (but seems specific to a modality, hence I added "in different data types" above
rules/datatypes/meg.yaml-# First group
rules/datatypes/meg.yaml-- suffixes:
rules/datatypes/meg.yaml:  - meg
rules/datatypes/meg.yaml-  extensions:
rules/datatypes/meg.yaml-  - /  # corresponds to BTi/4D data
rules/datatypes/meg.yaml-  - .ds/
rules/datatypes/meg.yaml-  - .json
rules/datatypes/meg.yaml-  - .fif
--
rules/datatypes/meg.yaml-# Specifically, it's dat files with "acq-calibration"
rules/datatypes/meg.yaml-- suffixes:
rules/datatypes/meg.yaml:  - meg
rules/datatypes/meg.yaml-  extensions:
rules/datatypes/meg.yaml-  - .dat
rules/datatypes/meg.yaml-  entities:
rules/datatypes/meg.yaml-    subject: required
rules/datatypes/meg.yaml-    session: optional
--
rules/datatypes/meg.yaml-# fif files with "acq-crosstalk"
rules/datatypes/meg.yaml-- suffixes:
rules/datatypes/meg.yaml:  - meg
rules/datatypes/meg.yaml-  extensions:
rules/datatypes/meg.yaml-  - .fif
rules/datatypes/meg.yaml-  entities:
rules/datatypes/meg.yaml-    subject: required
rules/datatypes/meg.yaml-    session: optional

edit: upgraded grep as of v1.7.0-329-gd3429fba

$> git grep -e '^ *suffixes *:' -A1 -h | grep -v -e 'suffixes' -e -- | sort | uniq -c | sort -n | grep -v '^ *1 '
      2   - electrodes
      3   - channels
      3   - coordsystem
      3   - meg
      4   - mask
      4   - photo
      4   - probseg
      6   - dseg
      6   - events
      7   - physio
@yarikoptic yarikoptic added the schema Issues related to the YAML schema representation of the specification. Patch version release. label Mar 31, 2022
@tsalo
Copy link
Member

tsalo commented Mar 31, 2022

I believe that this came up at last week's schema meeting, and we were going to look at repurposing #1012 to centralize duplicate suffix patterns across datatypes.

@effigies
Copy link
Collaborator

effigies commented Feb 5, 2023

@yarikoptic Would you mind having another look? This has changed significantly:

$ git grep -e ' suffixes:' -A1 -h | grep -v -e 'suffixes' -e -- | sort | uniq -c | sort -n | grep -v '^ *1 '
      2     - sessions
      4     - mask
      4     - probseg
      6     - dseg
      6     - meg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema Issues related to the YAML schema representation of the specification. Patch version release.
Projects
None yet
Development

No branches or pull requests

3 participants