Repository navigation
feat(migrate): new names of the Archive (rules, res keys, decisions, guards) - #21
Merged
Merged
Conversation
A desc, seg or label must tell its file apart from another file of the template (res, den, hemi and cohort aside). TF118 warns about those that do not, with the exceptions the migration keeps: masks keep desc, probabilistic segmentations keep label, and desc-brain and desc-tissues are always kept. probseg and midthickness take .shape.gii (suffixes.yaml `more_extensions`): probabilities on a surface, and the vertex areas of HCP's va_avg files. TF701 compares grids with numpy's tolerance written out (no numpy), and `effective_grid` (the template's block with its cohort's fields over it) becomes public for the migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The res keys of the migration follow the grid of each volume, so `needed()` lists every volume (and GIFTI files whose suffix the rules must check), not only volumes without res. The bundled table is regenerated from a local checkout of the Archive: 1599 files, every row of the previous table kept (the vertex areas of fsLR and fsaverage are no longer needed), and the grids agree with a range-read scan of the S3 copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…guards) `plan_names` renames the files of a template: the decisions of `migrate/config/2.0.0.yaml` first, then rules R01 to R20 and R99. Every volume takes the res key of its grid (`res.py`): a block that no file matches is rebuilt from its files, a volume off its block takes the key of its grid or a new one (its voxel size when free, else an index), and cohorts that differ only in their origin share a key. The config holds the atlas labels (Osen2019, Goerzen2020, CerebrA, with evidence), renames of single templates (dhcpAsym surfaces, tissue maps as desc-tissues, dropped desc values, NMT31Sym's 5D stacks) and res keys pinned by hand, each with a count the engine checks (M108). Findings block a plan: names the naming checks reject (M101, with a decision to fill in), entities already set (M102), collisions (M103, M104), old names reused (M105), names the legacy skeleton drops (M106), moves across directories (M107), ambiguous or unknown grids (M109 to M111), GIFTI content that does not fit (M112), and decisions that would apply again to the names they give (M113). `merge_fragment` and `check_fragment` write and check a .renames.tsv as the template action reads it. Tests pin the 1566 rows of the Archive (tests/data/renames-2.0.0.tsv) and check that the result is unique, valid in strict mode, accepted by the action and TF804, and planned again to no renames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oesteban
marked this pull request as ready for review
December 4, 2026 13:47
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1961c188f8
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…sion
`set: {extension: null}` passed the schema and the config checks, and the
first file it matched crashed planning (TypeError while writing the name).
The schema now requires a string for `suffix` and `extension` in `set`,
and the config check rejects an extension that no suffix of the rule set
takes, as it already did for suffixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The new names of the Archive for TemplateFlow 2.0 (WP4, PR 4 of 7; after #20). Nothing renames files yet: PR 6 applies plans.
The decisions in
2.0.0.yamlare the ones agreed for WP4:v3becomesOsen2019, Fischer344v4becomesGoerzen2020(evidence cited), and the typoCerebAbecomesCerebrA.desc-tissues, never atlases: RESILIENT, Fischer344, NMT31Sym, NKI, anddesc-tissues4anddesc-tissues6in OASIS30ANTs.fMRIPrep,DC,regandavgseg. Their meaning moves to the JSON sidecars in PR 5._label.giibecomes_dseg.label.gii, and_roi.shape.giibecomes_label-cortex_probseg.shape.gii.n/a), since the level images hold the same data.res-1until their data fix.dparc) becomemask.label.gii(R17).TF118 is a new warning for a
desc,segorlabelthat tells its file apart from no other file. Masks keepdesc, probabilistic segmentations keeplabel, anddesc-brainanddesc-tissuesare always kept.Evidence
Before: no plan of the new names.
After:
archive_table(plans)from the pinned v2 skeleton (python-client 45755e5), the bundled header facts and the config:n/a)Tests on the whole Archive:
.renames.tsvpassescheck_fragment, and the root table passes TF804.The idempotence test caught a real bug. A decision written for the old stack names also matched the migrated level files, so planning twice would have removed them. M113 now blocks any decision that matches a name it gives.
Header facts now cover all 1599 files the rules read, and agree with a range-read scan of the S3 copies.
TF118: 54 warnings on the legacy Archive (pinned in
test_archive.py), and 31 after the migration, all on names kept on purpose (seg-aparc,desc-vaavg,desc-SPM12,seg-aseg,desc-cerebrum,desc-carpet).Local CI:
pytest -o addopts="" --doctest-modules tfmanagerpasses (287 tests) on Python 3.13.7 and 3.15.0rc2; ruff is clean; the sdist and wheel includemigrate/config/*.Merge Danger
Door: two-way
The rename plan is library code and test data. Nothing writes to a template until PR 6, and the golden table is reviewed before any template PR.
Blast Radius: validator
tfmgr validatereports a new warning (TF118) and acceptsprobsegandmidthicknesswith.shape.gii. Neither changes an exit code, since warnings never fail validation.