Skip to content

Perf(test): shrink synthetic volumes in image loading and dataset tests - #9034

Open
aymuos15 wants to merge 2 commits into
Project-MONAI:devfrom
aymuos15:perf/test-shrink-volumes
Open

Perf(test): shrink synthetic volumes in image loading and dataset tests#9034
aymuos15 wants to merge 2 commits into
Project-MONAI:devfrom
aymuos15:perf/test-shrink-volumes

Conversation

@aymuos15

@aymuos15 aymuos15 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Shrinks the synthetic volumes these six test files generate, so each test still exercises the same code paths in a fraction of the runtime. Pure test-fixture change: no production code touched, no test logic altered:

  • tests/transforms/test_load_image.py, tests/transforms/test_load_imaged.py: 128³ volumes → 32³; multi-image cases 3×128³ → 3×32³; the 384×128³ channel-dim case scales to 96×32³.
  • tests/data/test_arraydataset.py, test_cachedataset.py, test_dataset.py: 128³ → 32³; the Spacing case 64×64×33 → 16×16×9.
  • tests/data/test_mapping_file.py: 128³ → 16³.

The 128³ sizes were an unexamined default; nothing depends on the magnitude, only that shapes round-trip through .nii.gz I/O. Expected shapes were updated in lockstep, so the assertions still verify the same behaviour.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

…ts (Project-MONAI#9034)

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
@aymuos15
aymuos15 force-pushed the perf/test-shrink-volumes branch from 22d45da to 6cb74f7 Compare July 31, 2026 16:49
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ea39420-f440-41f2-85fe-bb02cfa775b5

📥 Commits

Reviewing files that changed from the base of the PR and between 8690ae7 and 1f7bde9.

📒 Files selected for processing (6)
  • tests/data/test_arraydataset.py
  • tests/data/test_cachedataset.py
  • tests/data/test_dataset.py
  • tests/data/test_mapping_file.py
  • tests/transforms/test_load_image.py
  • tests/transforms/test_load_imaged.py

📝 Walkthrough

Walkthrough

The test suite now generates smaller 32³ image volumes for dataset and image-loading tests. Expected shapes and metadata fixtures were updated accordingly. The mapping-file test uses 16³ volumes. Coverage for transforms, labels, metadata, readers, channel dimensions, caching, and DataLoader batching remains unchanged.

Estimated code review effort: 2 (Simple) | ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the performance-focused reduction of synthetic test volumes.
Description check ✅ Passed The description explains the fixture changes, affected files, preserved behavior, and applicable change type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant