feat: filter + schema CLI args, index columns - #109
Open
kaitj wants to merge 3 commits into
Open
Conversation
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Benchmark Results
|
4 tasks
kaitj
marked this pull request as ready for review
August 20, 2026 18:14
kaitj
force-pushed
the
feat/generalize-ents/phase2
branch
from
August 27, 2026 20:28
13ef379 to
7f595cf
Compare
kaitj
force-pushed
the
feat/generalize-ents/phase2
branch
from
August 27, 2026 20:30
7f595cf to
923c5d8
Compare
- Add _read_dataset_description() cached helper to read
dataset_description.json
- Extend index schema with dataset_name, dataset_type, and
bids_version columns populated from dataset description
- Add _match_filters() and _match_single() for glob-based entity
filtering
- Add filters parameter to index_dataset() and batch_index_dataset()
- Emit DeprecationWarning when include_subjects is used (use
filters={'sub': ...} instead)
- Add clear_schema_caches() function and export in __init__.py
- Add --filter/-f flag with ENTITY=PATTERN syntax, repeatable - Add _parse_filters() to parse filter args, warn on malformed args - Add _normalize_filters() to convert single-item lists to bare strings for compatibility with the API's dict[str, str | list[str]] type - Add --schema flag forwarded to index_dataset, batch_index_dataset, and get_arrow_schema - Emit DeprecationWarning when --subjects is used - Merge --subjects values into filters['sub'] for backward compat - Remove redundant _check_path loop (moved into expansion loop)
- Add `--filter / -f ENTITY=PATTERN` CLI flag for filtering indexed files - Add `--schema` flag support for custom BIDS schema paths - Emit DeprecationWarning for `--subjects` CLI flag and `include_subjects` kwarg - Fix `_find_bids_subject_dirs` to use inline `_match_single` matching - Replace `_filter_include`/`_filter_exclude` with direct pattern matching - Add `cli_prog` module-scoped fixture for CLI tests - Add tests for filter parsing, normalization, matching, and CLI integration - Add tests for new index columns, clear_schema_caches, and schema loading - Update `--schema` help text to accurately describe YAML directory/file input - Add FBT001 to ignored test ruff rules
kaitj
force-pushed
the
feat/generalize-ents/phase2
branch
from
September 2, 2026 17:38
923c5d8 to
3309489
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 2 of the generalized entities refactor, building on top of Phase 1 (#107). Adds additional CLI arguments, index columns, and filtering.
__main__.py - new CLI flags and deprecations:
_indexing.py - filtering + new index columns:
Type of Change
Related Issue(s)
Stack created with GitHub Stacks CLI • Give Feedback 💬