apparun.tree_node#
Classes#
Properties of an impact model node. Can be used by to break the results down |
|
Gathers all useful information to exploit computed node wise LCIA results. |
Module Contents#
- class apparun.tree_node.NodeProperties#
Bases:
pydantic.BaseModel
Properties of an impact model node. Can be used by to break the results down according to life cycle phase, for exemple. Properties can be key/value (ex: {“phase”: “production”} or flags (ex: {production_phase: True}).
- classmethod from_dict(properties: Dict[str, str | float | bool]) NodeProperties #
Construct using dict. :param properties: properties of the node. :return: constructed NodeProperties
- get_property_value(property_name: str) str | bool | None #
Gives the value of a property by name, returns None if property doesn’t exist. :param property_name: name of the property to get value :return: value of the property, None if doesn’t exist
- properties: Dict[str, str | float | bool]#
- class apparun.tree_node.NodeScores#
Bases:
pydantic.BaseModel
Gathers all useful information to exploit computed node wise LCIA results.
- static combine_by_property(nodes_scores: List[NodeScores], property_name: str) List[NodeScores] #
Sum up (element wise) the scores of each node sharing the same property value, for each method. :param nodes_scores: node scores to combine according to property value. :param property_name: name of the property under consideration :return: list of newly created nodes. Name of the node will be the property value.
- to_unpivoted_df() pandas.DataFrame #
- lcia_scores: apparun.score.LCIAScores#
Computed LCIA scores, for each method.
- name: str#
Node name/property value, if results have been combined by property value.
- parent: str#
Name of parent node.
- properties: NodeProperties#
Properties of the node.