Limit, remove or make validation optional
Closed this issue · 1 comments
Some validation can be quite costly – is_observation_sequences
being the big offender by iterating through the provided sequences to check types and dimensions.
Other validation can be very strict, e.g. only supporting Numpy array inputs for most things rather than trying to duck type.
The current use of validation (via the _Validator
class) feels very anti-pythonic. At the very minimum, we should try to limit the validation, remove some of it, or maybe make it optional. This could be achieved by passing a boolean validate
parameter to the _Validator
and updating any instance methods in that class so that validation is only performed when validate
is true, though this is also an odd approach.
Switched to Pydantic.