@@ -2179,12 +2179,12 @@ def _convert_dx(dx, x0, xconv, convert):
2179
2179
# removes the units from unit packages like `pint` that
2180
2180
# wrap numpy arrays.
2181
2181
try :
2182
- x0 = cbook ._safe_first_non_none (x0 )
2182
+ x0 = cbook ._safe_first_finite (x0 )
2183
2183
except (TypeError , IndexError , KeyError ):
2184
2184
pass
2185
2185
2186
2186
try :
2187
- x = cbook ._safe_first_non_none (xconv )
2187
+ x = cbook ._safe_first_finite (xconv )
2188
2188
except (TypeError , IndexError , KeyError ):
2189
2189
x = xconv
2190
2190
@@ -2813,11 +2813,11 @@ def broken_barh(self, xranges, yrange, **kwargs):
2813
2813
"""
2814
2814
# process the unit information
2815
2815
if len (xranges ):
2816
- xdata = cbook ._safe_first_non_none (xranges )
2816
+ xdata = cbook ._safe_first_finite (xranges )
2817
2817
else :
2818
2818
xdata = None
2819
2819
if len (yrange ):
2820
- ydata = cbook ._safe_first_non_none (yrange )
2820
+ ydata = cbook ._safe_first_finite (yrange )
2821
2821
else :
2822
2822
ydata = None
2823
2823
self ._process_unit_info (
@@ -3459,10 +3459,10 @@ def _upcast_err(err):
3459
3459
# safe_first_element because getitem is index-first not
3460
3460
# location first on pandas objects so err[0] almost always
3461
3461
# fails.
3462
- isinstance (cbook ._safe_first_non_none (err ), np .ndarray )
3462
+ isinstance (cbook ._safe_first_finite (err ), np .ndarray )
3463
3463
):
3464
3464
# Get the type of the first element
3465
- atype = type (cbook ._safe_first_non_none (err ))
3465
+ atype = type (cbook ._safe_first_finite (err ))
3466
3466
# Promote the outer container to match the inner container
3467
3467
if atype is np .ndarray :
3468
3468
# Converts using np.asarray, because data cannot
@@ -4325,7 +4325,7 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
4325
4325
c_is_string_or_strings = (
4326
4326
isinstance (c , str )
4327
4327
or (np .iterable (c ) and len (c ) > 0
4328
- and isinstance (cbook ._safe_first_non_none (c ), str )))
4328
+ and isinstance (cbook ._safe_first_finite (c ), str )))
4329
4329
4330
4330
def invalid_shape_exception (csize , xsize ):
4331
4331
return ValueError (
0 commit comments