REGISTER NOW: DdS Autumn School! 🇨🇭 Grosshöchstetten (Switzerland) 🗓️ 6.-11. October 2024

bw2data.proxies#

Module Contents#

Classes#

ActivityProxyBase

A MutableMapping is a generic container for associating

ExchangeProxyBase

A MutableMapping is a generic container for associating

ProxyBase

A MutableMapping is a generic container for associating

class bw2data.proxies.ActivityProxyBase(data, *args, **kwargs)[source]#

Bases: ProxyBase

Inheritance diagram of bw2data.proxies.ActivityProxyBase

A MutableMapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__.

property key[source]#
lca(method=None, amount=1.0)[source]#

Shortcut to construct an LCA object for this activity.

valid(why=False)[source]#
class bw2data.proxies.ExchangeProxyBase(data, *args, **kwargs)[source]#

Bases: ProxyBase

Inheritance diagram of bw2data.proxies.ExchangeProxyBase

A MutableMapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__.

property amount[source]#
property uncertainty[source]#

Get uncertainty dictionary that can be used in uncertainty analysis.

property uncertainty_type[source]#

Get uncertainty type as a stats_arrays class.

property unit[source]#

Get exchange unit.

Separate property because the unit is a property of the input, not the exchange itself.

input[source]#
output[source]#
_get_input()[source]#

Get or set the exchange input.

When getting, returns an Activity - this will raise an error if the linked activity doesn’t yet exist.

When setting, either an Activity or a tuple can be given. The linked activity does not have to exist yet.

_get_output()[source]#

Get or set the exchange output.

When getting, returns an Activity - this will raise an error if the linked activity doesn’t yet exist.

When setting, either an Activity or a tuple can be given. The linked activity does not have to exist yet.

_set_input(value)[source]#
_set_output(value)[source]#
lca(method=None, amount=None)[source]#

Shortcut to construct an LCA object for this exchange input.

Uses the exchange amount if no other amount is provided.

random_sample(n=100)[source]#

Draw a random sample from this exchange.

valid(why=False)[source]#
class bw2data.proxies.ProxyBase(data, *args, **kwargs)[source]#

Bases: collections.abc.MutableMapping

Inheritance diagram of bw2data.proxies.ProxyBase

A MutableMapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __setitem__, __delitem__, __iter__, and __len__.

as_dict()[source]#