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

ENH: Add column definitions for channels.json #1839

Merged

Conversation

effigies
Copy link
Collaborator

@effigies effigies commented Nov 3, 2023

Closes #1838.

@effigies
Copy link
Collaborator Author

effigies commented Nov 3, 2023

Do we have examples to test against yet?

@effigies effigies requested a review from sappelhoff November 3, 2023 12:27
@effigies
Copy link
Collaborator Author

effigies commented Nov 3, 2023

Yup, found it. Now I just need to figure out JSON schema. This is a pain.

@effigies
Copy link
Collaborator Author

effigies commented Nov 3, 2023

Some notes for anybody who wants to take this over (or me in the future):

  • Test with npm run test bids-validator/tests/bids.spec.js
  • The problem with it as it stands is that you can't override the references like I wanted to. {"$ref": "X", "override": "value"} needs to become {"allOf": [{"$ref": "X"}, {"override": "value"}]} or something. Except that doesn't seem to successfully override.
  • I think what needs to be done is to write the whole thing out without references and see what can be shortened by using references and what we're stuck with duplicating.

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (efd5e76) 85.69% compared to head (682fcbb) 83.57%.

❗ Current head 682fcbb differs from pull request most recent head 5b338ca. Consider uploading reports for the commit 5b338ca to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1839      +/-   ##
==========================================
- Coverage   85.69%   83.57%   -2.12%     
==========================================
  Files         132       92      -40     
  Lines        6711     3897    -2814     
  Branches     1554     1273     -281     
==========================================
- Hits         5751     3257    -2494     
+ Misses        852      542     -310     
+ Partials      108       98      -10     
Files Coverage Δ
bids-validator/validators/json/json.js 100.00% <100.00%> (ø)

... and 40 files with indirect coverage changes

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

…erties, not the top level properties themselves
Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

thanks for the start, Chris, and thanks for the fix, Ross.

@effigies
Copy link
Collaborator Author

effigies commented Nov 3, 2023

Changing bids-validator/tests/data/bids-examples/motion_dualtask/sub-07/ses-stand/motion/sub-07_ses-stand_task-dualWalking_tracksys-PhaseSpace1_channels.json to have invalid fields does not fail the validator:

{
        "reference_frame":{
                "LongName":"reference_frame",
                "Description":"reference frame in which the channels is represented.",
                "Levels":{
                        "global":{
                                "Description":"room-fixed global reference frame",
                                "SpatialAxes":"ARS",
                                "RotationOrder":1,
                                "RotationRule":1
                        }
                }
        }
}

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

Checked Chris' example and also manipulating the values for the levels --> raises errors as expected now.

@sappelhoff sappelhoff merged commit fb83533 into bids-standard:master Nov 7, 2023
21 of 24 checks passed
@sappelhoff sappelhoff deleted the enh/reference_frame_schema branch November 7, 2023 14:19
@effigies
Copy link
Collaborator Author

effigies commented Nov 7, 2023

Interesting. I'm not sure why my using npm test was failing to find this error. Explicitly running the validator on the broken example did work.

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

Successfully merging this pull request may close these issues.

motion: adding SpatialAxes etc to JSON schema
3 participants