refactor: generalize format_bids_path (schema-driven) - #112
Open
kaitj wants to merge 3 commits into
Open
Conversation
format_bids_path (schema-driven)
4 tasks
kaitj
marked this pull request as ready for review
August 20, 2026 18:14
Contributor
Author
|
think the CI failed to run here during GH down time when this was pushed |
kaitj
force-pushed
the
feat/generalize-ents/phase4
branch
from
August 27, 2026 20:28
0348920 to
dce321d
Compare
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
kaitj
force-pushed
the
feat/generalize-ents/phase4
branch
from
August 27, 2026 20:30
dce321d to
f266435
Compare
Benchmark Results
|
- Derive the special-entity set (datatype/suffix/ext) and directory ordering from the BIDS schema instead of hardcoded constants - Prepend directory entities by reversed `get_entity_directory_order`, fixing the KeyError on non-sub datasets (e.g. tpl-* derivatives) - Add optional `schema` param to `format_bids_path`; move logic into private `_format_bids_path` helper
- Remove the uncalled _filter_include/_filter_exclude/_multi_pattern_filter cluster and its orphaned test - Also clear the _load_from_path, entity_arrow_schema, and _lookups_from_arrow LRU caches so all schema-derived caches are covered - Fix stale set_bids_schema reference and slim the docstring
- Add tpl-* (non-sub) path cases to test_format_bids_path - Assert the parsed entities survive a second parse of the formatted path
kaitj
force-pushed
the
feat/generalize-ents/phase4
branch
from
September 2, 2026 17:38
f266435 to
a5c1d15
Compare
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.
This PR:
Phase 4 of the generalized entities refactor, building on top of phase 3 (#111). A refactor to make
format_bids_pathschema-driven with a cleanup pass.format_bids_pathis now schema-driven - the public signature gains an optionalschema: SchemaSpecparameter, with logic moved to a private_format_bids_path(..., adapter)helper. The special entity set is derived from the schema (entities withformat == "special") instead of a hardcoded literal, and directory prepending iteratesget_entity_directory_order(adapter)in reverse instead of hardcodingsub/ses, fixing aKeyErroron non-subject datasets (e.g.tpl-*derivatives). Backwards compatible_filter_include/_filter_exclude/_multi_pattern_filtercluster and its orphaned testclear_schema_caches()now also clears the_load_from_path,entity_arrow_schemaand_lookups_from_arrowcaches, covering full set of schema/adapter derived LRU caches; also fixed stale docstring reference to nonexistentbids2table.set_bids_schema.tpl-MNI152NLin2009Asym/...) round-trip cases and a parse-again assertion totest_format_bids_pathType of Change
Related Issue(s)
Stack created with GitHub Stacks CLI • Give Feedback 💬