PyContracts is a Python package that allows to declare constraints on function parameters and return values. Contracts can be specified using Python3 annotations, or inside a docstring. PyContracts supports a basic type system, variables binding, arithmetic constraints, and has several specialized contracts and an extension API.
First of all, I want to thank you for this project. This is really great work and design. I'm using it to develop satellite data processing pipelines at NASA Goddard.
Currently, using 'object' as a data type is not supported. A NumPy array with a datatype 'object' holds references to Python objects. Sometimes, it is useful to have a numpy array of object: unlike a list, a numpy object array can support multiple dimensions and advanced slicing.
This is a feature request to add the 'object' datatype to the contract specification for numpy arrays.
First of all, I want to thank you for this project. This is really great work and design. I'm using it to develop satellite data processing pipelines at NASA Goddard.
Currently, using 'object' as a data type is not supported. A NumPy array with a datatype 'object' holds references to Python objects. Sometimes, it is useful to have a numpy array of object: unlike a list, a numpy object array can support multiple dimensions and advanced slicing.
This is a feature request to add the 'object' datatype to the contract specification for numpy arrays.
Reference: https://andreacensi.github.io/contracts/reference.html#numpy-specific-contracts