Repository navigation
feat: read the v2 skeleton and resolve TemplateFlow 2.0 renames - #160
Conversation
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: 4d58b69f4e
ℹ️ 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".
New homes start from the v2 skeleton (current names, renames.tsv and a manifest); existing homes keep the legacy skeleton until `templateflow update --migrate`. ls() and get() resolve old names through renames.tsv with a TemplateFlowAliasWarning (FutureWarning), serve removed files until 27.0, and, in homes not yet migrated, find old files with current queries. Adds get_atlas_metadata(), the inversion entity, `+` in label and letters in scale, and fixes get_metadata() and get() with DataLad. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ones
ls() resolved old names only when a query found nothing, so a query that
also found current files dropped the renamed ones without a warning:
ls('A', desc=['CSF', 'brain'], suffix='probseg') returned desc-brain and
missed desc-CSF (now label-CSF). A query that finds files now also adds
renamed files it names by a value of their other name, with the warning
in migrated homes and silently in legacy ones. Entities it requires
absent (None) or present (Query.ANY) are still read in the home's names,
so current queries such as desc=None never warn. Removed files are
served to queries that find nothing else, as before.
Alias lookups now run on every query with renames, so rows are indexed
by template and path entities are parsed with the configuration loaded
once: 0.7 ms per query instead of 13 ms on a table of 2,700 rows. The
results are ordered like BIDSLayout.get() (natural sort).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11ad283 to
5db77cd
Compare
…ames table Runs templateflow 25.0.4, 25.1.2 and this branch (Python 3.13 and 3.14) against a fixture Archive whose skeletons the real build-skeletons.py builds, before and after a renames table, through a local S3 and skeleton server. Covers pinned clients, update(), homes shared with --migrate, and DataLad homes; negative controls show the matrix notices missing S3 copies and the v2 skeleton served at the legacy URL. The accepted DataLad break of released clients is a strict expected failure. The Compatibility workflow runs on pushes, pull requests and nightly, and replays a proposed table (root rows or a template's .renames.tsv) on demand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
numpy, pandas, scipy, SQLAlchemy, PyYAML and greenlet publish cp315 wheels; the matrix passes locally on 3.15 (16 passed, 2 xfailed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #160 +/- ##
==========================================
+ Coverage 77.62% 84.02% +6.39%
==========================================
Files 9 10 +1
Lines 447 920 +473
Branches 82 192 +110
==========================================
+ Hits 347 773 +426
- Misses 63 83 +20
- Partials 37 64 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
test: compatibility matrix of released clients before and after a renames table
Summary
WP3, part 1: client 26.0 reads the v2 skeleton (templateflow/templateflow#217) and resolves the TemplateFlow 2.0 renames. Part 2 adds the compatibility matrix against released clients.
Behaviour decided for the TemplateFlow 2.0 overhaul:
ls('A', desc=['CSF', 'brain'], suffix='probseg')returns desc-brain and the renamed label-CSF, with the warning. Entities a query requires absent (None) or present (Query.ANY) are read in the home's names, so current queries such asdesc=Nonenever warn.n/a) are served until 27.0, with a warning.Smaller changes:
.templateflow/skeleton.zip, 1.3 MB). Every update applies it again, so deleted folders come back, offline too.inversion(inv-),+inlabel, letters inscale, as in the python-manager rule set.TEMPLATEFLOW_SKEL_URLreplaces the base URL of the skeletons.get_metadata()called_datalad_getwith the wrong arguments;get()skipped files when DataLad fetched several (it removed items from the list it iterated);ConnectionError.Evidence
pytest -n 4 --doctest-modules templateflow), including the existing suite against live S3. The new tests run offline:test_sync.py: new homes, migration (move, delete, prune, reset, refresh; root files and foreign files kept), published skeleton updates, corrupt downloads, DataLad refusal, deleted folders coming back.test_renames.py: the table and its lookup by template, and alias resolution in v2, legacy, both-names and DataLad-style homes, also next to files the query finds directly. It also has a parity check:match_entitiesagainstBIDSLayout.get()over the 2,539 indexed files of the real skeleton, for 22 queries coveringNone,Query.*, lists, dtype casts and regex.tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz;templateflow update --migrate, which adds 26 files and keeps the download;get()s the same file from the migrated home.Merge Danger
Door: two-way
Blast Radius: client users
Until a release, only
masterinstalls see it. After a release:--migrate;update().The Archive has 23 renames today (the canaries), so most queries see no difference. Part 2 runs released clients from 0.8.1 on against both skeletons.