bw2data.backends.iotable.proxies#
Classes#
A MutableMapping is a generic container for associating |
|
Iterable of |
|
Non-mutable dictionary which mimics |
Module Contents#
- class bw2data.backends.iotable.proxies.IOTableActivity(document=None, **kwargs)[source]#
Bases:
bw2data.backends.proxies.Activity
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__.
Create an Activity proxy object.
If this is a new activity, can pass kwargs.
If the activity exists in the database, document should be an ActivityDataset.
- rp_exchange()[source]#
Return an
Exchange
object corresponding to the reference production. Uses the following in order:The
production
exchange, if only one is presentThe
production
exchange with the same name as the activityreference product
.
Raises
ValueError
if no suitable exchange is found.
- technosphere() IOTableExchanges [source]#
- class bw2data.backends.iotable.proxies.IOTableExchanges(datapackage: bw_processing.Datapackage, target: bw2data.backends.proxies.Activity | None = None, biosphere: bool = True, technosphere: bool = True, production: bool = True)[source]#
Bases:
collections.abc.Iterable
Iterable of
ReadOnlyExchange
objects drawn from Datapackage arrays.In the technosphere matrix, all positive exchanges are considered production, and all negative exchanges are technosphere, i.e. consumption, and we use this convention to label the edges. However, to be consistent with SQLite database results, we don’t flip signs in the returned dataframe.
The order of returned edges are production, technosphere, biosphere.
This function will draw from all resources with the correct matrix types (i.e.
'biosphere_matrix'
,'technosphere_matrix'
). Normally each IO Table database is stored in only one datapackage, and each datapackage only has one such database.datapackage
: The datapackage object.target
: Limit exchanges to those with the column indextarget
. Target must be an instance ofIOTableActivity
.biosphere
,technosphere
,production
: Return these types of edges.