bug: matplotlib update to remove deprecation warnings (FXC-4658)#3121
bug: matplotlib update to remove deprecation warnings (FXC-4658)#3121daquinteroflex wants to merge 2 commits intodevelopfrom
Conversation
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". |
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
|
b716b8f to
0409e8a
Compare
0409e8a to
1050cb9
Compare
Co-authored-by: yaugenst-flex <yannick@flexcompute.com>
1050cb9 to
b64b375
Compare
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.


Greptile Summary
This PR updates the
matplotlibdependency constraint from*(any version) to>=3.10.0to eliminate deprecation warnings when using newer matplotlib versions. The change only affects the dependency specification inpyproject.tomland the corresponding lock file - no code changes are required.Key changes:
matplotlibversion constraint to>=3.10.0inpyproject.toml:33poetry.lockwith new dependency resolutions (also includes updates toboto3,botocore,mistune,nbclient, andpyparsing)Issues identified:
b72c7231-b258-4d03-aed2-51a50a9fe757)Confidence Score: 5/5
Important Files Changed
matplotlibversion constraint from*to>=3.10.0to address deprecation warningsboto3,botocore,mistune,nbclient, andpyparsingSequence 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 resolvedContext used:
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_paramsto usempl.colormaps.get_cmap()instead of indexingmpl.colormaps[...].Relaxes the
matplotlibdependency constraint inpyproject.tomlto>=3.7.0,<4.0.0and updatespoetry.lockaccordingly (including a few minor transitive version/marker adjustments). Adds a towncrier entry inchangelog.d/3121.fixed.md.Written by Cursor Bugbot for commit c733029. This will update automatically on new commits. Configure here.