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
There are numerous places in alibi-detect where we type hint method arguments with the rather generic np.ndarray, but actually only expect certain dtypes. For example the upcoming FET detectors, and SpectralResidual (see #382). This could be dealt with purely through a little more documentation, but it might also be advantageous to explore more granular type hints.
Yea unfortunately we can't just update to numpy>=1.21 and there also doesn't seem to be a backport of these new numpy types. I think it might be a good use case of beartype validators.
There are numerous places in alibi-detect where we type hint method arguments with the rather generic
np.ndarray
, but actually only expect certain dtypes. For example the upcoming FET detectors, andSpectralResidual
(see #382). This could be dealt with purely through a little more documentation, but it might also be advantageous to explore more granular type hints.The above is related to SeldonIO/alibi#513 and SeldonIO/alibi#511, or we could use numpy's inbuilt capability (https://numpy.org/doc/1.21/reference/typing.html#numpy.typing.NDArray for dtypes, and at some point numpy/numpy#16544 for shapes). The latter would however cause issues with old numpy version compatibility.
The text was updated successfully, but these errors were encountered: