bw2parameters.parameter_set#

Attributes#

Classes#

Module Contents#

class bw2parameters.parameter_set.ParameterSet(params, global_params=None, interpreter=None)[source]#

Bases: object

basic_validation()[source]#

Basic validation needed to build references and order

evaluate()[source]#

Evaluate each formula. Returns dictionary of parameter names and values.

evaluate_and_set_amount_field()[source]#

Evaluate each formula. Updates the amount field of each parameter.

evaluate_monte_carlo(iterations=1000)[source]#

Evaluate each formula using Monte Carlo and variable uncertainty data, if present.

Formulas must return a one-dimensional array, or BroadcastingError is raised.

Returns dictionary of {parameter name: numpy array}.

get_interpreter(evaluate_first=True)[source]#

Get an instance of asteval.Interpreter that is prepopulated with global and local symbol names and values.

get_order()[source]#

Get a list of parameter name in an order that they can be safely evaluated

get_references()[source]#

Create dictionary of parameter references

all_param_names[source]#
global_params[source]#
interpreter[source]#
order = [][source]#
params[source]#
references[source]#
class bw2parameters.parameter_set.PintParameterSet(params, global_params=None, interpreter=None)[source]#

Bases: ParameterSet

evaluate()[source]#

Evaluate each formula. Returns dictionary of parameter names and values.

evaluate_and_set_amount_field()[source]#

Evaluate each formula. Updates the amount field of each parameter. Also updates the unit field if no unit is given.

get_references()[source]#

Create dictionary of parameter references

bw2parameters.parameter_set.MC_ERROR_TEXT = Multiline-String[source]#
Show Value
"""Formula returned array of wrong shape:
Name: {}
Formula: {}
Expected shape: {}
Returned shape: {}"""