@@ -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
@@ -2813,11 +2813,11 @@ def broken_barh(self, xranges, yrange, **kwargs):
28132813 """
28142814 # process the unit information
28152815 if len (xranges ):
2816- xdata = cbook ._safe_first_non_none (xranges )
2816+ xdata = cbook ._safe_first_finite (xranges )
28172817 else :
28182818 xdata = None
28192819 if len (yrange ):
2820- ydata = cbook ._safe_first_non_none (yrange )
2820+ ydata = cbook ._safe_first_finite (yrange )
28212821 else :
28222822 ydata = None
28232823 self ._process_unit_info (
@@ -3459,10 +3459,10 @@ def _upcast_err(err):
34593459 # safe_first_element because getitem is index-first not
34603460 # location first on pandas objects so err[0] almost always
34613461 # fails.
3462- isinstance (cbook ._safe_first_non_none (err ), np .ndarray )
3462+ isinstance (cbook ._safe_first_finite (err ), np .ndarray )
34633463 ):
34643464 # Get the type of the first element
3465- atype = type (cbook ._safe_first_non_none (err ))
3465+ atype = type (cbook ._safe_first_finite (err ))
34663466 # Promote the outer container to match the inner container
34673467 if atype is np .ndarray :
34683468 # Converts using np.asarray, because data cannot
@@ -4325,7 +4325,7 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
43254325 c_is_string_or_strings = (
43264326 isinstance (c , str )
43274327 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 )))
43294329
43304330 def invalid_shape_exception (csize , xsize ):
43314331 return ValueError (
0 commit comments