← 输入框|github.com|刷新
Skip to content

feat(validate): index values are not zero-padded (TF117) - #15

Merged
oesteban merged 1 commit into
masterfrom
feat/unpadded-index
Dec 3, 2026
Merged

oesteban merged 1 commit into
masterfrom
feat/unpadded-index

Conversation

@oesteban

@oesteban oesteban commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

New rule TF117 zero-padded-index: res, cohort, scale and inv values are written without leading zeros, in file names and in the res and cohort keys of template_description.json.

 check_names (per file)
   TF105 entity-value, TF106 not-queryable
+  TF117 if an index value starts with 0: suggest the unpadded name (in BIDS order)
 check_blocks (template_description.json)
   TF330 res keys vs file names, TF332 cohort keys vs file names
+check_padded_keys: TF117 on res, cohort and cohort.<N>.res keys

Severity: error for TemplateFlow 2.0 templates, warning in legacy mode. The client keeps reading res-0*(\d+) as an integer, so queries match either form during the migration.

Also names the 26.0.0rc2 heading in CHANGES.rst, which was still "Unreleased".

Evidence

  • Tests: python -m pytest -o addopts="" --doctest-modules tfmanager: 167 passed (6 new: padded res and scale names, the suggestion, legacy severity, res-0/res-10 not flagged, padded res and cohort.<N>.res keys).
  • Archive (tfmgr validate on the current skeleton, legacy mode): 278 TF117 warnings, all on res. That is 269 file names in MNI152NLin2009cAsym, MNI152NLin6Asym, NKI, MNI152Lin, OASIS30ANTs, PNC, MNI152NLin6Sym and fsaverage, plus the res keys of 9 descriptions (MNI152NLin2009aAsym has unpadded names but "01" keys). No cohort, scale or inv value is padded.
    tpl-MNI152Lin_desc-SPM12_res-02_PDw.nii.gz  ->  tpl-MNI152Lin_res-2_desc-SPM12_PDw.nii.gz
    

Merge Danger

Door: two-way

Blast Radius: validation reports

Legacy templates get warnings only, so the Archive workflow (templateflow#214/#215) stays green. A 2.0 template with padded values fails validation. The renames themselves come with the migration (WP4/WP5), through .renames.tsv.

res, cohort, scale and inv are written without leading zeros, in file
names and in the res and cohort keys of template_description.json.
Issues on file names suggest the unpadded name. Templates older than
2.0 get a warning. Also names the 26.0.0rc2 heading in CHANGES.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oesteban
oesteban marked this pull request as ready for review December 3, 2026 07:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T07:42:55.589912Z 66a3ff7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oesteban
oesteban merged commit abe4b5f into master Dec 3, 2026
6 checks passed
@oesteban
oesteban deleted the feat/unpadded-index branch December 3, 2026 07:42
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.

1 participant