Skip to content
Snippets Groups Projects

Add dynamic array type

Closed Daniel Bauer requested to merge hyteg/pystencils:bauerd/dynamic-array-type into v2.0-dev

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 :rolling_eyes:. That is why I replaced the enum with a type hierarchy, but I am open to any other suggestions.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply