Repository navigation
test: preserve image baselines across Matplotlib text renderers - #9201
Draft
agourakis82 wants to merge 2 commits into
Draft
agourakis82 wants to merge 2 commits into
agourakis82 wants to merge 2 commits into
Conversation
Matplotlib 3.11 changes text rendering, so references must track renderer generations without weakening image comparisons. Related to Project-MONAI#9069. Assisted-by: OpenAI Codex Signed-off-by: Demetrios Agourakis <demetrios@agourakis.med.br>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Register the optional-dependency test module alongside test_matshow3d in the minimal-suite exclusion list, as required by CONTRIBUTING.md. Verified one unique exclusion entry, an existing target module, and git diff --check. This does not change the rendering code or references. Assisted-by: OpenAI Codex Signed-off-by: Demetrios Agourakis <demetrios@agourakis.med.br>
This branch has not been deployed
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.
Related to #9069.
Problem
With Matplotlib 3.11.2, the image comparisons in
ThreadContainer.test_plotand threematshow3dcases fail against the existing reference PNGs. This patch selects references by renderer generation while keeping the existing comparison tolerances and legacy references.Changes
get_matplotlib_baseline()to select the existing references before Matplotlib 3.11 and a separatematplotlib_3_11directory from3.11.0.dev0onward.test_samplesRMS expectation only for the legacy reference; the modern reference must satisfy the normal image comparison.Validation and scope
On 2026-10-24, a fresh Ubuntu 24.04 / CPython 3.12.3 environment with Torch 2.8.0, torchvision 0.23.0 and Matplotlib 3.11.2 reproduced the four affected image failures. The native MONAI extension was built and imported, and dependency checks passed.
The command selected the zarr merger, FID, threadcontainer and matshow3d test modules:
tests.test_matplotlib_baselineto the command: 34 tests passed, with no skips.9cbaeadfda56acc8e8a6cf973a59cf28e9a6ffd7. The follow-up changes only the minimal-suite exclusion list.This execution used a private composition based on #9140 at
4043f3bd332bf4867fe5a3ac80abb5257841a2c9, with a separate CI experiment, followed by the exact renderer patch. It is focused regression evidence, not a hosted-CI or complete-suite result for this standalone PR. The follow-up minimal-suite exclusion was checked for a unique entry and an existing module; the rendering tests were not rerun for that registration change. Hosted workflow approval remains a separate gate.Remaining draft item: reference distribution
The current draft commits the four PNGs directly.
CONTRIBUTING.mdasks contributors to host binary test data outside the source repository, preferably inMONAI-extra-test-datareleases, and reference it throughtests/testing_data/data_config.json.The references need to be moved to that distribution path before this draft is ready. Could these four files be hosted in a
MONAI-extra-test-datarelease so the tests can use the project's download helpers?Types of changes
Technical summary prepared with OpenAI Codex assistance.