@@ -53,14 +53,14 @@ def draw(self, renderer: RendererBase):
5353
5454 # If we are working with a 3D object, swap out it's axes with
5555 # this zoom axes (swapping out the 3d transform) and reproject it.
56- if (hasattr (self ._artist , "do_3d_projection" )):
56+ if (hasattr (self ._artist , "do_3d_projection" )):
5757 self .do_3d_projection ()
5858
5959 # Check and see if the passed limiting box and extents of the
6060 # artist intersect, if not don't bother drawing this artist.
6161 # First 2 checks are a special case where we received a bad clip box.
6262 # (those can happen when we try to get the bounds of a map projection)
63- if (
63+ if (
6464 self ._clip_box .width == 0 or self ._clip_box .height == 0 or
6565 Bbox .intersection (full_extents , self ._clip_box ) is not None
6666 ):
@@ -128,7 +128,7 @@ class ViewSpecification:
128128
129129 def __post_init__ (self ):
130130 self .image_interpolation = str (self .image_interpolation )
131- if (self .filter_set is not None ):
131+ if (self .filter_set is not None ):
132132 self .filter_set = set (self .filter_set )
133133 self .scale_lines = bool (self .scale_lines )
134134
@@ -138,7 +138,6 @@ class __ViewType:
138138 PRIVATE: A simple identifier class for identifying view types, a view
139139 will inherit from the axes class it is wrapping and this type...
140140 """
141- ...
142141
143142
144143# Cache classes so grabbing the same type twice leads to actually getting the
@@ -162,7 +161,7 @@ def view_wrapper(axes_class: Type[Axes]) -> Type[Axes]:
162161 another axes contents...
163162 """
164163 # If the passed class is a view, simply return it.
165- if (issubclass (axes_class , Axes ) and issubclass (axes_class , __ViewType )):
164+ if (issubclass (axes_class , Axes ) and issubclass (axes_class , __ViewType )):
166165 return axes_class
167166
168167 class View (axes_class , __ViewType ):
@@ -228,14 +227,14 @@ def get_children(self) -> List[Artist]:
228227 child_list = super ().get_children ()
229228
230229 def filter_check (artist , filter_set ):
231- if (filter_set is None ):
230+ if (filter_set is None ):
232231 return True
233232 return (
234233 (artist not in filter_set )
235234 and (type (artist ) not in filter_set )
236235 )
237236
238- if (self .__renderer is not None ):
237+ if (self .__renderer is not None ):
239238 for ax , spec in self .view_specifications .items ():
240239 mock_renderer = _TransformRenderer (
241240 self .__renderer , ax .transData , self .transData ,
@@ -253,7 +252,7 @@ def filter_check(artist, filter_set):
253252 for a in itertools .chain (
254253 ax ._children ,
255254 ax .child_axes
256- ) if (filter_check (a , spec .filter_set ))
255+ ) if (filter_check (a , spec .filter_set ))
257256 ])
258257
259258 return child_list
@@ -262,7 +261,7 @@ def draw(self, renderer: RendererBase = None):
262261 # It is possible to have two axes which are views of each other
263262 # therefore we track the number of recursions and stop drawing
264263 # at a certain depth
265- if (self .figure ._current_render_depth >= self .__max_render_depth ):
264+ if (self .figure ._current_render_depth >= self .__max_render_depth ):
266265 return
267266 self .figure ._current_render_depth += 1
268267 # Set the renderer, causing get_children to return the view's
@@ -281,7 +280,7 @@ def __reduce__(self):
281280 cls = type (self )
282281
283282 args = tuple (
284- arg if (arg != cls ) else cls .__bases__ [0 ] for arg in args
283+ arg if (arg != cls ) else cls .__bases__ [0 ] for arg in args
285284 )
286285
287286 return (
@@ -318,7 +317,7 @@ def set_max_render_depth(self, val: int):
318317 allow. Zero and negative values are invalid, and will raise a
319318 ValueError.
320319 """
321- if (val <= 0 ):
320+ if (val <= 0 ):
322321 raise ValueError (f"Render depth must be positive, not { val } ." )
323322 self .__max_render_depth = val
324323
@@ -376,20 +375,20 @@ def from_axes(
376375 If the provided axes to convert has an Axes type which does
377376 not match the axes class this view type wraps.
378377 """
379- if (isinstance (axes , cls )):
380- if (render_depth is not None ):
378+ if (isinstance (axes , cls )):
379+ if (render_depth is not None ):
381380 axes .set_max_render_depth (render_depth )
382381 return axes
383382
384- if (type (axes ) != axes_class ):
383+ if (type (axes ) is not axes_class ):
385384 raise TypeError (
386385 f"Can't convert { type (axes ).__name__ } to { cls .__name__ } "
387386 )
388387
389388 axes .__class__ = cls
390389 axes ._init_vars (
391390 DEFAULT_RENDER_DEPTH
392- if (render_depth is None )
391+ if (render_depth is None )
393392 else render_depth
394393 )
395394 return axes
0 commit comments