You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the type of a variable is numpy.ndarray (usually from something like np.array(2)), the tests in validate_argument fail.
This could be fixed by improving:
def _is_valid(arg, valid_type):
if valid_type == "function":
return callable(arg)
if (valid_type in ("int_array", "float_array") and np.iterable(arg)):
return isinstance(arg[0], _valid_types[valid_type])
if isinstance(arg, np.ndarray):
if (valid_type in (int, "int_array")):
return arg.dtype.char in np.typecodes['AllInteger']
if (valid_type in (float, "float_array")):
return arg.dtype.char in np.typecodes['AllFloat']
return False
return isinstance(arg, _valid_types.get(valid_type, valid_type))
The text was updated successfully, but these errors were encountered:
When the type of a variable is
numpy.ndarray
(usually from something likenp.array(2)
), the tests invalidate_argument
fail.This could be fixed by improving:
The text was updated successfully, but these errors were encountered: