Skip to content

Tweak argument checking in tripcolor(). - #22883

Merged
oscargus merged 1 commit into
matplotlib:mainfrom
anntzer:tca
Apr 24, 2022
Merged

oscargus merged 1 commit into
matplotlib:mainfrom
anntzer:tca

Conversation

@anntzer

@anntzer anntzer commented Apr 23, 2022 •

Copy link
Copy Markdown
Contributor

For incorrect number of parameters, switch to raising a (standard)
TypeError and use a standard-ish signature mismatch error message. Note
that exception type stability was already broken in 3.6 because it was
previously an IndexError (that was triggered later) and 703b574 changed
that to a ValueError.

Also deprecate support for passing extra parameters (as we now tend to
do for all such overly accepting APIs). Note that the changelog entry
states that such parameters were previously silently ignored, even
though the patch replaces a warn_external() by a warn_deprecated(); this
is simply because the warn_external() wasn't present yet in the last
released version.

Also closes #22882.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@anntzer anntzer added the API: argument checking Validation of acceptable argument values label Apr 23, 2022
@anntzer anntzer added this to the v3.6.0 milestone Apr 23, 2022
For incorrect number of parameters, switch to raising a (standard)
TypeError and use a standard-ish signature mismatch error message.  Note
that exception type stability was already broken in 3.6 because it was
previously an IndexError (that was triggered later) and 703b574 changed
that to a ValueError.

Also deprecate support for passing extra parameters (as we now tend to
do for all such overly accepting APIs).  Note that the changelog entry
states that such parameters were previously silently ignored, even
though the patch replaces a warn_external() by a warn_deprecated(); this
is simply because the warn_external() wasn't present yet in the last
released version.

@oscargus oscargus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we merge #22884 for 3.5.2 and this for 3.6.0?

(Feel free to merge once decided.)

@anntzer

anntzer commented Apr 24, 2022

Copy link
Copy Markdown
Contributor Author

No, because #22356 was targeted to 3.6 to start with.

@oscargus

Copy link
Copy Markdown
Member

Ahh, good point! Just noted that #22884 was marked as 3.5.2, but then that is not a good idea!

@oscargus
oscargus merged commit e142894 into matplotlib:main Apr 24, 2022
@anntzer
anntzer deleted the tca branch April 24, 2022 12:27
davidgegiya added a commit to davidgegiya/agent-orchestrator that referenced this pull request Nov 8, 2026
Pin e0773948af38c8c5123fda0d90cf40140d8b020c and its regression selectors for reproducible runs.

Source: matplotlib/matplotlib#22883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: argument checking Validation of acceptable argument values

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing f prefix on f-strings

3 participants