Skip to content

bug: matplotlib update to remove deprecation warnings (FXC-4658)#3121

Open
daquinteroflex wants to merge 2 commits intodevelopfrom
dario/matplotlib_update
Open

bug: matplotlib update to remove deprecation warnings (FXC-4658)#3121
daquinteroflex wants to merge 2 commits intodevelopfrom
dario/matplotlib_update

Conversation

@daquinteroflex
Copy link
Collaborator

@daquinteroflex daquinteroflex commented Dec 23, 2025

Greptile Summary

This PR updates the matplotlib dependency constraint from * (any version) to >=3.10.0 to eliminate deprecation warnings when using newer matplotlib versions. The change only affects the dependency specification in pyproject.toml and the corresponding lock file - no code changes are required.

Key changes:

  • Updated matplotlib version constraint to >=3.10.0 in pyproject.toml:33
  • Updated poetry.lock with new dependency resolutions (also includes updates to boto3, botocore, mistune, nbclient, and pyparsing)

Issues identified:

  • Check that a changelog entry is added for this bug fix, as per the repository's custom instructions (rule b72c7231-b258-4d03-aed2-51a50a9fe757)

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a straightforward dependency version constraint update
  • Score of 5 reflects that this is a low-risk dependency update that only adds a minimum version constraint (not breaking changes), follows semantic versioning best practices, and requires no code modifications. The only concern is a missing changelog entry per repository guidelines.
  • No files require special attention - the changes are standard dependency updates

Important Files Changed

Filename Overview
pyproject.toml Updated matplotlib version constraint from * to >=3.10.0 to address deprecation warnings
poetry.lock Updated lock file with new dependency versions including boto3, botocore, mistune, nbclient, and pyparsing

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant PyPrj as pyproject.toml
    participant Poetry as Poetry Lock
    participant MatPlot as Matplotlib (>=3.10.0)
    
    Dev->>PyPrj: Update matplotlib constraint<br/>from "*" to ">=3.10.0"
    Dev->>Poetry: Run poetry lock
    Poetry->>MatPlot: Resolve matplotlib >=3.10.0
    Poetry->>Poetry: Update dependency hashes
    Note over Poetry: Also updates:<br/>boto3, botocore, mistune,<br/>nbclient, pyparsing
    Poetry-->>Dev: Lock file updated
    Note over Dev,MatPlot: Matplotlib 3.10.0+ deprecation<br/>warnings resolved
Loading

Context used:

  • Rule from dashboard - Require a changelog entry for any PR that is not purely an internal refactor. (source)

Note

Low Risk
Small, localized visualization change plus dependency constraint/lockfile updates; minimal behavioral impact outside plotting and packaging.

Overview
Fixes a matplotlib deprecation warning in scene permittivity plotting by switching Scene._get_structure_eps_plot_params to use mpl.colormaps.get_cmap() instead of indexing mpl.colormaps[...].

Relaxes the matplotlib dependency constraint in pyproject.toml to >=3.7.0,<4.0.0 and updates poetry.lock accordingly (including a few minor transitive version/marker adjustments). Adds a towncrier entry in changelog.d/3121.fixed.md.

Written by Cursor Bugbot for commit c733029. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link

greptile-apps bot commented Dec 23, 2025

Greptile's behavior is changing!

From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@daquinteroflex daquinteroflex changed the title bug: matplotlib update to remove deprecation warnings bug: matplotlib update to remove deprecation warnings (FXC-4658) Dec 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2025

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/components/scene.py (100%)

Summary

  • Total: 1 line
  • Missing: 0 lines
  • Coverage: 100%

@yaugenst-flex yaugenst-flex force-pushed the dario/matplotlib_update branch 2 times, most recently from b716b8f to 0409e8a Compare February 23, 2026 13:20
@yaugenst-flex yaugenst-flex force-pushed the dario/matplotlib_update branch from 0409e8a to 1050cb9 Compare February 23, 2026 13:21
Co-authored-by: yaugenst-flex <yannick@flexcompute.com>
@yaugenst-flex yaugenst-flex force-pushed the dario/matplotlib_update branch from 1050cb9 to b64b375 Compare February 23, 2026 13:22
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if mpl is not None:
cmap_name = _get_colormap(reverse=reverse)
cmap = mpl.colormaps[cmap_name]
cmap = mpl.colormaps.get_cmap(cmap_name)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incompatible API used with relaxed minimum version constraint

Medium Severity

The minimum matplotlib version was lowered from 3.10.0 to 3.7.0, but the code was simultaneously changed from mpl.colormaps[cmap_name] (bracket access, available since 3.5) to mpl.colormaps.get_cmap(cmap_name). The ColormapRegistry.get_cmap() method was not part of the original ColormapRegistry API introduced in 3.5 (which only had __getitem__ and register). Users with matplotlib versions between 3.7.0 and wherever get_cmap() was added would get an AttributeError. The bracket notation mpl.colormaps[cmap_name] is equally non-deprecated and compatible with all versions since 3.5.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

3 participants