Validating empty array against spec should show better error #317
Labels
category: bug
errors in the code or code behavior
topic: validator
issues related to validation of files
If an attribute spec specifies a dtype text with or without a shape, and an empty numpy array is validated against that spec, the error returned is:
IndexError: index 0 is out of bounds for axis 0 with size 0
. This is not very helpful.Is an empty array allowed for
shape: None
(1D array with any length) ?To clarify, what should be the correct validation behavior for the following cases:
shape: None
anddtype: float
and test value is empty array with type float -- ShapeError?shape: None
anddtype: text
and test value is empty array with type float -- ShapeError and DtypeError?shape: None
anddtype: text
and test value is empty list -- ShapeError?dtype: text
and test value is empty array/list -- ShapeError?dtype: text
and test value is empty string -- OK?The text was updated successfully, but these errors were encountered: