pystencils.types.create_type#
- pystencils.types.create_type(type_spec)#
Create a pystencils type object from a variety of specifications.
This function converts several possible representations of data types to an instance of
PsType
. Thetype_spec
argument can be any of the following:Strings (
str
): will be parsed as common C types, throwing an exception if that fails. Custom types must be created explicitly usingPsCustomType
.Supported Numpy scalar data types (see https://numpy.org/doc/stable/reference/arrays.scalars.html) are converted to pystencils scalar data types
Instances of
numpy.dtype
: Attempt to interpret scalar types like above, and structured types as structs.Instances of
PsType
will be returned as they are