Repository navigation
feat(migrate): the content of a template in TemplateFlow 2.0 - #22
Merged
Merged
Conversation
R21: a probabilistic segmentation of one volume (from the header facts) names its class with label, so desc-brain_probseg becomes label-brain_probseg in MNI152NLin2009cAsym (res-1) and WHS (res-2). A 4D probseg keeps its desc. R22: a file renamed onto a file with the same bytes merges into it. Its old name stays a row of the renames table, pointing at the file it merges into. In MNI152NLin2009cAsym, res-01_desc-brain_probseg was kept in 2020 as a copy of res-01_label-brain_probseg; both old names now point at res-1_label-brain_probseg. The empty res-02_atlas-HOSPA_probseg of MNI152NLin2009cAsym (every voxel 0) is removed by a decision of the config (an n/a row). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
migrate.content plans the text files of a template after its renames: - T05: bids:: URIs and file names in JSON strings follow the renames, and so do Resolution keys; paths into a TemplateFlow cache become bids:: URIs. - T06: template_description.json takes the res blocks of the res plan (kept blocks keep their values; rebuilt and new ones take their files' grid; cohorts override what differs), RRID prefixes, Funding as one item per grant, cohort ages as [min, max] with units in full, sex for gender, DOIs as URLs. - T10: files written by hand; T08: the generated files (cohorts tables); T09: the config's .gitattributes. - The flip: BIDSVersion and TemplateFlowVersion change only when the result passes the validator in strict mode (metadata level); then T11 writes a 2.0.0 entry at the top of CHANGES. Otherwise M205 says why. The config gains its policies (content_change: freeze, flip: when-clean), the .gitattributes text and edits of JSON fields. The first edit gives the Diedrichsen2009 sidecar of MNI152NLin6Asym its source path inside SourceRepository; at SourceCommit, that file has the sidecar's SourceSHA256. migrate.engine.plan_template joins names and content, and derives the rows: a renamed text file whose bytes change gets n/a (its old name keeps its old bytes), and so do deleted files. Plans are deterministic, and carry the fingerprints of their snapshot and of their result. On the Archive, strict errors fall from 2988 to 374 and no plan is blocked; the rest are lookup tables, licenses, authors and atlases (PR 5b and 5c), and README files (WP5). tests/data/res-2.0.0.tsv pins the res blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oesteban
marked this pull request as ready for review
December 4, 2026 17:10
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. |
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
PR 5 of the migration to TemplateFlow 2.0 (WP4). It plans the content of each template after its renames, then joins names and content into one plan. Lookup tables (PR 5b) and licenses, authors and atlases (PR 5c) follow as their own PRs.
Names addendum (golden renames table: 3 rows change):
label.Config (
migrate/config/2.0.0.yaml):The Diedrichsen2009 source was checked: at
SourceCommit,Diedrichsen_2009/atl-Anatom_space-MNI_dseg.niihas the sidecar'sSourceSHA256.Evidence
Before: the Archive after PR 4's renames only, validated in strict mode at the metadata level: 2988 errors.
After: every template planned from the pinned v2 skeleton (python-client 45755e5): 374 errors, and no plan is blocked.
Gone: TF117, TF309, TF312, TF320, TF330, TF410, and the TF301 of
res, cohorts and Funding.test_migrate_content.py(17 tests):check_fragmenton every new.renames.tsv, and idempotence (planning the migrated Archive writes nothing and gives the same result fingerprint).tests/data/res-2.0.0.tsvpins theresblocks: 30 kept, 4 rebuilt, 24 new.Local mirror of
pythonapp.yml: ruff and 313 tests on Python 3.13 and 3.15; the sdist and wheel build, passtwine check, and install with the same version.Rebuilt and new res blocks
Zooms are isotropic. RESILIENT follows
effective_grid: the template block takes cohort 1's grid, and the other cohorts override its origin.Merge Danger
Door: two-way. Nothing in this PR touches a template: plans live in memory, and
applycomes in PR 6.Blast Radius: internal.
tfmgr validate,generateandaddare unchanged.Configgains fields with defaults.