Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecate unused 'origin' and 'extent' in tricontour and tricontour #30028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/matplotlib/tri/_tricontour.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np

from matplotlib._api.deprecation import delete_parameter

Check warning on line 3 in lib/matplotlib/tri/_tricontour.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/tri/_tricontour.py#L3

Added line #L3 was not covered by tests
from matplotlib import _docstring
Comment on lines +3 to 4
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from matplotlib._api.deprecation import delete_parameter
from matplotlib import _docstring
from matplotlib import _api, _docstring

By convention we import our interal helper modules this way.

from matplotlib.contour import ContourSet
from matplotlib.tri._triangulation import Triangulation
Expand Down Expand Up @@ -219,6 +220,9 @@

@_docstring.Substitution(func='tricontour', type='lines')
@_docstring.interpd
@delete_parameter("3.9", "tricontour", "origin")
@delete_parameter("3.9", "tricontour", "extent")

Check warning on line 224 in lib/matplotlib/tri/_tricontour.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/tri/_tricontour.py#L223-L224

Added lines #L223 - L224 were not covered by tests

Comment on lines +223 to +225
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@delete_parameter("3.9", "tricontour", "origin")
@delete_parameter("3.9", "tricontour", "extent")
@_api.delete_parameter("3.9", "origin")
@_api.delete_parameter("3.9", "extent")

This is how you'd use the decorator. The func parameter is not passed in explicitly but comes from the decoration.

That said, I'm not sure whether the decorator works for parameters passed via **kwargs.

Copy link
Member

Choose a reason for hiding this comment

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

Also, "3.9" should be replaced with the version it is deprecated in (right now it looks like "3.11").

Copy link
Member

Choose a reason for hiding this comment

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

That said, I'm not sure whether the decorator works for parameters passed via **kwargs.

It's fine in **kwargs, at least by documentation.

def tricontour(ax, *args, **kwargs):
"""
%(_tricontour_doc)s
Expand Down
Loading