Validator for DataArray
shapes
#665
Labels
ASDF
everything ASDF related (python + schemas)
validation
custom ASDF validators
xarray
issues related to handling xarray objects
Currently, we are using the
wx_shape
validator to ensure that certain dimensions have a specific size. For example, in theSpatialData
scheme we want the last dimension that represents space (by definition) to always have the size 3.This requires us to reorder the internal data of a DataArray during serialization or before to meet the requirements of the validator. This somehow ignores the benefit of a DataArray that all dimensions are named and directly accessible. So we should either expand the functionality of the
wx_shape
validator or (better I guess) introduce a new one that can handle dimension names too. The syntax can be close to thewx_shape
validator just with added dimension names like this:[..., c=3]
. This would express "any number of dimensions with arbitrary shape, but the dimensionc
must have shape(3,)
". This would also mean that there has to be a dimensionc
.[..., (c=3)]
would mean that the dimensionc
is optional, but if present, it has to be of size 3.The text was updated successfully, but these errors were encountered: