honeybee_ph_utils.enumerables module¶
A simplified custom Enum class since IronPython doesn’t have an enum.
- exception honeybee_ph_utils.enumerables.ValueNotAllowedError(_in, _enum)[source]¶
Bases:
Exception- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- args¶
- class honeybee_ph_utils.enumerables.CustomEnum(_value: str | int = '', _index_offset: int = -1)[source]¶
Bases:
objectA simplified custom Enum class since IronPython doesn’t have an enum.
Example usage: ```python class PhFoundationType(enumerables.CustomEnum):
- allowed = [
“1-HEATED_BASEMENT”, “2-UNHEATED_BASEMENT”, “3-SLAB_ON_GRADE”, “4-VENTED_CRAWLSPACE”, “5-NONE”,
]
- def __init__(self, _value=1):
# type: (Union[str, int]) -> None super(PhFoundationType, self).__init__(_value)
new_foundation_type = PhFoundationType(“1-HEATED_BASEMENT”) ```
- classmethod from_dict(_dict: dict[str, Any]) CustomEnum[source]¶
- allowed: list[str] = []¶
- property allowed_upper: list[str]¶
- property number: int¶
Returns the index pos of self.value (usually 1-based)
- property value: str¶