@@ -2179,12 +2179,12 @@ def _convert_dx(dx, x0, xconv, convert):
21792179 # removes the units from unit packages like `pint` that
21802180 # wrap numpy arrays.
21812181 try :
2182- x0 = cbook ._safe_first_non_none (x0 )
2182+ x0 = cbook ._safe_first_finite (x0 )
21832183 except (TypeError , IndexError , KeyError ):
21842184 pass
21852185
21862186 try :
2187- x = cbook ._safe_first_non_none (xconv )
2187+ x = cbook ._safe_first_finite (xconv )
21882188 except (TypeError , IndexError , KeyError ):
21892189 x = xconv
21902190
@@ -2829,11 +2829,11 @@ def broken_barh(self, xranges, yrange, **kwargs):
28292829 """
28302830 # process the unit information
28312831 if len (xranges ):
2832- xdata = cbook ._safe_first_non_none (xranges )
2832+ xdata = cbook ._safe_first_finite (xranges )
28332833 else :
28342834 xdata = None
28352835 if len (yrange ):
2836- ydata = cbook ._safe_first_non_none (yrange )
2836+ ydata = cbook ._safe_first_finite (yrange )
28372837 else :
28382838 ydata = None
28392839 self ._process_unit_info (
@@ -3475,10 +3475,10 @@ def _upcast_err(err):
34753475 # safe_first_element because getitem is index-first not
34763476 # location first on pandas objects so err[0] almost always
34773477 # fails.
3478- isinstance (cbook ._safe_first_non_none (err ), np .ndarray )
3478+ isinstance (cbook ._safe_first_finite (err ), np .ndarray )
34793479 ):
34803480 # Get the type of the first element
3481- atype = type (cbook ._safe_first_non_none (err ))
3481+ atype = type (cbook ._safe_first_finite (err ))
34823482 # Promote the outer container to match the inner container
34833483 if atype is np .ndarray :
34843484 # Converts using np.asarray, because data cannot
@@ -4341,7 +4341,7 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
43414341 c_is_string_or_strings = (
43424342 isinstance (c , str )
43434343 or (np .iterable (c ) and len (c ) > 0
4344- and isinstance (cbook ._safe_first_non_none (c ), str )))
4344+ and isinstance (cbook ._safe_first_finite (c ), str )))
43454345
43464346 def invalid_shape_exception (csize , xsize ):
43474347 return ValueError (
0 commit comments