pystencils.types.PsBoolType#

class pystencils.types.PsBoolType(const=False)#

Boolean type.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

NUMPY_TYPE#

alias of bool_

property width: int#

Return this type’s width in bits.

property itemsize: int#

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

property numpy_dtype: dtype | None#

A np.dtype object representing this data type.

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

create_literal(value)#

Create a C numerical literal for a constant of this type.

Raises:

PsTypeError – If the given value’s type is not the numeric type’s compiler-internal representation.

Return type:

str

Parameters:

value (Any)

create_constant(value)#

Create the internal representation of a constant with this type.

Raises:

PsTypeError – If the given value cannot be interpreted in this type.

Return type:

Any

Parameters:

value (Any)