aeromaps.models.impacts.generic_energy_model.common.energy_carriers_manager¶
EnergyCarrierMetadata
dataclass
¶
EnergyCarrierMetadata(name=None, aircraft_type=None, default=False, mandate_type=None, energy_origin=None, resources_used=None, resources_used_processes=None, cost_model=None, environmental_model=None)
Dataclass to hold metadata for an energy carrier.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the energy carrier. |
aircraft_type |
str
|
Type of aircraft the energy carrier is associated with. |
default |
bool
|
Indicates if this is the default energy carrier for the aircraft type. |
mandate_type |
str
|
Type of mandate the energy carrier obeys to (share, volume) |
energy_origin |
str
|
Origin of the energy (e.g., renewable, fossil). |
resources_used |
List[str]
|
List of resources used by the energy carrier. |
resources_used_processes |
dict
|
Dictionary mapping resources used by associated processes. |
cost_model |
str
|
Type of cost model used (e.g., top-down, bottom-up). |
environmental_model |
str
|
Type of environmental model used (e.g., top-down, bottom-up). |
EnergyCarrierManager ¶
EnergyCarrierManager(carriers=None)
Manager class to handle a collection of energy carriers and provide methods to add and retrieve them based on various criteria.
Attributes:
| Name | Type | Description |
|---|---|---|
carriers |
List[EnergyCarrierMetadata]
|
List of energy carrier metadata instances. |
Initialize the EnergyCarrierManager with an optional list of energy carriers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
carriers
|
List[EnergyCarrierMetadata]
|
Initial list of energy carrier metadata instances. |
None
|
Source code in aeromaps/models/impacts/generic_energy_model/common/energy_carriers_manager.py
53 54 55 56 57 58 59 60 61 62 | |
add ¶
add(carrier)
Add a new energy carrier to the manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
carrier
|
EnergyCarrierMetadata
|
Energy carrier metadata instance to add. |
required |
Source code in aeromaps/models/impacts/generic_energy_model/common/energy_carriers_manager.py
64 65 66 67 68 69 70 71 72 73 | |
get ¶
get(**criteria)
Retrieve energy carriers that match all specified criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
criteria
|
Keyword arguments used to match attributes of energy carriers; only carriers matching all provided criteria are returned. |
{}
|
Returns:
| Type | Description |
|---|---|
matches
|
Energy carrier metadata instances that match the given criteria. |
Source code in aeromaps/models/impacts/generic_energy_model/common/energy_carriers_manager.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
get_all ¶
get_all()
Return all energy carriers managed by this object.
Returns:
| Type | Description |
|---|---|
carriers
|
All energy carrier metadata instances stored in the manager. |
Source code in aeromaps/models/impacts/generic_energy_model/common/energy_carriers_manager.py
102 103 104 105 106 107 108 109 110 111 | |
get_all_types ¶
get_all_types(parameter)
Retrieve unique values of a specified attribute across all energy carriers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter
|
str
|
Name of the attribute to aggregate unique values for. |
required |
Returns:
| Type | Description |
|---|---|
values
|
Unique values of the specified parameter across all energy carriers. |
Source code in aeromaps/models/impacts/generic_energy_model/common/energy_carriers_manager.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
build_pathways_manager ¶
build_pathways_manager(energy_carriers_data, energy_processes_data=None)
Build a manager from the raw contents of the energy-carrier YAML.
Split out of AeroMAPSProcess so that results loaded from committed JSON
can carry a manager too. The pathway metadata the plots need is entirely
declared in the YAML, so it does not require running the model, and without
it every pathway-aware plot falls back to an empty figure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
energy_carriers_data
|
dict
|
Parsed energy-carrier YAML, one entry per pathway. |
required |
energy_processes_data
|
dict
|
Parsed processes YAML, used to map each pathway's processes onto the resource each of them consumes. |
None
|
Returns:
| Type | Description |
|---|---|
EnergyCarrierManager
|
Manager holding one metadata entry per declared pathway. |
Source code in aeromaps/models/impacts/generic_energy_model/common/energy_carriers_manager.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |