8000 Use deprecate_privatize_attribute more. by anntzer · Pull Request #17301 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Use deprecate_privatize_attribute more. #17301

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

Merged
merged 1 commit into from
May 2, 2020
Merged
Show file tree
Hide file tree
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
11 changes: 2 additions & 9 deletions lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,8 @@ class MovieWriter(AbstractMovieWriter):
# stored. Third-party writers cannot meaningfully set these as they cannot
# extend rcParams with new keys.

@cbook.deprecated("3.3")
@property
def exec_key(self):
return self._exec_key

@cbook.deprecated("3.3")
@property
def args_key(self):
return self._args_key
exec_key = cbook._deprecate_privatize_attribute("3.3")
args_key = cbook._deprecate_privatize_attribute("3.3")

def __init__(self, fps=5, codec=None, bitrate=None, extra_args=None,
metadata=None):
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,7 @@ def __init__(self, figure, fh, dummy=False):
if m.startswith("draw_"):
self.__dict__[m] = lambda *args, **kwargs: None

@cbook.deprecated("3.2")
@property
def latexManager(self):
return self._latexManager
latexManager = cbook._deprecate_privatize_attribute("3.2")

def draw_markers(self, gc, marker_path, marker_trans, path, trans,
rgbFace=None):
Expand Down
6 changes: 2 additions & 4 deletions lib/matplotlib/backends/backend_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,8 @@ def __init__(self, canvas, parent, coordinates=True):

NavigationToolbar2.__init__(self, canvas)

@cbook.deprecated("3.3", alternative="self.canvas.parent()")
@property
def parent(self):
return self._parent
parent = cbook._deprecate_privatize_attribute(
"3.3", alternative="self.canvas.parent()")

@cbook.deprecated(
"3.3", alternative="os.path.join(mpl.get_data_path(), 'images')")
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,7 @@ def changed(self):
self._update_dict[key] = True
self.stale = True

@cbook.deprecated("3.3")
@property
def update_dict(self):
return self._update_dict
update_dict = cbook._deprecate_privatize_attribute("3.3")

@cbook.deprecated("3.3")
def add_checker(self, checker):
Expand Down
10 changes: 2 additions & 8 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,7 @@ def _check_unsampled_image(self):
"""Return False. Do not use unsampled image."""
return False

@cbook.deprecated("3.3")
@property
def is_grayscale(self):
return self._is_grayscale
is_grayscale = cbook._deprecate_privatize_attribute("3.3")

def make_image(self, renderer, magnification=1.0, unsampled=False):
# docstring inherited
Expand Down Expand Up @@ -1144,10 +1141,7 @@ def __init__(self, ax,
if A is not None:
self.set_data(x, y, A)

@cbook.deprecated("3.3")
@property
def is_grayscale(self):
return self._is_grayscale
is_grayscale = cbook._deprecate_privatize_attribute("3.3")

def make_image(self, renderer, magnification=1.0, unsampled=False):
# docstring inherited
Expand Down
5 changes: 1 addition & 4 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,7 @@ def __init__(self, patch, ox, oy, props=None, **kwargs):
self._shadow_transform = transforms.Affine2D()
self._update()

@cbook.deprecated("3.3")
@property
def props(self):
return self._props
props = cbook._deprecate_privatize_attribute("3.3")

def _update(self):
self.update_from(self.patch)
Expand Down
13 changes: 4 additions & 9 deletions lib/mpl_toolkits/axes_grid1/axes_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,10 @@ def colorbar(self, mappable, *, ticks=None, **kwargs):
self._config_axes()
return cb

@cbook.deprecated("3.3", alternative="mappable.colorbar_cid")
@property
def cbid(self):
return self._cbid

@cbook.deprecated("3.3", alternative=".colorbar().locator")
@property
def locator(self):
return self._locator
cbid = cbook._deprecate_privatize_attribute(
"3.3", alternative="mappable.colorbar_cid")
locator = cbook._deprecate_privatize_attribute(
"3.3", alternative=".colorbar().locator")

def _config_axes(self):
"""Make an axes patch and outline."""
Expand Down
0