bw2io.strategies.products#
Attributes#
Functions#
|
Create new product nodes and link to them if needed. |
Module Contents#
- bw2io.strategies.products.create_products_as_new_nodes(data: List[dict]) List[dict] [source]#
Create new product nodes and link to them if needed.
We create new product if the following conditions are met:
- The dataset is not multifunctional (
dataset.get(“type”) != bd.labels.multifunctional_node_default). Multifunctional datasets handle product creation separately.
The edge is functional (obj.get(“functional”) is True)
The edge is unlinked (obj.get(“input”) is falsey)
The given edge has a name, and that name is different than the dataset name
- The combination of name and location is not present in the other dataset nodes. If no
location attribute is given for the edge under consideration, we use the location of the dataset.
Create new nodes, and links the originating edges to the new product nodes.
Modifies data in-place, and returns the modified data.