bw2calc.fast_scores#

Classes#

FastScoresOnlyMultiLCA

Use chunking and pre-calculate as much as possible to optimize speed for multiple LCA

Module Contents#

class bw2calc.fast_scores.FastScoresOnlyMultiLCA(*args, chunk_size: int = 50, **kwargs)[source]#

Bases: bw2calc.multi_lca.MultiLCA, bw2calc.fast_supply_arrays.FastSupplyArraysMixin

Use chunking and pre-calculate as much as possible to optimize speed for multiple LCA calculations.

If using pardiso via pypardiso:

  • Feed multiple demands at once as a tensor into the solver function

  • Skip some identity checks on the technosphere matrix

_calculation() xarray.DataArray[source]#
_get_scores() xarray.DataArray[source]#
_load_datapackages() None[source]#
_set_scores(arr: xarray.DataArray) None[source]#
build_precalculated() None[source]#

Multiply the characterization, and normalization and weighting matrices if present, by the biosphere matrix. When done outside the calculation loop, this only needs to be done once.

calculate() xarray.DataArray[source]#

The actual LCI calculation.

Separated from lci to be reusable in cases where the matrices are already built, e.g. redo_lci and Monte Carlo classes.

abstractmethod lci() None[source]#
abstractmethod lci_calculation() None[source]#
abstractmethod lcia() None[source]#
abstractmethod lcia_calculation() None[source]#
scores[source]#