message_ix_models.model.material.share_constraints.CommShareConfig
- class message_ix_models.model.material.share_constraints.CommShareConfig(share_name: str, type_tec_all_name: str, type_tec_share_name: str, all_tecs: ~typing.List[str], share_tecs: ~typing.List[str], nodes: str | ~typing.List[str], dims_all: dict[str, ~typing.List[str]] = <factory>, dims_share: dict[str, ~typing.List[str]] = <factory>)[source]
Bases:
objectConfiguration for commodity share constraints.
Collects and prepares all data required to add a new commodity share constraint to the model structure of a
Scenario.mode-commodity-levelindices formap_shares_commodity_<total/share>can be inferred frominputparameter data from a scenario based on the provided technology listsall_tecsandshare_tecs.Alternatively, they can be defined explicitly through
dims_allanddims_sharein the YAML config file.The same applies to
nodes. Ifnodes: all, all model regions except “World” are used.- __init__(share_name: str, type_tec_all_name: str, type_tec_share_name: str, all_tecs: ~typing.List[str], share_tecs: ~typing.List[str], nodes: str | ~typing.List[str], dims_all: dict[str, ~typing.List[str]] = <factory>, dims_share: dict[str, ~typing.List[str]] = <factory>) → None
Methods
__init__(share_name, type_tec_all_name, ...)add_to_scenario(scen)Add all required sets and categories to a scenario.
dims_from_tecs(scen, tec_type)Initialize
dims_allordims_sharefrom model structure.from_files(scen, name)Create a CommShareConfig instance from YAML file and model structure.
get_map_share_set_share(scen)Generate
map_shares_commodity_sharefrom config and model structure.get_map_share_set_total(scen)Generate
map_shares_commodity_totalfrom config and model structure.remove_from_scenario(scen)Remove all required sets and categories to a scenario.
Attributes
share_nametype_tec_all_nametype_tec_share_nameall_tecsshare_tecsnodesdims_alldims_share- dims_from_tecs(scen: Scenario, tec_type: Literal['all', 'share']) → dict[str, List[str]][source]
Initialize
dims_allordims_sharefrom model structure.
- classmethod from_files(scen: Scenario, name: str) → CommShareConfig[source]
Create a CommShareConfig instance from YAML file and model structure.
- get_map_share_set_share(scen) → DataFrame[source]
Generate
map_shares_commodity_sharefrom config and model structure.