pystencils.types.PsStructType#

class pystencils.types.PsStructType(members, name=None, const=False)#

Named or anonymous structured data type.

A struct type is defined by its sequence of members. The struct may optionally have a name, although the code generator currently does not support named structs and treats them the same way as anonymous structs.

Struct member types cannot be const; if a const member type is passed, its constness will be removed.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

class Member(name, dtype)#
Parameters:
find_member(member_name)#

Find a member by name

Return type:

Member | None

Parameters:

member_name (str)

property numpy_dtype: dtype#

A np.dtype object representing this data type.

Available both for backward compatibility and for interaction with the numpy-based runtime system.

property itemsize: int#

If this type has a valid in-memory size, return that size in bytes.