From 24a6d62e398b7dec26c280cb4ce29c389cd61e9a Mon Sep 17 00:00:00 2001 From: Monique Denissen Date: Thu, 26 Sep 2024 22:14:41 +0200 Subject: [PATCH 01/86] exclude emtpyroom sub when checking event files (#1930) --- src/schema/rules/checks/events.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schema/rules/checks/events.yaml b/src/schema/rules/checks/events.yaml index 4c4e143afd..01d1a9537d 100644 --- a/src/schema/rules/checks/events.yaml +++ b/src/schema/rules/checks/events.yaml @@ -15,6 +15,7 @@ EventsMissing: - '!match(entities.task, "rest")' - '!intersects([suffix], ["events", "beh"])' - extension != ".json" + - (datatype != "meg" || entities.subject != "emptyroom") checks: - '"events" in associations' From 3ab1a4720e3040ccadd569895e5d73af6785d99e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 28 Sep 2024 14:10:01 +0200 Subject: [PATCH 02/86] [MAINT] Update Release_Protocol.md minor updates relating to how to update the BIDS website after a release --- Release_Protocol.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Release_Protocol.md b/Release_Protocol.md index 9e2f6292c6..c520fec053 100644 --- a/Release_Protocol.md +++ b/Release_Protocol.md @@ -267,10 +267,14 @@ Similarly update the version in CITATION.cff with a `dev` suffix. Update the following files in the BIDS website repository (https://github.com/bids-standard/bids-website) if applicable: -- `tools/timeline.csv` -- `_data/beps.yml` -- `_data/beps_completed.yml` -- `_data/beps_other.yml` +- `data/timeline.csv` +- `data/beps/beps.yml` +- `data/beps/beps_completed.yml` +- `data/beps/beps_other.yml` + +If the release relates to the merge of a BEP, add the BEP leads to the BIDS advisory group: + +- `data/people/advisory.yml` ### 12. Sharing news of the release From efe7f7c7cf3dbfe877297f19960f7166eb8c4384 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:30:43 +0000 Subject: [PATCH 03/86] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.29.2 → 0.29.3](https://github.com/python-jsonschema/check-jsonschema/compare/0.29.2...0.29.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 277632e355..4c8ba0a219 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: check-added-large-files - id: check-case-conflict - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.2 + rev: 0.29.3 hooks: - id: check-dependabot - id: check-github-workflows From 8692e1fd12c82201eb63ae8a7098f3a77a4ee1bc Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Thu, 3 Oct 2024 04:15:10 +1000 Subject: [PATCH 04/86] [ENH] Update DWI suffixes to include most common scanner derivatives (#1864) --- .../magnetic-resonance-imaging-data.md | 28 ++++++++--- src/schema/objects/suffixes.yaml | 46 +++++++++++++++++-- src/schema/rules/files/deriv/imaging.yaml | 9 ++++ src/schema/rules/files/raw/dwi.yaml | 24 ++++++++++ 4 files changed, 97 insertions(+), 10 deletions(-) diff --git a/src/modality-specific-files/magnetic-resonance-imaging-data.md b/src/modality-specific-files/magnetic-resonance-imaging-data.md index 73a0b1c13f..2b2078fe04 100644 --- a/src/modality-specific-files/magnetic-resonance-imaging-data.md +++ b/src/modality-specific-files/magnetic-resonance-imaging-data.md @@ -685,13 +685,18 @@ The definitions of these fields can be found in and a guide for using macros can be found at https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md --> -{{ MACROS___make_suffix_table( - [ - "dwi", - "sbref", - ] - ) -}} +{{ MACROS___make_suffix_table(["dwi", "sbref"]) }} + +Additionally, the following suffixes are used for scanner-generated images: + + +{{ MACROS___make_suffix_table(["ADC", "expADC", "trace", "FA", "colFA", "S0map"]) }} {{ MACROS___make_json_table("json.ieeg.iEEGCoordsystemPositions") }} +`*_coordsystem.json` files SHOULD NOT be duplicated for each data file, +for example, across multiple tasks. +The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST +be used to find the appropriate coordinate system description for a given data file. +If electrodes are repositioned, it is RECOMMENDED to use multiple sessions to indicate this. + ### Recommended 3D coordinate systems It is preferred that electrodes are localized in a 3D coordinate system (with diff --git a/src/modality-specific-files/magnetoencephalography.md b/src/modality-specific-files/magnetoencephalography.md index babc92be7c..ced4d6f3e7 100644 --- a/src/modality-specific-files/magnetoencephalography.md +++ b/src/modality-specific-files/magnetoencephalography.md @@ -429,6 +429,11 @@ For more information on typical coordinate systems for MEG-MRI coregistration: or: [Coordinate Systems - Brainstorm toolbox](https://neuroimage.usc.edu/brainstorm/CoordinateSystems) +`*_coordsystem.json` files SHOULD NOT be duplicated for each data file, +for example, across multiple tasks. +The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST +be used to find the appropriate coordinate system description for a given data file. + ## Landmark photos (`*_photo.`) Photos of the anatomical landmarks and/or head localization coils diff --git a/src/modality-specific-files/near-infrared-spectroscopy.md b/src/modality-specific-files/near-infrared-spectroscopy.md index b423b4c2dd..accce58183 100644 --- a/src/modality-specific-files/near-infrared-spectroscopy.md +++ b/src/modality-specific-files/near-infrared-spectroscopy.md @@ -427,6 +427,12 @@ A guide for using macros can be found at {{ MACROS___make_json_table(["json.nirs.AnatomicalLandmark", "json.nirs.AnatomicalLandmarkCoordinateSystemDescriptionRec"]) }} +`*_coordsystem.json` files SHOULD NOT be duplicated for each data file, +for example, across multiple tasks. +The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST +be used to find the appropriate coordinate system description for a given data file. +If optodes are repositioned, it is RECOMMENDED to use multiple sessions to indicate this. + ### Example `*_coordsystem.json` ```json diff --git a/src/schema/rules/checks/electrodes.yaml b/src/schema/rules/checks/channels.yaml similarity index 55% rename from src/schema/rules/checks/electrodes.yaml rename to src/schema/rules/checks/channels.yaml index 29f81d3d44..20313860f3 100644 --- a/src/schema/rules/checks/electrodes.yaml +++ b/src/schema/rules/checks/channels.yaml @@ -13,3 +13,17 @@ ElectrodeSpecificity: checks: - '!("run" in entities)' - '!("acquisition" in entities)' + +CoordsystemSpecificity: + issue: + code: EXCESSIVE_COORDSYSTEM_SPECIFICITY + message: | + Task entities detected in coordsystem.tsv. + Coordinate systems should generally not vary by task. + Consider removing the excess entity. + level: warning + selectors: + - suffix == 'coordsystem' + - extension == '.json' + checks: + - '!("task" in entities)' diff --git a/src/schema/rules/files/raw/channels.yaml b/src/schema/rules/files/raw/channels.yaml index 25aa1deff3..14dc1bfb6a 100644 --- a/src/schema/rules/files/raw/channels.yaml +++ b/src/schema/rules/files/raw/channels.yaml @@ -45,6 +45,7 @@ coordsystem: entities: subject: required session: optional + task: optional acquisition: optional # (i)EEG has a space entity From eaaeca2550a758da155df1c3c7137d4e2845610c Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 10 Oct 2024 14:38:25 -0400 Subject: [PATCH 11/86] Permit and warn on task/acquisition/run for electrodes and coordsystems --- src/schema/rules/checks/channels.yaml | 17 +++++++++++------ src/schema/rules/files/raw/channels.yaml | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/schema/rules/checks/channels.yaml b/src/schema/rules/checks/channels.yaml index 20313860f3..9fc11edce0 100644 --- a/src/schema/rules/checks/channels.yaml +++ b/src/schema/rules/checks/channels.yaml @@ -3,27 +3,32 @@ ElectrodeSpecificity: issue: code: EXCESSIVE_ELECTRODE_SPECIFICITY message: | - Run or acquisition entities detected in electrodes.tsv. + Task, acquisition or run entities detected in electrodes.tsv. Electrode definitions should generally not vary within a session. - Consider creating a new session each time electrodes are reconfigured. + Consider removing the excess entity/entities or create a new + session each time electrodes are reconfigured. level: warning selectors: - suffix == 'electrodes' - extension == '.tsv' checks: - - '!("run" in entities)' + - '!("task" in entities)' - '!("acquisition" in entities)' + - '!("run" in entities)' CoordsystemSpecificity: issue: code: EXCESSIVE_COORDSYSTEM_SPECIFICITY message: | - Task entities detected in coordsystem.tsv. - Coordinate systems should generally not vary by task. - Consider removing the excess entity. + Task, acquisition or run entities detected in coordsystem.tsv. + Coordinate systems should generally not vary within a session. + Consider removing the excess entity/entities or create new + sessions when multiple coordinate systems are appropriate. level: warning selectors: - suffix == 'coordsystem' - extension == '.json' checks: - '!("task" in entities)' + - '!("acquisition" in entities)' + - '!("run" in entities)' diff --git a/src/schema/rules/files/raw/channels.yaml b/src/schema/rules/files/raw/channels.yaml index 14dc1bfb6a..6a4358c689 100644 --- a/src/schema/rules/files/raw/channels.yaml +++ b/src/schema/rules/files/raw/channels.yaml @@ -70,6 +70,7 @@ electrodes: entities: subject: required session: optional + task: optional acquisition: optional run: optional space: optional From c1200b5aeb70bcad08e6586688650973f66b99dd Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 10 Oct 2024 16:03:33 -0400 Subject: [PATCH 12/86] fix(schema): Disable TaskName check for channels and markers files closes bids-standard/bids-validator#2154 --- src/schema/rules/sidecars/entity_rules.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/rules/sidecars/entity_rules.yaml b/src/schema/rules/sidecars/entity_rules.yaml index 54b3c256a0..cd54e72752 100644 --- a/src/schema/rules/sidecars/entity_rules.yaml +++ b/src/schema/rules/sidecars/entity_rules.yaml @@ -10,7 +10,7 @@ EntitiesTaskMetadata: selectors: - '"task" in entities' - - suffix != 'events' + - '!intersects([suffix], ["events", "channels", "markers"])' fields: TaskName: recommended From f2771e1b34ba1f3171d3d6595e1e8e3ca24fa337 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 11 Oct 2024 14:59:11 +0200 Subject: [PATCH 13/86] [MAINT] switch bidsschematools to pyproject.toml (#1948) * switch to pyproject.toml * msic * add manifest * fix * try packaging data * fix * rm manifest * fix: packages.find.include * Apply suggestions from code review Co-authored-by: Chris Markiewicz * reorder --------- Co-authored-by: Chris Markiewicz --- .pre-commit-config.yaml | 8 ++- tools/schemacode/.flake8 | 7 +++ tools/schemacode/pyproject.toml | 99 +++++++++++++++++++++++++++++---- tools/schemacode/setup.cfg | 79 -------------------------- 4 files changed, 102 insertions(+), 91 deletions(-) create mode 100644 tools/schemacode/.flake8 delete mode 100644 tools/schemacode/setup.cfg diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90c277e197..98bd4e1ff6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-json + - id: check-toml - id: check-ast - id: check-added-large-files - id: check-case-conflict @@ -48,7 +49,7 @@ repos: rev: 7.1.1 hooks: - id: flake8 - args: [--config=tools/schemacode/setup.cfg] + args: [--config=tools/schemacode/.flake8] - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 hooks: @@ -61,6 +62,11 @@ repos: - id: yamllint args: [-f=standard, -c=.yamllint.yml] files: src/schema/.*/.*\.yaml + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.14.0 + hooks: + - id: pretty-format-toml + args: [--autofix, --indent, '4', --no-sort] - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: diff --git a/tools/schemacode/.flake8 b/tools/schemacode/.flake8 new file mode 100644 index 0000000000..57d01f9d11 --- /dev/null +++ b/tools/schemacode/.flake8 @@ -0,0 +1,7 @@ +[flake8] +max-line-length = 99 +exclude = *build/ +ignore = E203,E402,E722,W503 +per-file-ignores = + */__init__.py : F401 +docstring-convention = numpy diff --git a/tools/schemacode/pyproject.toml b/tools/schemacode/pyproject.toml index c0a581cd85..9068e6d471 100644 --- a/tools/schemacode/pyproject.toml +++ b/tools/schemacode/pyproject.toml @@ -1,10 +1,82 @@ [build-system] -requires = ["setuptools"] build-backend = "setuptools.build_meta" +requires = ["setuptools"] + +[project] +name = "bidsschematools" +description = " Python tools for working with the BIDS schema." +authors = [{name = "bids-standard developers"}] +maintainers = [{name = "bids-standard developers", email = " bids.maintenance@gmail.com"}] +license = {text = "MIT"} +readme = "README.md" +requires-python = ">=3.9" +dependencies = [ + "click", + "pyyaml", + "jsonschema" +] +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: MIT License", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Information Analysis", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13" +] +dynamic = ["version"] + +[project.optional-dependencies] +expressions = ["pyparsing"] +render = [ + "tabulate", + "pandas", + "markdown-it-py" +] +tests = [ + "bidsschematools[expressions,render]", + "codecov", + "coverage[toml]", + "flake8", + "flake8-black", + "flake8-isort", + "pytest>6", + "pytest-cov" +] +doc = [ + "sphinx>=1.5.3", + "sphinx_rtd_theme" +] +all = [ + "bidsschematools[doc,tests]" +] + +[project.scripts] +bst = "bidsschematools.__main__:cli" + +[project.urls] +Homepage = "https://github.com/bids-standard/bids-specification" + +[tool.setuptools.dynamic] +version = {file = "bidsschematools/data/schema/SCHEMA_VERSION"} + +[tool.setuptools.package-data] +bidsschematools = [ + "data/metaschema.json", + "data/schema/BIDS_VERSION", + "data/schema/SCHEMA_VERSIO", + "data/schema/**/*.yaml", + "tests/data/**/*", + "tests/data/**/.bidsignore" +] + +[tool.setuptools.packages.find] +include = ["bidsschematools*"] [tool.black] line-length = 99 -target-version = ['py39'] include = '\.pyi?$' exclude = ''' ( @@ -21,18 +93,23 @@ exclude = ''' ) ''' +[tool.coverage.run] +omit = [ + "*/*/tests/*", + "**/tests/*" +] +parallel = true + [tool.isort] -profile = "black" multi_line_output = 3 +profile = "black" [tool.pytest.ini_options] +addopts = "-ra --strict-markers --strict-config" +log_cli = true +log_cli_level = "INFO" markers = [ - "validate_schema: tests that validate the schema itself", -] - -[tool.coverage.run] -parallel = true -omit = [ - "*/*/tests/*", - "**/tests/*" + "validate_schema: tests that validate the schema itself" ] +minversion = "6.0" +xfail_strict = true diff --git a/tools/schemacode/setup.cfg b/tools/schemacode/setup.cfg deleted file mode 100644 index 01f4f2c726..0000000000 --- a/tools/schemacode/setup.cfg +++ /dev/null @@ -1,79 +0,0 @@ -[metadata] -name = bidsschematools -version = file:bidsschematools/data/schema/SCHEMA_VERSION -url = https://github.com/bids-standard/bids-specification -author = bids-standard developers -author_email = bids.maintenance@gmail.com -description = Python tools for working with the BIDS schema. -long_description = file:README.md -long_description_content_type = text/markdown; charset=UTF-8; variant=GFM -license = MIT -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Science/Research - Topic :: Scientific/Engineering :: Information Analysis - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: 3.13 - -[options] -python_requires = >=3.9 -install_requires = - click - pyyaml - importlib_resources; python_version < "3.9" - jsonschema -packages = find: -include_package_data = false -zip_safe = false - -[options.extras_require] -doc = - sphinx>=1.5.3 - sphinx_rtd_theme -render = - tabulate - pandas - markdown-it-py -expressions = - pyparsing -tests = - codecov - coverage[toml] - flake8 - flake8-black - flake8-isort - pytest - pytest-cov -all = - %(doc)s - %(render)s - %(tests)s - %(expressions)s - -[options.package_data] -bidsschematools = - data/metaschema.json - data/schema/BIDS_VERSION - data/schema/SCHEMA_VERSION - data/schema/**/*.yaml - tests/data/**/* - tests/data/**/.bidsignore - -[options.entry_points] -console_scripts = - bst=bidsschematools.__main__:cli - -[flake8] -max-line-length = 99 -exclude = *build/ -ignore = E203,E402,E722,W503 -per-file-ignores = - */__init__.py : F401 -docstring-convention = numpy - -[tool:pytest] -log_cli = true From d9c23eb0e70e5932844bb79cca7d9f3bbc0aa528 Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Fri, 11 Oct 2024 15:05:48 +0200 Subject: [PATCH 14/86] schema: add check for duplicate READMEs (#1952) * schema: add check for duplicate READMEs * Update src/schema/rules/checks/general.yaml * Update src/schema/rules/checks/general.yaml --------- Co-authored-by: Chris Markiewicz --- src/schema/rules/checks/general.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/schema/rules/checks/general.yaml b/src/schema/rules/checks/general.yaml index 3c03bac91d..f23e81b824 100644 --- a/src/schema/rules/checks/general.yaml +++ b/src/schema/rules/checks/general.yaml @@ -23,3 +23,15 @@ ReadmeFileSmall: - match(path, '^/README') checks: - size > 150 + +DuplicateReadmes: + issue: + code: MULTIPLE_README_FILES + message: | + There are multiple '/README' files (with different extensions) in this BIDS + dataset. Only one '/README' file should exist. + level: error + selectors: + - match(path, '^/README.*') + checks: + - exists(["README", "README.md", "README.rst", "README.txt"], "dataset") == 1 From ce598147bedf02f2a46a9df24def1d40a927765d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 14 Oct 2024 09:44:27 -0400 Subject: [PATCH 15/86] Add an empty line in hope to get table rendered properly in "Ordering rules" section (#1953) --- src/schema/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schema/README.md b/src/schema/README.md index 6d2225bf69..5e32f71eec 100644 --- a/src/schema/README.md +++ b/src/schema/README.md @@ -999,6 +999,7 @@ EventsMissing: ### One-off rules - `rules.modalities` - The keys in this file are the modalities, the values objects with the following field: + | Field | Description | | ----------- | ------------------------------------- | | `datatypes` | List of datatypes mapping to modality | From 5573f29b1b680cb823a50f715577b431e50d7802 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:37:20 +0000 Subject: [PATCH 16/86] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.29.3 → 0.29.4](https://github.com/python-jsonschema/check-jsonschema/compare/0.29.3...0.29.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 98bd4e1ff6..935f9ac183 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: check-added-large-files - id: check-case-conflict - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.3 + rev: 0.29.4 hooks: - id: check-dependabot - id: check-github-workflows From 2fc9888d4bbf9b7766a544e1decb7189a3f2621e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 3 Oct 2024 14:30:49 -0400 Subject: [PATCH 17/86] Move description of n/a above "String values" to avoid any association - It somewhat addresses concern/discussion in https://github.com/bids-standard/bids-specification/issues/1938 --- src/common-principles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common-principles.md b/src/common-principles.md index 0a42e4a885..e885cdb8c4 100644 --- a/src/common-principles.md +++ b/src/common-principles.md @@ -489,8 +489,8 @@ first letter in lower case (for example, `variable_name`, not `Variable_name`). Column names defined in the header MUST be separated with tabs as for the data contents. Furthermore, column names MUST NOT be blank (that is, an empty string) and MUST NOT be duplicated within a single TSV file. -String values containing tabs MUST be escaped using double quotes. Missing and non-applicable values MUST be coded as `n/a`. +String values containing tabs MUST be escaped using double quotes. Numerical values MUST employ the dot (`.`) as decimal separator and MAY be specified in scientific notation, using `e` or `E` to separate the significand from the exponent. From 790c0fbf72c01c0723f9afe3486cc154e0669d07 Mon Sep 17 00:00:00 2001 From: Ross Blair Date: Thu, 17 Oct 2024 11:55:42 -0500 Subject: [PATCH 18/86] [SCHEMA] Allow physio files for anat datatype (#1961) * add anat to datatypes field for timeseries no task in schema/rules/files/raw/task * Update src/schema/rules/files/raw/task.yaml Co-authored-by: Chris Markiewicz * Update src/schema/rules/files/raw/task.yaml Co-authored-by: Chris Markiewicz * Update src/schema/rules/files/raw/task.yaml Co-authored-by: Chris Markiewicz * Update src/schema/rules/files/raw/task.yaml --------- Co-authored-by: Chris Markiewicz --- src/schema/rules/files/raw/task.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/schema/rules/files/raw/task.yaml b/src/schema/rules/files/raw/task.yaml index 812765a063..1fe1712915 100644 --- a/src/schema/rules/files/raw/task.yaml +++ b/src/schema/rules/files/raw/task.yaml @@ -101,6 +101,18 @@ events__mrs: nucleus: optional volume: optional +timeseries__anat: + $ref: rules.files.raw.task.timeseries + datatypes: + - anat + entities: + $ref: rules.files.raw.task.timeseries.entities + ceagent: optional + reconstruction: optional + echo: optional + part: optional + chunk: optional + timeseries__func: $ref: rules.files.raw.task.timeseries datatypes: From 5fc3528fb9cad222cb4dadcedf218b2457fc2674 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:42:03 -0400 Subject: [PATCH 19/86] [pre-commit.ci] pre-commit autoupdate (#1967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.12.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.12.1) * remove import checks for old pythons --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Gau --- .pre-commit-config.yaml | 2 +- tools/schemacode/bidsschematools/conftest.py | 6 +----- .../schemacode/bidsschematools/tests/test_make_testdata.py | 6 +----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 935f9ac183..1fdac33ecb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,7 +73,7 @@ repos: - id: codespell args: ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.12.1 hooks: - id: mypy # Sync with project.optional-dependencies.typing diff --git a/tools/schemacode/bidsschematools/conftest.py b/tools/schemacode/bidsschematools/conftest.py index 2e5eaec86f..2b87854a99 100644 --- a/tools/schemacode/bidsschematools/conftest.py +++ b/tools/schemacode/bidsschematools/conftest.py @@ -1,12 +1,8 @@ import logging import tempfile +from importlib.resources import as_file, files from subprocess import run -try: - from importlib.resources import as_file, files -except ImportError: # PY<3.9 - from importlib_resources import as_file, files - import pytest lgr = logging.getLogger() diff --git a/tools/schemacode/bidsschematools/tests/test_make_testdata.py b/tools/schemacode/bidsschematools/tests/test_make_testdata.py index 5721b630d6..8ef6443d8d 100644 --- a/tools/schemacode/bidsschematools/tests/test_make_testdata.py +++ b/tools/schemacode/bidsschematools/tests/test_make_testdata.py @@ -1,10 +1,6 @@ import os import shutil - -try: - from importlib.resources import files -except ImportError: # PY<3.9 - from importlib_resources import files +from importlib.resources import files import pytest From e2a1ecc13b2dd55c6401f2c47d306784af12e08f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 24 Oct 2024 22:04:06 +0200 Subject: [PATCH 20/86] refactor contributing (#1965) --- CONTRIBUTING.md | 348 ++---------------------------------------------- macros_doc.md | 24 +--- 2 files changed, 18 insertions(+), 354 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index adae5e2cba..f5d9cd972c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,10 +4,15 @@ _We're so excited you're here and want to contribute._ -We hope that these guidelines are designed to make it as easy as possible to get -involved. +We hope that these guidelines are designed to make it as easy as possible to get involved. If you have any questions that aren't discussed below, please let us know -by [opening an issue](#understanding-issues). +by [opening an issue](https://github.com/bids-standard/bids-specification/issues/new). + +If you are not familiar with Git ansd GitHub, +check our [generic contributing guidelines](https://bids-website.readthedocs.io/en/latest/collaboration/bids_github/CONTRIBUTING.html). + +If you want to contribute to the BIDS website, +make sure you also read the instructions below. ## Table of contents @@ -15,114 +20,6 @@ Been here before? Already know what you're looking for in this guide? Jump to the following sections: -- [Joining the BIDS community](#joining-the-community) -- [Contributing through GitHub](#contributing-through-github) -- [Understanding issues](#understanding-issues) -- [Writing in Markdown](#writing-in-markdown) -- [Using macros](#using-macros) -- [Fixing Markdown style errors](#fixing-markdown-style-errors) -- [Using pre-commit hooks](#using-pre-commit-hooks) -- [Adding a figure to the specifications](#adding-a-figure-to-the-specifications) -- [Making a change with a pull request](#making-a-change-with-a-pull-request) -- [Example pull request](#example-pull-request) -- [Commenting on a pull request](#commenting-on-a-pull-request) -- [Accepting suggestion from a review](#accepting-suggestion-from-a-review) -- [Making a change to the BIDS-schema](#making-a-change-to-the-BIDS-schema) -- [How the decision to merge a pull request is made?](#how-is-the-decision-to-merge-a-pull-request-made) -- [How is the changelog generated?](#how-is-the-changelog-generated) -- [Recognizing contributions](#recognizing-contributions) - -## Joining the community - -BIDS - the [Brain Imaging Data Structure](https://bids.neuroimaging.io/) - is a -growing community of neuroimaging enthusiasts, and we want to make our resources -accessible to and engaging for as many researchers as possible. - -How do you know that you're a member of the BIDS community? -You're here! -You know that BIDS exists! -You're officially a member of the community. -It's THAT easy! Welcome! - -Most of our discussions take place here in -[GitHub issues](#understanding-issues). -We also have a -[bids-discussion](https://groups.google.com/forum/#!forum/bids-discussion) -Google Group, although this is largely now an archive of previous conversations. - -Moving forward, we encourage all members to contribute here on -[GitHub](https://github.com/bids-standard/bids-specification) or on the -[NeuroStars](https://neurostars.org/tags/bids) Discourse Forum, under the `bids` -tag. - -To keep on top of new posts, please see this guide for setting your -[topic notifications](https://meta.discourse.org/t/discourse-new-user-guide/96331#heading--topic-notifications). - -As a reminder, we expect that all contributions adhere to our -[Code of Conduct](CODE_OF_CONDUCT.md). - -## Contributing through GitHub - -[Git](https://git-scm.com/) is a really useful tool for version control. -[GitHub](https://github.com/) sits on top of git and supports collaborative and -distributed working. - -We know that it can be daunting to start using git and GitHub if you haven't -worked with them in the past, but the BIDS Specification maintainers are here to -help you figure out any of the jargon or confusing instructions you encounter! - -In order to contribute via GitHub you'll need to set up a free account and sign -in. -Here are some -[instructions](https://help.github.com/articles/signing-up-for-a-new-github-account/) -to help you get going. -Remember that you can ask us any questions you need to along the way. - -## Understanding issues - -Every project on GitHub uses -[issues](https://github.com/bids-standard/bids-specification/issues) slightly -differently. - -The following outlines how BIDS developers think about communicating through -issues. - -**Issues** are individual pieces of work that need to be completed or decisions -that need to be made to move the project forwards. -A general guideline: if you find yourself tempted to write a great big issue -that is difficult to describe as one unit of work, please consider splitting it -into two or more issues. - -Issues are assigned [labels](#issue-labels) which explain how they relate to the -overall project's goals and immediate next steps. - -### Issue labels - -The current list of labels are -[here](https://github.com/bids-standard/bids-specification/labels) and include: - -- [![Help wanted](https://img.shields.io/badge/-help%20wanted-159818.svg)](https://github.com/bids-standard/bids-specification/labels/help%20wanted) - _These issues contain a task that a member of the team has determined we - need additional help with._ - - If you feel that you can contribute to one of these issues, we especially - encourage you to do so! - -- [![Opinions wanted](https://img.shields.io/badge/-opinions%20wanted-84b6eb.svg)](https://github.com/bids-standard/bids-specification/labels/opinions%20wanted) - _These issues hold discussions where we're especially eager for feedback._ - - Ongoing discussions benefit from broad feedback. - This label is used to highlight issues where decisions are being considered, - so please join the conversation! - -- [![Community](https://img.shields.io/badge/-community-%23ddcc5f.svg)](https://github.com/bids-standard/bids-specification/labels/community) - _These issues are related to building and supporting the BIDS community._ - - In addition to the specification itself, we are dedicated to creating a - healthy community. - These issues highlight pieces of work or discussions - around how we can support our members and make it easier to contribute. - ## Writing in Markdown The specification documents follow the @@ -227,7 +124,7 @@ That would look like this: | Manufacturer | Manufacturer of the equipment, for example (`"Siemens"`) | -#### MkDocs admonitions +### MkDocs admonitions It is possible to use [Mkdocs admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#inline-blocks-inline-end) to highlight certain aspect of the specification. @@ -272,7 +169,7 @@ We have dedicated documentation for this, see the [macros_doc.ms](./macros_doc.m We are using MkDocs to render our specification. Please follow these instructions if you would like to build the specification locally. -#### 1. Download the BIDS specification [repository](https://github.com/bids-standard/bids-specification/tree/master) onto your computer +### 1. Download the BIDS specification [repository](https://github.com/bids-standard/bids-specification/tree/master) onto your computer This can be done by clicking the green button on the right titled "Clone or download" @@ -284,7 +181,7 @@ Or you can use the following `git` command in a terminal: git clone https://github.com/bids-standard/bids-specification.git ``` -#### 2. In the terminal (command line) navigate to your local version of the specification +### 2. In the terminal (command line) navigate to your local version of the specification This location will have the same files you see on our [main specification page](https://github.com/bids-standard/bids-specification). @@ -299,7 +196,7 @@ cd bids-specification Enter all commands below from the command line prompt located at the root of the local version of the specification. -#### 3. Install MkDocs, the Material theme and the required extensions +### 3. Install MkDocs, the Material theme and the required extensions In the following links, you can find more information about @@ -358,7 +255,7 @@ This installs the `bidsschemacode` package in "editable" mode, so that any changes you make to the code will be reflected when you use it, such as when you build the documentation locally. -#### 4. Ready to build! +### 4. Ready to build! Using the terminal (command line) please enter `mkdocs serve`. This will allow you to see a local version of the specification. @@ -440,19 +337,6 @@ Using `remark` to fix some linting errors might introduce some additional change You might have to revert those or use [interactive staging](https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging) to make sure you only commit the right chunks of code. -## Using pre-commit hooks - -> Git hook scripts are useful for identifying simple issues before submission to code review. - -For more information on Git hooks, see: https://pre-commit.com/. - -Contributors to the bids-specification repository can optionally make use of the `.pre-commit-config.yaml` -configuration file at the root of the repository. -Using Python, simply install `pre-commit` via `pip`, and then run `pre-commit install` from the root -of the bids-specification repository. - -To uninstall the pre-commit hooks, run `pre-commit uninstall`. - ## Adding a figure to the specifications > A figure is worth a 1000 words! @@ -474,6 +358,7 @@ Figures can be inserted in a Markdown like this (see also ```Markdown ![text to show if image does not load](relative_path_to_file "text to show when hovering over image") ``` + ### Recommendations for figures 1. Try to keep the file size of your figure relatively small (smaller than 500 Kb) @@ -491,190 +376,6 @@ future. and how it can be reproduced. Preferably with a link to the file that generated the figure if relevant. -## Making a change with a pull request - -We appreciate all contributions to the BIDS Specification. **THANK YOU** for -helping us build this useful resource. - -#### 1. Comment on an existing issue or open a new issue referencing your addition - -This allows other members of the BIDS Specification team to confirm that you -aren't overlapping with work that's currently underway and that everyone is on -the same page with the goal of the work you're going to carry out. - -#### 2. [Fork](https://help.github.com/articles/fork-a-repo/) [this repository](https://github.com/bids-standard/bids-specification) to your profile - -This is now your own unique copy of the BIDS Specification. -Changes here won't affect anyone else's work, so it's a safe space to explore edits to the -specification! - -Make sure to -[keep your fork up to date](https://help.github.com/articles/syncing-a-fork/) -with the master repository, otherwise you can end up with lots of dreaded -[merge conflicts](https://help.github.com/articles/about-merge-conflicts/). - -#### 3. Make the changes you've discussed - -Try to keep the changes focused. -If you submit a large amount of work in all in one go it will be much more work -for whomever is reviewing your pull request. -Please detail the changes you are attempting to make. - -#### 4. Submit a [pull request](https://help.github.com/articles/about-pull-requests/) - -Please keep the title of your pull request short but informative because it will -appear in the [changelog](src/CHANGES.md) ([see below](#how-is-the-changelog-generated)). - -Use one of the following prefixes in the title of your pull request: - -- `[ENH]` - enhancement of the specification that adds a new feature or - support for a new data type -- `[FIX]` - fix of a typo or language clarification -- `[INFRA]` - changes to the infrastructure automating the specification - release (for example building HTML docs) -- `[SCHEMA]` - changes to the BIDS schema and/or related code -- `[MISC]` - everything else including changes to the file listing - contributors - -If you are opening a pull request to obtain early feedback, but the changes are -not ready to be merged (also known as a "work in progress" pull request, sometimes abbreviated by `WIP`) -please use a -[draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/). - -A member of the BIDS Specification team will review your changes to confirm that -they can be merged into the main codebase. - -A [review](https://help.github.com/articles/about-pull-request-reviews/) will -usually consist of a few questions to help clarify the work you've done. -Keep an eye on your GitHub notifications and be prepared to join in that -conversation. - -You can update your [fork](https://help.github.com/articles/about-forks/) of the -BIDS Specification and the pull request will automatically update with those -commits. -You don't need to submit a new pull request when you make a change in -response to a review. - -GitHub has a [nice introduction](https://help.github.com/articles/github-flow/) -to the pull request workflow, but please [get in touch](#get-in-touch) if you -have any questions. - -## Example pull request - -Example-Contribution - -## Commenting on a pull request - -Our primary method of adding to or enhancing BIDS occurs in the form of -[pull requests](https://help.github.com/articles/about-pull-requests/). -BIDS Extension Proposals -([BEPs](https://docs.google.com/document/d/1pWmEEY-1-WuwBPNy5tDAxVJYQ9Een4hZJM06tQZg8X4/)) -are submitted as pull requests, and commenting on pull requests is an important -way of participating in the BIDS community. - -This section outlines how to comment on a pull request. - -### Navigating to open pull requests - -The list of pull requests can be found by clicking on the "Pull requests" tab in -the -[BIDS-Specification repository](https://github.com/bids-standard/bids-specification). - -![BIDS-mainpage](commenting_images/BIDS_GitHub_mainpage.png "BIDS_GitHub_mainpage") - -### Selecting an open pull request - -In this example we will be navigating to our -[BIDS common derivatives pull request](https://github.com/bids-standard/bids-specification/pull/265). - -![BIDS-pr-list](commenting_images/BIDS_pr_list.png "BIDS_pr_list") - -### Pull request description - -Upon opening the pull request we see a detailed description of what this pull -request is seeking to address. -Descriptions are important for reviewers and the community to gain context into -what the pull request is achieving. - -![BIDS-pr](commenting_images/BIDS_pr.png "BIDS_pr") - -### Generally commenting on a pull request - -At the bottom of the pull request page, a comment box is provided for general -comments and questions. - -![BIDS-comment](commenting_images/BIDS_comment.png "BIDS-comment") - -### Specific comments on a pull request - -The proposed changes to the text of the specification can be seen in the "Files -changed" tab. -Proposed additions are displayed on a green background with a `+` -before each added line. -Proposed deletions are displayed on a red background with a `-` before each removed line. -To comment on a specific line, hover over it, and click the blue plus sign (pictured below). -Multiple lines can be selected by clicking and dragging the plus sign. - -![BIDS-specific-comment](commenting_images/BIDS_file_comment.png "BIDS-specific-comment") - -#### Suggesting text - -Comments on lines can contain "suggestions", which allow you to propose specific -wording for consideration. To make a suggestion, click the plus/minus (±) icon -in the comment box (pictured below). - -![BIDS-suggest-box](commenting_images/BIDS_suggest.png "BIDS-suggest") - -Once the button is clicked the highlighted text will be copied into the comment -box and formatted as a -[Markdown code block](https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks). - -![BIDS-suggest-text](commenting_images/BIDS_suggest_text.png "BIDS-suggest-box") - -The "Preview" tab in the comment box will show your suggestion as it will be -rendered. The "Suggested change" box will highlight the differences between the -original text and your suggestion. - -![BIDS-suggest-change](commenting_images/BIDS_suggest_change.png "BIDS-suggest-change") - -A comment may be submitted on its own by clicking "Add single comment". Several -comments may be grouped by clicking "Start a review". As more comments are -written, accept them with "Add review comment", and submit your review comments -as a batch by clicking the "Finish your review" button. - -## Accepting suggestion from a review - -When others are making [suggestions to your pull request](#suggesting-text), you -have the possibility to accept directly the changes suggested during the review -through the github interface. This can often be faster and more convenient than -make the changes locally and then pushing those changes to update your pull -request. Moreover it gives the opportunity to give credit to the reviewers for -their contribution. - -To do this, you must click on the `Files changed` tab at the top of the page of -a pull request. - -![BIDS_pr_files_changed](commenting_images/BIDS_pr_files_changed.png "BIDS_pr_files_changed") - -From there you can browse the different files changed and the 'diff' for each of -them (what line was changed and what the change consist of). You can also see -comments and directly change suggestions made by reviewers. - -You can add each suggestion one by one or group them together in a batch. - -![BIDS_pr_accept_comment](commenting_images/BIDS_pr_accept_comment.png "BIDS_pr_accept_comment") - -If you decide to batch the suggestions to add several of them at once, you must -scroll back to the top of the 'Files changed' page and the `commit suggestions` -button will let you add all those suggestions as a single commit. - -![BIDS_pr_commit_batch](commenting_images/BIDS_pr_commit_batch.png "BIDS_pr_commit_batch") - -Once those suggestions are committed the commit information should mention the -reviewer as a co-author. - -![BIDS_pr_reviewer_credit](commenting_images/BIDS_pr_reviewer_credit.png "BIDS_pr_reviewer_credit") - ## Making a change to the BIDS-schema Several aspects of the specification are defined in a set of YAML files in the @@ -709,12 +410,6 @@ While the continuous integration run on pull requests by the repository will ren it is crucial to manually review the rendered changes to ensure that the code not only successfully runs, but also that the rendered changes appear as expected. -### 4. Push your changes - -For more information on making general changes with a pull request, please -review -[Making a change with a pull request](#making-a-change-with-a-pull-request). - ## How is the decision to merge a pull request made? The decision-making rules are outlined in @@ -734,21 +429,6 @@ Check the proposed changes and merge the Pull Request at will. To exclude pull requests from showing up in the changelog, they have to be labeled with the "exclude-from-changelog" label. -## Recognizing contributions - -BIDS follows the -[all-contributors](https://github.com/kentcdodds/all-contributors) -specification, so we welcome and recognize all contributions from documentation -to testing to code development. -You can see a list of contributors in the -[contributors appendix](https://bids-specification.readthedocs.io/en/stable/appendices/contributors.html) -of the BIDS specification. - -If you have made any type of contributions to BIDS, -we encourage you to enter or update your information in the -[Contributors wiki page](https://github.com/bids-standard/bids-specification/wiki/Recent-Contributors) -according to the instructions listed there. - ## Thank you! You're awesome. diff --git a/macros_doc.md b/macros_doc.md index 6ec9fcf5a2..82c40dfff0 100644 --- a/macros_doc.md +++ b/macros_doc.md @@ -1,3 +1,7 @@ +--- +render_macros: false +--- + # Using MkDocs macros in the BIDS specification We use [mkdocs-macros](https://mkdocs-macros-plugin.readthedocs.io/en/latest/) @@ -9,23 +13,6 @@ in the specification. Below you will find answers to frequently asked questions regarding using macros in the BIDS specification. -- [Using MkDocs macros in the BIDS specification](#using-mkdocs-macros-in-the-bids-specification) - - [What are macros and why use them?](#what-are-macros-and-why-use-them) - - [What kind of input information are required by macros?](#what-kind-of-input-information-are-required-by-macros) - - [What macros are available?](#what-macros-are-available) - - [When should I use a macro?](#when-should-i-use-a-macro) - - [Do I need learn how to program to use those macros?](#do-i-need-learn-how-to-program-to-use-those-macros) - - [Anything else I need to know if I need to insert a new macro call?](#anything-else-i-need-to-know-if-i-need-to-insert-a-new-macro-call) - - [How-To and Examples](#how-to-and-examples) - - [Writing directory content examples](#writing-directory-content-examples) - - [Generating tables](#generating-tables) - - [Modifying a term in the table](#modifying-a-term-in-the-table) - - [Why would you NOT want to modify the content of the yml file directly ?](#why-would-you-not-want-to-modify-the-content-of-the-yml-file-directly-) - - [Adding a new term to the table](#adding-a-new-term-to-the-table) - - [Should I create a macro if I need a new kind of table?](#should-i-create-a-macro-if-i-need-a-new-kind-of-table) - - [Why use macros at all?](#why-use-macros-at-all) - - [Links and references](#links-and-references) - ## What are macros and why use them? A macro is a rule or pattern that specifies how an input should be mapped to @@ -127,9 +114,6 @@ when you get back to the document you just edited) is to leave a comment before the macro to quickly explain what it does and where to find more information about it. - - It could for example look like this: ```markdown From 6e2874cec52c48ae1b30fc8d32ba9ffa1fdad6d4 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 24 Oct 2024 16:20:14 -0400 Subject: [PATCH 21/86] fix(checks): Enforce timing mutual exclusions on BOLD/ASL data only (#1969) --- src/schema/rules/checks/func.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/schema/rules/checks/func.yaml b/src/schema/rules/checks/func.yaml index 03570a058d..7966a6bf3a 100644 --- a/src/schema/rules/checks/func.yaml +++ b/src/schema/rules/checks/func.yaml @@ -88,6 +88,8 @@ VolumeTimingRepetitionTimeMutex: or 'VolumeTiming' when variable times are used. level: error selectors: + - type(nifti_header) != "null" + - intersects([suffix], ["asl", "bold"]) - type(sidecar.VolumeTiming) != "null" checks: - type(sidecar.RepetitionTime) == "null" @@ -101,6 +103,8 @@ RepetitionTimeAcquisitionDurationMutex: (RepetitionTime - AcquisitionDuration). level: error selectors: + - type(nifti_header) != "null" + - intersects([suffix], ["asl", "bold"]) - type(sidecar.AcquisitionDuration) != "null" checks: - type(sidecar.RepetitionTime) == "null" @@ -113,6 +117,8 @@ VolumeTimingDelayTimeMutex: To specify acquisition duration, use 'AcquisitionDuration' or 'SliceTiming'. level: error selectors: + - type(nifti_header) != "null" + - intersects([suffix], ["asl", "bold"]) - type(sidecar.VolumeTiming) != "null" checks: - type(sidecar.DelayTime) == "null" @@ -124,6 +130,8 @@ VolumeTimingMissingAcquisitionDuration: The field 'VolumeTiming' requires 'AcquisitionDuration' or 'SliceTiming' to be defined. level: error selectors: + - type(nifti_header) != "null" + - intersects([suffix], ["asl", "bold"]) - type(sidecar.VolumeTiming) != "null" checks: - '"SliceTiming" in sidecar || "AcquisitionDuration" in sidecar' From 5f70048192847478cfe2d1b86a71ec20221ddf73 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 25 Oct 2024 13:17:06 -0400 Subject: [PATCH 22/86] Include entity-less "scans.json" into an example of inheritance principle (#1945) * Include entity-less "scans.json" into an example of inheritance principle Clarifies #789 * Apply suggestions from code review --------- Co-authored-by: Remi Gau --- src/common-principles.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common-principles.md b/src/common-principles.md index 0a42e4a885..4e5509ac7b 100644 --- a/src/common-principles.md +++ b/src/common-principles.md @@ -739,9 +739,11 @@ A guide for using macros can be found at "sub-01_task-rest_acq-default_bold.nii.gz": "", "sub-01_task-rest_acq-longtr_bold.nii.gz": "", "sub-01_task-rest_acq-longtr_bold.json": "", - } + }, + "sub-01_scans.tsv": "", }, "task-rest_bold.json": "", + "scans.json": "" } ) }} @@ -773,6 +775,10 @@ the value for field "`RepetitionTime`" is therefore overridden to the value `3.0 The value for field "`EchoTime`" remains applicable to that image, and is not unset by its absence in the metadata file at the lower level (rule 5.b; corollary 3). +A single `scans.json`, without any entity in the filename at the top level, +is applicable to describe columns of the `sub-01_scans.tsv` +and any other `_scans.tsv` potentially present in the dataset for other subjects. + Example 2: Impermissible use of multiple metadata files at one directory level (rule 4) + {{ MACROS___make_filetree_example( { "pipeline1": { @@ -60,6 +60,7 @@ The definitions of the fields specified in these tables may be found in A guide for using macros can be found at https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md --> + {{ MACROS___make_sidecar_table([ "derivatives.common_derivatives.ImageDerivatives", "derivatives.common_derivatives.ImageDerivativeResEntity", @@ -79,8 +80,8 @@ Example JSON file corresponding to } ``` -This would be equivalent to having two JSON metadata files, one -corresponding to `res-lo` +This would be equivalent to having two JSON metadata files, one corresponding to +`res-lo` (`pipeline1/sub-001/func/sub-001_task-rest_run-1_space-MNI305_res-lo_bold.json`): ```JSON @@ -100,14 +101,15 @@ And one corresponding to `res-hi` } ``` -Example of CIFTI-2 files (a format that combines regularly sampled data -and non-parametric surfaces) having both [`res`](../appendices/entities.md#res) -and [`den`](../appendices/entities.md#den) entities: +Example of CIFTI-2 files (a format that combines regularly sampled data and +non-parametric surfaces) having both [`res`](../appendices/entities.md#res) and +[`den`](../appendices/entities.md#den) entities: + {{ MACROS___make_filetree_example( { "pipeline1": { @@ -151,11 +153,13 @@ Template: [_space-][_res-