From 1afbfe8f67f2d6975c2f401b9dcde78110ed1e15 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 19 Apr 2024 12:56:07 -0700 Subject: [PATCH] Make extensions identifiers contain . to separate extensions where multiple used (#1755) * Make extensions identifiers contain . to separate extensions where multiple used * Use underscore since "." is used in path to any object * [DATALAD RUNCMD] sed -i'' -e 's/tsvgz/tsv_gz/g' src/*.md ... === Do not change lines below === { "chain": [], "cmd": "sed -i'' -e 's/tsvgz/tsv_gz/g' src/*.md src/*/*.md", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --------- Co-authored-by: Chris Markiewicz --- src/common-principles.md | 2 +- src/modality-specific-files/physiological-recordings.md | 2 +- src/modality-specific-files/task-events.md | 2 +- src/schema/objects/extensions.yaml | 4 ++-- tools/schemacode/bidsschematools/render/text.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common-principles.md b/src/common-principles.md index 461842ddfc..ac05174e59 100644 --- a/src/common-principles.md +++ b/src/common-principles.md @@ -563,7 +563,7 @@ like in the example below. ### Compressed tabular files Large tabular information, such as physiological recordings, MUST be stored with -[compressed tab-delineated (TSV.GZ) files](glossary.md#tsvgz-extensions) when +[compressed tab-delineated (TSV.GZ) files](glossary.md#tsv_gz-extensions) when so established by the specifications. Rules for formatting plain-text tabular files apply to TSVGZ files with three exceptions: diff --git a/src/modality-specific-files/physiological-recordings.md b/src/modality-specific-files/physiological-recordings.md index 897deb3d1b..8db4a03a02 100644 --- a/src/modality-specific-files/physiological-recordings.md +++ b/src/modality-specific-files/physiological-recordings.md @@ -2,7 +2,7 @@ Physiological recordings such as cardiac and respiratory signals MAY be specified using a [compressed tabular file](../common-principles.md#compressed-tabular-files) -([TSV.GZ file](../glossary.md#tsvgz-extensions)) and a corresponding +([TSV.GZ file](../glossary.md#tsv_gz-extensions)) and a corresponding JSON file for storing metadata fields (see below). !!! example "Example datasets" diff --git a/src/modality-specific-files/task-events.md b/src/modality-specific-files/task-events.md index c3822094a5..ca5925909d 100644 --- a/src/modality-specific-files/task-events.md +++ b/src/modality-specific-files/task-events.md @@ -325,7 +325,7 @@ in the accompanying JSON sidecar as follows (based on the example of the previou Signals related to stimuli (such as parameters of a film or audio stimuli) that are evenly recorded at a constant sampling frequency MUST be specified using a [compressed tabular file](../common-principles.md#compressed-tabular-files) -([TSV.GZ file](../glossary.md#tsvgz-extensions)) and a corresponding +([TSV.GZ file](../glossary.md#tsv_gz-extensions)) and a corresponding JSON file for storing metadata fields (see below). Template: diff --git a/src/schema/objects/extensions.yaml b/src/schema/objects/extensions.yaml index 96056e497d..db38cf55b2 100644 --- a/src/schema/objects/extensions.yaml +++ b/src/schema/objects/extensions.yaml @@ -184,7 +184,7 @@ nii: display_name: NIfTI description: | A Neuroimaging Informatics Technology Initiative (NIfTI) data file. -niigz: +nii_gz: value: .nii.gz display_name: Compressed NIfTI description: | @@ -274,7 +274,7 @@ tsv: display_name: Tab-Delimited description: | A tab-delimited file. -tsvgz: +tsv_gz: value: .tsv.gz display_name: Compressed Tab-Delimited description: | diff --git a/tools/schemacode/bidsschematools/render/text.py b/tools/schemacode/bidsschematools/render/text.py index c9fb6f2298..f26ba73204 100644 --- a/tools/schemacode/bidsschematools/render/text.py +++ b/tools/schemacode/bidsschematools/render/text.py @@ -401,8 +401,8 @@ def make_filename_template( ext_headings = [] for extension in extensions: - # The glossary indexes by the extension identifier (niigz instead of .nii.gz), - # but the rules reference the actual suffix string (.nii.gz instead of niigz), + # The glossary indexes by the extension identifier (nii_gz instead of .nii.gz), + # but the rules reference the actual suffix string (.nii.gz instead of nii_gz), # so we need to look it up. key = ext_key_table.get(extension) if key: