Skip to content

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

Merged
ericspod merged 3 commits into
Project-MONAI:devfrom
aymuos15:perf/test-shrink-volumes
Oct 1, 2026
Merged

ericspod merged 3 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: Repository: Project-MONAI/MONAI/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b4636b2b-d466-4d24-8c7c-b5be6988ad6e

📥 Commits

Reviewing files that changed from the base of the PR and between 1f7bde9 and 21b5171.

📒 Files selected for processing (1)
  • tests/transforms/test_load_image.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The test suite now uses smaller image volumes in dataset and image-loading tests. Expected shapes and metadata fixtures were updated. The mapping-file test uses 16×16×16 volumes. Existing test coverage remains in place.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to 21b51

The test fixtures use smaller volumes without an identified mismatch in the affected test operations. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the performance-focused reduction of synthetic volumes in image-loading and dataset tests.
Description check ✅ Passed The description explains the fixture changes, affected files, unchanged test logic, and change type. It omits the template's Fixes #... issue reference, but the required change details are otherwise…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

ericspod
ericspod previously approved these changes Oct 1, 2026
@ericspod
ericspod enabled auto-merge (squash) October 1, 2026 14:51
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
@ericspod
ericspod disabled auto-merge October 1, 2026 15:51
@ericspod
ericspod merged commit 20a9632 into Project-MONAI:dev Oct 1, 2026
30 checks passed
@aymuos15
aymuos15 deleted the perf/test-shrink-volumes branch October 6, 2026 16:17
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