Skip to content

Add dynamic array type

Adds a dynamic type for array symbols (with known shape) such that the dtype can be inserted later: TypedSymbol(name, DynamicNumericArrayType(shape))

The typifier (currently) makes no attempt at inferring the shape of untyped array symbols. Therefore, their shape must be specified explicitly by specifying a type. Prior to this MR, this had to be a PsArrayType which requires a concrete scalar type.

I wanted to solve this issue by extending the DaynamicType enum with a third variant, which takes the shape as a member (using a similar solution as here). Unfortunately, that is incompatible with SymPy because nested types can not be pickled 🙄. That is why I replaced the enum with a type hierarchy, but I am open to any other suggestions.

Merge request reports