bw_interface_schemas.models =========================== .. py:module:: bw_interface_schemas.models Attributes ---------- .. autoapisummary:: bw_interface_schemas.models.Identifier bw_interface_schemas.models.hiss Classes ------- .. autoapisummary:: bw_interface_schemas.models.BiosphereQuantitativeEdge bw_interface_schemas.models.CharacterizationQuantitativeEdge bw_interface_schemas.models.Collection bw_interface_schemas.models.DataSource bw_interface_schemas.models.Edge bw_interface_schemas.models.ElementaryFlow bw_interface_schemas.models.ImpactAssessmentMethod bw_interface_schemas.models.ImpactCategory bw_interface_schemas.models.InventoryNode bw_interface_schemas.models.Node bw_interface_schemas.models.NodeTypes bw_interface_schemas.models.Normalization bw_interface_schemas.models.NormalizationQuantitativeEdge bw_interface_schemas.models.Parsimonius bw_interface_schemas.models.Process bw_interface_schemas.models.Product bw_interface_schemas.models.ProductSystem bw_interface_schemas.models.Project bw_interface_schemas.models.QualitativeEdge bw_interface_schemas.models.QualitativeEdgeTypes bw_interface_schemas.models.QuantitativeEdge bw_interface_schemas.models.QuantitativeEdgeTypes bw_interface_schemas.models.TechnosphereQuantitativeEdge bw_interface_schemas.models.Weighting bw_interface_schemas.models.WeightingQuantitativeEdge Module Contents --------------- .. py:class:: BiosphereQuantitativeEdge(/, **data: Any) Bases: :py:obj:`QuantitativeEdge` An quantitative edge linking two nodes in the graph. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:method:: not_functional(data) :classmethod: .. py:attribute:: edge_type :type: Literal[QuantitativeEdgeTypes] .. py:class:: CharacterizationQuantitativeEdge(/, **data: Any) Bases: :py:obj:`QuantitativeEdge` An quantitative edge linking two nodes in the graph. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: edge_type :type: Literal[QuantitativeEdgeTypes] .. py:attribute:: location :type: str | None :value: None .. py:class:: Collection(/, **data: Any) Bases: :py:obj:`Node` A `Collection` is a group of nodes organized in a common container. These nodes can be part of inventory supply chains, impact assessment methods, parameterization sets, or any other logical unit of organization. `Collection` nodes are normally linked to other nodes via qualitative relationship edges, such as `EdgeTypes.belongs_to`. The edge type should clearly differentiate the intended edge direction. In this case, a `Product` node (source) `belongs_to` a `Collection`. Collections can be nested. For example, a product system collection can belong to a project collection. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:class:: DataSource(/, **data: Any) Bases: :py:obj:`Parsimonius` A data source, such as a publication or field measurement. A very rough draft; expect changes. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: authors :type: list[str] .. py:attribute:: doi :type: str | None :value: None .. py:attribute:: title :type: str .. py:attribute:: year :type: int .. py:class:: Edge(/, **data: Any) Bases: :py:obj:`Parsimonius` Change default `model_dump` behaviour to not export unset values by default Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: comment :type: Union[str, dict[str, str], None] :value: None .. py:attribute:: edge_type :type: str .. py:attribute:: properties :type: dict[str, pydantic.JsonValue] | None :value: None .. py:attribute:: references :type: list[DataSource] | None :value: None .. py:attribute:: source :type: Identifier .. py:attribute:: tags :type: dict[str, pydantic.JsonValue] | None :value: None .. py:attribute:: target :type: Identifier .. py:class:: ElementaryFlow(/, **data: Any) Bases: :py:obj:`InventoryNode` A material or energy entering the system being studied that has been drawn from the environment without previous human transformation, or material or energy leaving the system being studied that is released into the environment without subsequent human transformation. From ISO 14040. For sustainability assessment, an elementary flow is a concept (e.g. CO2) situated in a context (e.g. emission to air). The same underlying concept (e.g. CO2) can be both a product and an elementary flow, but because they operate in different contexts they are separate objects. Elementary flows extend `InventoryNode` with a required `unit` - this unit is the default used for every edge consuming or producing this product. They also require a `context`, which is a list of strings. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: context :type: list[str] .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:attribute:: unit :type: str .. py:class:: ImpactAssessmentMethod(/, **data: Any) Bases: :py:obj:`Collection` A set of impact categories, weightings, and normalizations, with their associated factors. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: license :type: str .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:attribute:: references :type: list[DataSource] | None :value: None .. py:class:: ImpactCategory(/, **data: Any) Bases: :py:obj:`Node` A class representing environmental issues of concern to which life cycle inventory analysis results may be assigned. From ISO 14040. In practical terms characterization is a list of factors (midpoint or endpoint) associated with elementary flows. This class stores metadata about the category, such as lineage and units. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: name :type: list[str] .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:attribute:: unit :type: str .. py:class:: InventoryNode(/, **data: Any) Bases: :py:obj:`Node` Common base class for inventory nodes. Please only use subclasses of this node. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: location :type: str | None :value: None .. py:attribute:: properties :type: dict[str, pydantic.JsonValue] | None :value: None .. py:attribute:: references :type: list[DataSource] | None :value: None .. py:class:: Node(/, **data: Any) Bases: :py:obj:`Parsimonius` Base class for nodes in the graph. Can include processes, products, and elementary flows, but also LCIA objects, and organizational tools like product systems and projects. All nodes must have a name and a type. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: comment :type: Union[str, dict[str, str], None] :value: None .. py:attribute:: name :type: str .. py:attribute:: node_type :type: NodeTypes | str .. py:attribute:: tags :type: dict[str, pydantic.JsonValue] | None :value: None .. py:class:: NodeTypes Bases: :py:obj:`enum.StrEnum` The built-in node types. These are sufficient to describe standard life cycle assessment, but you can use custom types for new `Node` classes if needed. Initialize self. See help(type(self)) for accurate signature. .. py:attribute:: elementary_flow :value: 'elementary_flow' .. py:attribute:: impact_assessment_method :value: 'impact_assessment_method' .. py:attribute:: impact_category :value: 'impact_category' .. py:attribute:: normalization :value: 'normalization' .. py:attribute:: process :value: 'process' .. py:attribute:: product :value: 'product' .. py:attribute:: product_system :value: 'product_system' .. py:attribute:: product_system_variant :value: 'product_system_variant' .. py:attribute:: project :value: 'project' .. py:attribute:: weighting :value: 'weighting' .. py:class:: Normalization(/, **data: Any) Bases: :py:obj:`Node` Normalization is the calculation of the magnitude of the category indicator results relative to some reference information. The aim of the normalization is to understand better the relative magnitude for each indicator result of the product system under study. From ISO 14044. In practical terms normalization is a list of factors associated with elementary flows. This class stores metadata about normalization. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: name :type: list[str] .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:attribute:: unit :type: str .. py:class:: NormalizationQuantitativeEdge(/, **data: Any) Bases: :py:obj:`QuantitativeEdge` An quantitative edge linking two nodes in the graph. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: edge_type :type: Literal[QuantitativeEdgeTypes] .. py:class:: Parsimonius(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Change default `model_dump` behaviour to not export unset values by default Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:method:: model_dump(exclude_unset=True, *args, **kwargs) Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. Args: mode: The mode in which `to_python` should run. If mode is 'json', the output will only contain JSON serializable types. If mode is 'python', the output may contain non-JSON-serializable Python objects. include: A set of fields to include in the output. exclude: A set of fields to exclude from the output. context: Additional context to pass to the serializer. by_alias: Whether to use the field's alias in the dictionary key if defined. exclude_unset: Whether to exclude fields that have not been explicitly set. exclude_defaults: Whether to exclude fields that are set to their default value. exclude_none: Whether to exclude fields that have a value of `None`. round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. Returns: A dictionary representation of the model. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:class:: Process(/, **data: Any) Bases: :py:obj:`InventoryNode` The smallest element considered in the life cycle inventory analysis for which input and output data are quantified. From ISO 14040. Can have one or more functional product edges. Multfunctional processes still have the type `NodeTypes.process`. Processes extend `InventoryNode` with a required `location` (string). Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: location :type: str .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:class:: Product(/, **data: Any) Bases: :py:obj:`InventoryNode` Any good or service. From ISO 14040. Products extend `InventoryNode` with a required `unit` - this unit is the default used for every edge consuming or producing this product. The functional unit of sustainability assessment is always product(s). Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:attribute:: unit :type: str .. py:class:: ProductSystem(/, **data: Any) Bases: :py:obj:`Collection` A collection of unit processes with elementary and product flows, performing one or more defined functions, and which models the life cycle of a product. From ISO 14040. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: license :type: str .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:attribute:: references :type: list[DataSource] | None :value: None .. py:class:: Project(/, **data: Any) Bases: :py:obj:`Collection` A set of `ProductSystem` and `ImpactAssessmentMethod` collections which encapsulate a sustainability assessment project. Projects can be self-contained, or can link to other `Project` collections. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:class:: QualitativeEdge(/, **data: Any) Bases: :py:obj:`Edge` A qualitative edge linking two nodes in the graph. The type of relationship is defined by the `edge_type`. Normally these are drawn from `QualitativeEdgeTypes` but don't have to be. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: edge_type :type: QualitativeEdgeTypes .. py:class:: QualitativeEdgeTypes Bases: :py:obj:`enum.StrEnum` Enum where members are also (and must be) strings Initialize self. See help(type(self)) for accurate signature. .. py:attribute:: belongs_to :value: 'belongs_to' .. py:attribute:: variant_of :value: 'variant_of' .. py:class:: QuantitativeEdge(/, **data: Any) Bases: :py:obj:`Edge` An quantitative edge linking two nodes in the graph. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: amount :type: float .. py:attribute:: edge_type :type: QuantitativeEdgeTypes .. py:attribute:: loc :type: float | None :value: None .. py:attribute:: maximum :type: float | None :value: None .. py:attribute:: minimum :type: float | None :value: None .. py:attribute:: negative :type: bool | None :value: None .. py:attribute:: scale :type: float | None :value: None .. py:attribute:: shape :type: float | None :value: None .. py:attribute:: uncertainty_type :type: int | None :value: None .. py:class:: QuantitativeEdgeTypes Bases: :py:obj:`enum.StrEnum` Enum where members are also (and must be) strings Initialize self. See help(type(self)) for accurate signature. .. py:attribute:: biosphere :value: 'biosphere' .. py:attribute:: characterization :value: 'characterization' .. py:attribute:: normalization :value: 'normalization' .. py:attribute:: technosphere :value: 'technosphere' .. py:attribute:: weighting :value: 'weighting' .. py:class:: TechnosphereQuantitativeEdge(/, **data: Any) Bases: :py:obj:`QuantitativeEdge` An quantitative edge linking two nodes in the graph. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: edge_type :type: Literal[QuantitativeEdgeTypes] .. py:attribute:: functional :type: bool :value: False .. py:class:: Weighting(/, **data: Any) Bases: :py:obj:`Node` Weighting is the process of converting indicator results of different impact categories by using numerical factors based on value-choices. It may include aggregation of the weighted indicator results. From ISO 14044. In practical terms weighting is a single factor associated with a normalization or characterization set. This class stores metadata about weighting. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: name :type: list[str] .. py:attribute:: node_type :type: Literal[NodeTypes] .. py:attribute:: unit :type: str .. py:class:: WeightingQuantitativeEdge(/, **data: Any) Bases: :py:obj:`QuantitativeEdge` An quantitative edge linking two nodes in the graph. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: edge_type :type: Literal[QuantitativeEdgeTypes] .. py:data:: Identifier .. py:data:: hiss