isNotUnitDbl = True
ifnp.iterable(value) and not isinstance(value, str):
iflen(value)== 0:
return []
else:
return [UnitDblConverter.convert(x, unit, axis) for x in value]
// We need to check to see if the incoming value is actually a// UnitDbl and set a flag. If we get an empty list, then just// return an empty list.ifisinstance(value, U.UnitDbl):
isNotUnitDbl = False// If the incoming value behaves like a number, but is not a UnitDbl,// then just return it because we don"t know how to convert it// (or it is already converted)
After Change
// Delay-load due to circular dependencies.import matplotlib.testing.jpl_units as U
if not cbook.is_scalar_or_string(value):
return [UnitDblConverter.convert(x, unit, axis) for x in value]
// If the incoming value behaves like a number, but is not a UnitDbl,// then just return it because we don"t know how to convert it