Modules (formerly called ‘meta-processes’)¶
MetaProcess(name, outputs, chain, cuts, output_based_scaling=True, **kwargs)¶
- A description of one or several processes from a life cycle inventory database.
- It has the following characteristics:
- It produces one or several output products
- It has at least one process from an inventory database
- It has one or several scaling activities that are linked to the output of the system. They are calculated automatically based on the product output (exception: if output_based_scaling=False, see below).
- Inputs may be cut-off. Cut-offs are remembered and can be used in a linked meta-process to recombine meta-processes to form supply chains (or several, alternative supply chains).
- name (
str): Name of the meta-process
- outputs (
[(key, str, optional float)]): A list of products produced by the meta-process. Format is
(key into inventory database, product name, optional amount of product produced).
- chain (
[key]): A list of inventory processes in the supply chain (not necessarily in order).
- cuts (
[(parent_key, child_key, str, float)]): A set of linkages in the supply chain that should be cut. These will appear as negative products (i.e. inputs) in the process-product table. The float amount is determined automatically. Format is (input key, output key, product name, amount).
- output_based_scaling (
bool): True: scaling activities are scaled by the user defined product outputs. False: the scaling activities are set to 1.0 and the user can define any output. This may not reflect reality or original purpose of the inventory processes.
- name (
Construct a list of edges.
- db (dict): The supply chain database
- A list of (in, out, amount) edges.
Extract the supply chain for this process from larger database.
- nodes (set): The datasets to extract (keys in db dict)
- db (dict): The inventory database, e.g. ecoinvent
- A filtered database, in the same dict format
Which are the scaling activities (at least one)?
Calculate by filtering for processes which are not used as inputs.
- chain (set): The supply chain processes
- edges (list): The list of supply chain edges
- Boolean isSimple, List heads.
Get lists of external and internal edges with original flow values or scaled to the meta-process.
Returns a list of product inputs and outputs.
get_supply_vector(chain, edges, scaling_activities, outputs)¶
Construct supply vector (solve linear system) for the supply chain of this simplified product system.
- chain (list): Nodes in supply chain
- edges (list): List of edges
- scaling_activities (key): Scaling activities
- Mapping from process keys to supply vector indices Supply vector (as list)
lca(method, amount=1.0, factorize=False)¶
Calculates LCA results for a given LCIA method and amount. Returns the LCA score.
Returns a dictionary of meta-process data as specified in the data format.
Makes sure that each cut includes the amount that is cut. This is retrieved from self.internal_scaled_edges_with_cuts.
If not given, adds default values to outputs:
- output name: “Unspecified Output”
- amount: 1.0
- outputs (list): outputs
- Padded outputs
Property shortcut for returning a list of product intputs and outputs.
Remove chain items if they are the parent of a cut. Otherwise this leads to unintended LCIA results.
save_as_bw2_dataset(db_name='MP default', unit=None, location=None, categories=, save_aggregated_inventory=False)¶
Save simplified process to a database.
Creates database if necessary; otherwise adds to existing database. Uses the
self.scaling_activities, if not otherwise provided. Assumes that one unit of the scaling activity is being produced.
- db_name (str): Name of Database
- unit (str, optional): Unit of the simplified process
- location (str, optional): Location of the simplified process
- categories (list, optional): Category/ies of the scaling activity
- save_aggregated_inventory (bool, optional): Saves in output minus input style by default (True), otherwise aggregated inventory of all inventories linked within the meta-process