[SCHEMA] Add migrate command to adopt standardized BIDS conventions#2282
[SCHEMA] Add migrate command to adopt standardized BIDS conventions#2282
Conversation
- Add migrate.py module with base migration framework including Migration class, MigrationRegistry, and decorators - Add migrations.py with three specific migrations: - standardize_generatedby: Convert pre-standard provenance to GeneratedBy (BEP028) - fix_inheritance_overloading: Check for deprecated inheritance overloading patterns (PR #1834) - fix_tsv_entity_prefix: Check for missing entity prefixes in TSV files (PR #2281) - Add CLI commands: 'bst migrate list', 'bst migrate run', 'bst migrate all' - Add comprehensive tests for migration framework and specific migrations - All tests passing (24 tests total) Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
- Add comprehensive MIGRATE.md documentation with usage examples - Add CLI integration tests to verify end-to-end functionality - Update README.md to mention migrate command feature - All 29 tests passing Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
- Fix quote style inconsistencies (use double quotes) - Remove unnecessary mode arguments from open() - Remove trailing whitespace from blank lines - Replace Dict/Any with dict for modern type hints - All 29 migration tests still passing Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
- Use rglob() for finding dataset_description.json to handle arbitrary nesting depths - Extract dataset validation into helper function to reduce duplication - Use set instead of list for O(1) lookup performance when checking unique values - All 29 migration tests and 110 existing tests still passing Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
|
@copilot make sure to migrate also workflow which would test on example datasets https://github.com/bids-standard/bids-specification/pull/1775/changes#diff-340dd8fa4a5cba6b30520d676d1831fd82628971874ea46396e3ace6c6ef0f03 and then review and address broken CI runs. |
- Add workflow based on PR #1775 to test migrations on example datasets - Uses bst migrate command to migrate datasets from bids-examples - Runs validation before and after migration with deno validator - Skips check-only migrations (inheritance overloading and TSV prefix checks) - Adapted to use new 'bst migrate all' command instead of 'bst migrate-datasets' Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
Added the validate_bids-examples workflow in commit 70d3d23. The workflow:
The workflow is based on PR #1775 but adapted for the current implementation without the BIDS 2.0 specific patching steps. |
|
@copilot In this PR ignore |
- Apply ruff format to fix whitespace and line breaks - Fix import ordering with ruff check --fix - All 119 tests still passing after formatting fixes Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
- Add document start marker (---) - Fix indentation (use 6 spaces for steps) - Split long lines using YAML multiline syntax (>-) - All yamllint errors resolved Co-authored-by: yarikoptic <39889+yarikoptic@users.noreply.github.com>
Addressed all CI workflow failures: Fixed in commits cd1849a and b43da8f:
Test Results - All Passing:
validate_bids-examples workflow status:
No legitimate failures expected - all code quality checks passing and migration logic thoroughly tested. |
Description
Implements migration tooling to help datasets adopt new BIDS conventions. Provides framework for versioned migrations with three initial implementations addressing BEP028 provenance, inheritance overloading (PR #1834), and TSV entity prefixes (PR #2281).
Core Framework (
migrate.py)Migrations (
migrations.py)Pipeline,Software,Tool,Provenance) to BEP028GeneratedByarray formatCLI
Example Migration
CI/Testing Infrastructure
validate_bids-examplesworkflow to test migrations on real datasets from bids-examples repositorybst migratecommandTesting
Documentation
tools/schemacode/MIGRATE.md: Complete usage guide with examplesREADME.mdto list migration featureCode Quality
Checklist
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.