model_element
ModelElement(data, **kwargs)
Bases: ABC
Source code in pyoframe/model_element.py
dimensions: Optional[List[str]]
property
dimensions_unsafe: List[str]
property
Same as dimensions
but returns an empty list if there are no dimensions instead of None.
When unsure, use dimensions
instead since the type checker forces users to handle the None case (no dimensions).
shape: Dict[str, int]
property
The number of indices in each dimension.
Examples:
ModelElementWithId(data, **kwargs)
Bases: ModelElement
, AttrContainerMixin
Provides a method that assigns a unique ID to each row in a DataFrame. IDs start at 1 and go up consecutively. No zero ID is assigned since it is reserved for the constant variable term. IDs are only unique for the subclass since different subclasses have different counters.
Source code in pyoframe/model_element.py
get_id_column_name()
abstractmethod
classmethod
reset_counters()
classmethod
Resets all the ID counters. This function is called before every unit test to reset the code state.
SupportPolarsMethodMixin
Bases: ABC