Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
BrunoWolf03 wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromBrunoWolf03:main
Open
Changes fromall 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 deletionslib/matplotlib/tri/_tricontour.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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
frommatplotlib._api.deprecationimportdelete_parameter
frommatplotlibimport_docstring
frommatplotlibimport_api,_docstring

By convention we import our interal helper modules this way.

from matplotlib.contour import ContourSet
from matplotlib.tri._triangulation import Triangulation
Expand DownExpand 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. Thefunc 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.

timhoffm reacted with thumbs up emoji
def tricontour(ax, *args, **kwargs):
"""
%(_tricontour_doc)s
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp