Title: Warn on contour data with no variation by ProgrammerSannidhya · Pull Request #32645 · matplotlib/matplotlib · GitHub
Open Graph Title: Warn on contour data with no variation by ProgrammerSannidhya · Pull Request #32645 · matplotlib/matplotlib
X Title: Warn on contour data with no variation by ProgrammerSannidhya · Pull Request #32645 · matplotlib/matplotlib
Description: Fixes #31493 When contour or contourf is called with constant Z data and automatic contour levels, Matplotlib can generate repeated contour levels without providing a clear warning. This change adds a warning when the Z data has no variation (minimum and maximum values are equal) and contour levels are generated automatically. Explicitly provided contour levels are unaffected by this change. Tests have been added to verify that: Both contour and contourf issue a warning for constant Z data when levels are automatic. Neither function issues this new warning when levels are explicitly provided. AI Disclosure AI tools (ChatGPT and Codex) were used to assist with understanding the issue, exploring the codebase, implementation guidance, and reviewing the changes and tests. The final contribution and its behavior have been reviewed by me. PR quality check Use an expressive title. New and changed code is tested locally (tests were added, but could not be executed against the local checkout due to a Windows linker error). Plotting-related features are demonstrated in an example (N/A). New features and API changes have release notes (N/A; this is a bug fix without an API change). Documentation complies with general and docstring guidelines (N/A; no documentation changes were needed). Testing status: git diff --check passed. Syntax compilation passed. The original no-warning behavior was reproduced using Matplotlib 3.11.2. I could not run the new tests against this branch: the local editable build failed at the Windows linker step, so its compiled extension was unavailable. Review I reviewed the code and test changes, but could not verify the patched behavior locally. The PR’s CI checks are still running or failing; I’ll investigate the failures and update this PR as needed.
Open Graph Description: Fixes #31493 When contour or contourf is called with constant Z data and automatic contour levels, Matplotlib can generate repeated contour levels without providing a clear warning. This change add...
X Description: Fixes #31493 When contour or contourf is called with constant Z data and automatic contour levels, Matplotlib can generate repeated contour levels without providing a clear warning. This change add...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/32645
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2522c8eb-b0d0-fdfb-bf90-4a6660d94ca5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EB1E:107A1:1179616:173FC9C:6B065758 |
| html-safe-nonce | 1285b2e1b66f98982c0df398e59159566a1d44cb6c6cd5373caaa4f2c583f8d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjFFOjEwN0ExOjExNzk2MTY6MTczRkM5Qzo2QjA2NTc1OCIsInZpc2l0b3JfaWQiOiI0Njk0MDY0ODY2MzMwMTEwMzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c3e708ebd3521754f59b89ffe36d271857a1255061bee761bbafc1163017dc1e |
| hovercard-subject-tag | pull_request:5441258336 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/32645/files |
| twitter:image | https://avatars.githubusercontent.com/u/115368162?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/115368162?s=400&v=4 |
| og:image:alt | Fixes #31493 When contour or contourf is called with constant Z data and automatic contour levels, Matplotlib can generate repeated contour levels without providing a clear warning. This change add... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7f0aa75f4141d440c6110dc31af7ea7797abb6c4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width