@@ -2176,12 +2176,12 @@ def _convert_dx(dx, x0, xconv, convert):
21762176 # removes the units from unit packages like `pint` that
21772177 # wrap numpy arrays.
21782178 try :
2179- x0 = cbook .safe_first_element (x0 )
2179+ x0 = cbook ._safe_first_non_none (x0 )
21802180 except (TypeError , IndexError , KeyError ):
21812181 pass
21822182
21832183 try :
2184- x = cbook .safe_first_element (xconv )
2184+ x = cbook ._safe_first_non_none (xconv )
21852185 except (TypeError , IndexError , KeyError ):
21862186 x = xconv
21872187
@@ -2779,11 +2779,11 @@ def broken_barh(self, xranges, yrange, **kwargs):
27792779 """
27802780 # process the unit information
27812781 if len (xranges ):
2782- xdata = cbook .safe_first_element (xranges )
2782+ xdata = cbook ._safe_first_non_none (xranges )
27832783 else :
27842784 xdata = None
27852785 if len (yrange ):
2786- ydata = cbook .safe_first_element (yrange )
2786+ ydata = cbook ._safe_first_non_none (yrange )
27872787 else :
27882788 ydata = None
27892789 self ._process_unit_info (
@@ -3424,10 +3424,10 @@ def _upcast_err(err):
34243424 # safe_first_element because getitem is index-first not
34253425 # location first on pandas objects so err[0] almost always
34263426 # fails.
3427- isinstance (cbook .safe_first_element (err ), np .ndarray )
3427+ isinstance (cbook ._safe_first_non_none (err ), np .ndarray )
34283428 ):
34293429 # Get the type of the first element
3430- atype = type (cbook .safe_first_element (err ))
3430+ atype = type (cbook ._safe_first_non_none (err ))
34313431 # Promote the outer container to match the inner container
34323432 if atype is np .ndarray :
34333433 # Converts using np.asarray, because data cannot
@@ -4290,7 +4290,7 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
42904290 c_is_string_or_strings = (
42914291 isinstance (c , str )
42924292 or (np .iterable (c ) and len (c ) > 0
4293- and isinstance (cbook .safe_first_element (c ), str )))
4293+ and isinstance (cbook ._safe_first_non_none (c ), str )))
42944294
42954295 def invalid_shape_exception (csize , xsize ):
42964296 return ValueError (
0 commit comments