cge_modeling.base.utilities.infer_object_shape_from_coords#
- cge_modeling.base.utilities.infer_object_shape_from_coords(obj, coords)#
Infer the shape of a CGE Model object from a provided coordinate dictionary.
- Parameters:
- obj: Union[Variable, Parameter]
A CGE Model object
- coords: dict[str, list[str]]
A dictionary of coordinates, mapping dimension names to lists of labels associated with that dimension.
- Returns:
Notes
CGE Model objects do not themselves carry shape information, only dimension information. This is because the shape information is not strictly necessary at model declaration time, and indeed might not even be known by the economist when designing the model.
What will determine the shape information is the coordinate dictionary, which is known by the CGEModel object but not the individual Variable and Parameter instances it contains. This function allows us to infer the shape of an object from the coordinate dictionary.
Examples