Shape validation using variable names not working
As reported by Aaron Schüller-Ruhl, there seems to be a problem in handling shape constraints which refer to variables in a schema. E.g. the following schema
number_of_substrates = Quantity(
type=int,
a_eln=dict(component='NumberEditQuantity'))
substrate_ids = Quantity(
type=np.dtype(int),
shape=['number_of_substrates'],
a_eln=dict(component='NumberEditQuantity'))
Should trigger exceptions/warnings if subtrate_ids has more elements than defined in number_of_substrates
, but currently this does not seem to happen.
Also we have to take into account different scenarios:
-
number_of_substrates < len(substrate_ids)
: How do we deal with data that does not comply with the shape? - If
number_of_substrates
is not set, do we print out a warning when settingsubstrate_ids
? - Does a validation error cause a full stop of the processing...? This would mean that errors can cause data to be dropped out.