Skip to content

Make contour grouping matplotlylib tests version-aware - #5799

Merged
camdecoster merged 1 commit into
plotly:mainfrom
robertoffmoura:rm/relax-contour-grouping-tests
Oct 8, 2026
Merged

camdecoster merged 1 commit into
plotly:mainfrom
robertoffmoura:rm/relax-contour-grouping-tests

Conversation

@robertoffmoura

Copy link
Copy Markdown
Contributor

Following up from #5794

Two tests in matplotlylib's test_renderer are failing on matplotlib version 3.7.5:

  • test_mixed_style_lines_group_consecutive_matches
  • test_consecutive_same_style_lines_grouped_into_one_trace

matplotlib 3.8 changed how ax.contour exposes its levels. older versions build one line collection per level, while 3.8+ builds a single collection holding all levels. The grouping tests added in #5770 assert that consecutive same-style paths end up in a single trace, which only happens with the single-collection layout. The converted figure is identical on both versions, only the number of traces differs.

Instead of increasing the complexity of the code to enforce similar behaviour of contour grouping on an older matplotlib version, relaxing the test assertions on the older matplotlib version seems like a better approach.

@camdecoster camdecoster added the no-changelog A changelog entry is not required for this PR label Oct 8, 2026
@camdecoster
camdecoster merged commit d18c2d2 into plotly:main Oct 8, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog A changelog entry is not required for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants