Skip to content

feat(data): DataSpec validation, Croissant fix, MPS guard#376

Open
dhritimandas wants to merge 6 commits intoneuronets:alphafrom
dhritimandas:alpha
Open

feat(data): DataSpec validation, Croissant fix, MPS guard#376
dhritimandas wants to merge 6 commits intoneuronets:alphafrom
dhritimandas:alpha

Conversation

@dhritimandas
Copy link
Copy Markdown
Contributor

@dhritimandas dhritimandas commented Apr 10, 2026

Closes #374

Summary

  • DataSpec validation system: DataSpec dataclass with JSON serialization, validate() with symlink-aware file checks (DataLad/git-annex), spacing/orientation/label class validation, inspect_entry() for NIfTI/Zarr metadata. New CLI commands: validate, inspect, --skip-validate on predict/convert-to-zarr.
  • Croissant JSON-LD fix: Replace inline @context dicts with official Croissant 1.0 context (CROISSANT_CONTEXT constant), fix @type to sc:Dataset, add conformsTo and sha256 fields required by mlcroissant validation.
  • MPS Conv3D guard: Disable MPS backend in conftest.py when Conv3D is unsupported (PyTorch < 2.3 on Apple Silicon).
  • CLAUDE.md: Development guidelines (dependency constraints, MONAI-first rule, testing philosophy, review process).

Test plan

  • 394 unit tests pass (pytest nobrainer/tests/unit/ -m "not gpu")
  • 26 sr-tests pass (pytest nobrainer/sr-tests/ -m "not gpu")
  • python -c "import nobrainer" succeeds
  • Pre-commit hooks pass (black, flake8, isort, codespell)
  • CI unit tests
  • CI GPU tests

dhritimandas and others added 6 commits April 10, 2026 16:52
Add versioned dataset contract with DataLad-aware preflight validation:
- DataSpec dataclass with JSON serialization
- validate() with symlink-aware file checks, spacing/orientation/label validation
- inspect_entry() for NIfTI/Zarr metadata inspection
- CLI commands: validate, inspect, --skip-validate on predict/convert-to-zarr
- 33 unit tests covering all branches
- Replace inline @context dicts with CROISSANT_CONTEXT constant
- Change @type from cr:Dataset to sc:Dataset per Croissant 1.0 spec
- Add conformsTo and sha256 fields required by mlcroissant validation
- Update test assertions to match corrected @type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants