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

Skip to content

Commit c06b6bb

Browse files
committed
Update deprecation notices and restore "Exception" to except conditions.
1 parent 058288a commit c06b6bb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/matplotlib/axis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ def __init__(self, axes, pickradius=15):
713713
self.callbacks = cbook.CallbackRegistry()
714714

715715
self._autolabelpos = True
716-
self._smart_bounds = False # Deprecated in 3.0
716+
self._smart_bounds = False # Deprecated in 3.1
717717

718718
self.label = self._get_label()
719719
self.labelpad = rcParams['axes.labelpad']
@@ -1003,13 +1003,13 @@ def get_ticklabel_extents(self, renderer):
10031003
bbox2 = mtransforms.Bbox.from_extents(0, 0, 0, 0)
10041004
return bbox, bbox2
10051005

1006-
@cbook.deprecated("3.0")
1006+
@cbook.deprecated("3.1")
10071007
def set_smart_bounds(self, value):
10081008
"""set the axis to have smart bounds"""
10091009
self._smart_bounds = value
10101010
self.stale = True
10111011

1012-
@cbook.deprecated("3.0")
1012+
@cbook.deprecated("3.1")
10131013
def get_smart_bounds(self):
10141014
"""get whether the axis has smart bounds"""
10151015
return self._smart_bounds
@@ -1024,7 +1024,7 @@ def _update_ticks(self, renderer=None):
10241024
if renderer is not None:
10251025
cbook.warn_deprecated("Axis._update_ticks should be called with"
10261026
" no arguments; the 'renderer' argument"
1027-
" is ignored and will be removed in 3.1")
1027+
" is ignored and will be removed in 3.2")
10281028
interval = self.get_view_interval()
10291029
tick_tups = list(self.iter_ticks()) # iter_ticks calls the locator
10301030
if self._smart_bounds and tick_tups: # _smart_bounds is deprecated
@@ -1081,7 +1081,7 @@ def _update_ticks(self, renderer=None):
10811081
try:
10821082
ds1 = self._get_pixel_distance_along_axis(
10831083
interval_expanded[0], -0.0005)
1084-
except:
1084+
except Exception:
10851085
warnings.warn("Unable to find pixel distance along axis "
10861086
"for interval padding of ticks; assuming no "
10871087
"interval padding needed.")
@@ -1091,7 +1091,7 @@ def _update_ticks(self, renderer=None):
10911091
try:
10921092
ds2 = self._get_pixel_distance_along_axis(
10931093
interval_expanded[1], +0.0005)
1094-
except:
1094+
except Exception:
10951095
warnings.warn("Unable to find pixel distance along axis "
10961096
"for interval padding of ticks; assuming no "
10971097
"interval padding needed.")

lib/matplotlib/spines.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self, axes, spine_type, path, **kwargs):
5858
self.set_transform(self.axes.transData) # default transform
5959

6060
self._bounds = None # default bounds
61-
self._smart_bounds = False # deprecated in 3.0
61+
self._smart_bounds = False # deprecated in 3.1
6262

6363
# Defer initial position determination. (Not much support for
6464
# non-rectangular axes is currently implemented, and this lets
@@ -81,7 +81,7 @@ def __init__(self, axes, spine_type, path, **kwargs):
8181
# Note: This cannot be calculated until this is added to an Axes
8282
self._patch_transform = mtransforms.IdentityTransform()
8383

84-
@cbook.deprecated("3.0")
84+
@cbook.deprecated("3.1")
8585
def set_smart_bounds(self, value):
8686
"""set the spine and associated axis to have smart bounds"""
8787
self._smart_bounds = value
@@ -93,7 +93,7 @@ def set_smart_bounds(self, value):
9393
self.axes.xaxis.set_smart_bounds(value)
9494
self.stale = True
9595

96-
@cbook.deprecated("3.0")
96+
@cbook.deprecated("3.1")
9797
def get_smart_bounds(self):
9898
"""get whether the spine has smart bounds"""
9999
return self._smart_bounds
@@ -218,7 +218,7 @@ def _adjust_location(self):
218218
raise ValueError('unknown spine spine_type: %s' %
219219
self.spine_type)
220220

221-
if self._smart_bounds: # deprecated in 3.0
221+
if self._smart_bounds: # deprecated in 3.1
222222
# attempt to set bounds in sophisticated way
223223

224224
# handle inverted limits

0 commit comments

Comments
 (0)