bw_interface_schemas.models
Attributes
Classes
An quantitative edge linking two nodes in the graph. |
|
An quantitative edge linking two nodes in the graph. |
|
A Collection is a group of nodes organized in a common container. |
|
A data source, such as a publication or field measurement. |
|
Change default model_dump behaviour to not export unset values by default |
|
A material or energy entering the system being studied that has been drawn |
|
A set of impact categories, weightings, and normalizations, with their |
|
A class representing environmental issues of concern to which life cycle |
|
Common base class for inventory nodes. Please only use subclasses of this |
|
Base class for nodes in the graph. Can include processes, products, and |
|
The built-in node types. These are sufficient to describe standard life |
|
Normalization is the calculation of the magnitude of the category indicator |
|
An quantitative edge linking two nodes in the graph. |
|
Change default model_dump behaviour to not export unset values by default |
|
The smallest element considered in the life cycle inventory analysis for |
|
Any good or service. From ISO 14040. |
|
A collection of unit processes with elementary and product flows, |
|
A set of ProductSystem and ImpactAssessmentMethod collections which |
|
A qualitative edge linking two nodes in the graph. |
|
Enum where members are also (and must be) strings |
|
An quantitative edge linking two nodes in the graph. |
|
Enum where members are also (and must be) strings |
|
An quantitative edge linking two nodes in the graph. |
|
Weighting is the process of converting indicator results of different |
|
An quantitative edge linking two nodes in the graph. |
Module Contents
- class bw_interface_schemas.models.BiosphereQuantitativeEdge(/, **data: Any)[source]
Bases:
QuantitativeEdgeAn 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.
- class bw_interface_schemas.models.CharacterizationQuantitativeEdge(/, **data: Any)[source]
Bases:
QuantitativeEdgeAn 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.
- class bw_interface_schemas.models.Collection(/, **data: Any)[source]
Bases:
NodeA 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.
- class bw_interface_schemas.models.DataSource(/, **data: Any)[source]
Bases:
ParsimoniusA 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.
- class bw_interface_schemas.models.Edge(/, **data: Any)[source]
Bases:
ParsimoniusChange 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.
- references: list[DataSource] | None = None[source]
- class bw_interface_schemas.models.ElementaryFlow(/, **data: Any)[source]
Bases:
InventoryNodeA 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.
- class bw_interface_schemas.models.ImpactAssessmentMethod(/, **data: Any)[source]
Bases:
CollectionA 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.
- references: list[DataSource] | None = None[source]
- class bw_interface_schemas.models.ImpactCategory(/, **data: Any)[source]
Bases:
NodeA 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.
- class bw_interface_schemas.models.InventoryNode(/, **data: Any)[source]
Bases:
NodeCommon 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.
- references: list[DataSource] | None = None[source]
- class bw_interface_schemas.models.Node(/, **data: Any)[source]
Bases:
ParsimoniusBase 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.
- class bw_interface_schemas.models.NodeTypes[source]
Bases:
enum.StrEnumThe 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.
- class bw_interface_schemas.models.Normalization(/, **data: Any)[source]
Bases:
NodeNormalization 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.
- class bw_interface_schemas.models.NormalizationQuantitativeEdge(/, **data: Any)[source]
Bases:
QuantitativeEdgeAn 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.
- class bw_interface_schemas.models.Parsimonius(/, **data: Any)[source]
Bases:
pydantic.BaseModelChange 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.
- model_dump(exclude_unset=True, *args, **kwargs)[source]
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.
- class bw_interface_schemas.models.Process(/, **data: Any)[source]
Bases:
InventoryNodeThe 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.
- class bw_interface_schemas.models.Product(/, **data: Any)[source]
Bases:
InventoryNodeAny 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.
- class bw_interface_schemas.models.ProductSystem(/, **data: Any)[source]
Bases:
CollectionA 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.
- references: list[DataSource] | None = None[source]
- class bw_interface_schemas.models.Project(/, **data: Any)[source]
Bases:
CollectionA 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.
- class bw_interface_schemas.models.QualitativeEdge(/, **data: Any)[source]
Bases:
EdgeA 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.
- edge_type: QualitativeEdgeTypes[source]
- class bw_interface_schemas.models.QualitativeEdgeTypes[source]
Bases:
enum.StrEnumEnum where members are also (and must be) strings
Initialize self. See help(type(self)) for accurate signature.
- class bw_interface_schemas.models.QuantitativeEdge(/, **data: Any)[source]
Bases:
EdgeAn 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.
- edge_type: QuantitativeEdgeTypes[source]
- class bw_interface_schemas.models.QuantitativeEdgeTypes[source]
Bases:
enum.StrEnumEnum where members are also (and must be) strings
Initialize self. See help(type(self)) for accurate signature.
- class bw_interface_schemas.models.TechnosphereQuantitativeEdge(/, **data: Any)[source]
Bases:
QuantitativeEdgeAn 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.
- class bw_interface_schemas.models.Weighting(/, **data: Any)[source]
Bases:
NodeWeighting 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.
- class bw_interface_schemas.models.WeightingQuantitativeEdge(/, **data: Any)[source]
Bases:
QuantitativeEdgeAn 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.