epymorph.data_type
Types for source data and attributes in epymorph.
AttributeType
module-attribute
AttributeType = ScalarType | StructType
The allowed type declarations for epymorph attributes.
AttributeValue
module-attribute
AttributeValue = ScalarValue | StructValue
The allowed types for epymorph attribute values (specifically: default values).
AttributeDType
module-attribute
AttributeDType = ScalarDType | StructDType
The subset of numpy dtypes for use in epymorph: these map 1:1 with AttributeType.
CentroidType
module-attribute
CentroidType: AttributeType = (
("longitude", float),
("latitude", float),
)
Structured epymorph type declaration for long/lat coordinates.
CentroidDType
module-attribute
CentroidDType: dtype[void] = dtype_as_np(CentroidType)
The numpy equivalent of CentroidType
(structured dtype for long/lat coordinates).
SimDType
module-attribute
SimDType = int64
This is the numpy datatype that should be used to represent internal simulation data. Where segments of the application maintain compartment and/or event counts, they should take pains to use this type at all times (if possible).
dtype_as_np
dtype_as_np(dtype: AttributeType) -> dtype
Return a python-style dtype as its numpy-equivalent.
dtype_str
dtype_str(dtype: AttributeType) -> str
Return a human-readable description of the given dtype.
dtype_check
dtype_check(dtype: AttributeType, value: Any) -> bool
Checks that a value conforms to a given dtype. (Python types only.)