cpp-lln-lab / CPP_PTB

a set of function to make it easier to create behavioral, EEG, fMRI experiment with psychtoolbox
https://cpp-ptb.readthedocs.io/en/latest/index.html#
MIT License
14 stars 13 forks source link

[BUG]: event.json has extra variable that does not pass bids-validator #187

Closed CerenB closed 2 years ago

CerenB commented 2 years ago

Is there an existing issue for this?

Expected Behavior

That events.json files have been passing the bids-validator without any issues. Now (maybe in the last month's update?) it does not pass anymore.

Current Behavior

cpp-bids repo produces events.json file with the below variable:

  "StimulusPresentation": {
    "OperatingSystem": "MACI64",
    "SoftwareRRID": "SCR_002881",
    "Code": "",
    "SoftwareVersion": "3.0.16",
    "SoftwareName": "Psychtoolbox on Matlab - 9.3.0.713579 (R2017b)"
  },

That is new edition to .json file, and bids validator error message is:

sub-pil006_ses-001_task-somatotopy_run-004_events.json
Location:
raw/sub-pil006/ses-001/func/sub-pil006_ses-001_task-somatotopy_run-004_events.json

Reason:
Invalid JSON file. The file is not formatted according the schema.

Evidence:
.StimulusPresentation.Code should match format "uri"

Error message

No response

Environment

- OS:macOS Catalina 10.15
- Matlab: 2017b
- SPM: n/a

Branch

- branch: dev branch, 052381b32ce037d1adb90eb512717d486a26628a and also in this commit, I replicated the issue: 627ceef5d8a9c3dc08b918fe0381b5acc64b56e0
- version:

Anything else?

I might be lost in the branches etc, please take my bug report with caution.

CerenB commented 2 years ago

Aha! The issue/bug does not occur in this commit: 3c20a7d1286887c6f55996009b43d9d141f42423

Remi-Gau commented 2 years ago

Can you check that if you remove the Code field in your json the validator stops complaining for that file.

Remi-Gau commented 2 years ago

I think this actually a CPP_PTB issue, CPP_BIDS does not set default value for the stimulusPresentation object

Remi-Gau commented 2 years ago

Comes from here: https://github.com/cpp-lln-lab/CPP_PTB/blob/2a5bb3375d162f9635f8f04b59ca3235514ddfa5/src/initPTB.m#L116

Remi-Gau commented 2 years ago

Changed in this PR: https://github.com/cpp-lln-lab/CPP_PTB/pull/171

Remi-Gau commented 2 years ago

Will transfer the issue and add a default value that does not code a validation crash: https://github.com/TODO/