bw2calc.restricted_sparse_matrix_dict#

Classes#

RestrictedSparseMatrixDict

Like SparseMatrixDict, but follows restrictions on what can be multiplied.

RestrictionsValidator

Module Contents#

class bw2calc.restricted_sparse_matrix_dict.RestrictedSparseMatrixDict(restrictions: dict, *args, **kwargs)[source]#

Bases: matrix_utils.SparseMatrixDict

Like SparseMatrixDict, but follows restrictions on what can be multiplied.

Only for use with normalization and weighting.

_concatenate(a: tuple, b: tuple) tuple[source]#

Combine a and b while unwrapping b, if necessary.

_get_first_element(elem: Any) tuple[source]#

Get the first LCIA key from elem.

The keys can have the form ((“some”, “lcia”), “functional-unit-id”) or `(“some”, “lcia”).

_restrictions[source]#
class bw2calc.restricted_sparse_matrix_dict.RestrictionsValidator[source]#

Bases: pydantic.BaseModel

restrictions: dict[tuple[str, Ellipsis], list[tuple[str, Ellipsis]]][source]#