bw2data.backends.iotable#

Module Contents#

Classes#

IOTableActivity

IOTableExchanges

Iterable of ReadOnlyExchange objects drawn from Datapackage arrays.

ReadOnlyExchange

Non-mutable dictionary which mimics bw2data.proxies.Exchange, but is read-only and doesn't link to a SQLite database row.

class bw2data.backends.iotable.IOTableActivity[source]#

Bases: bw2data.backends.proxies.Activity

Inheritance diagram of bw2data.backends.iotable.IOTableActivity
_get_db()[source]#
biosphere()[source]#
abstract delete() None[source]#
exchanges()[source]#
production()[source]#
rp_exchange()[source]#
substitution()[source]#
technosphere() IOTableExchanges[source]#
class bw2data.backends.iotable.IOTableExchanges(datapackage: bw_processing.Datapackage, target: Optional[bw2data.backends.proxies.Activity] = None, biosphere: bool = True, technosphere: bool = True, production: bool = True)[source]#

Bases: collections.abc.Iterable

Inheritance diagram of bw2data.backends.iotable.IOTableExchanges

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 index target. Target must be an instance of IOTableActivity.

  • biosphere, technosphere, production: Return these types of edges.

to_dataframe[source]#
_add_arrays_to_resources(resources, datapackage)[source]#
_group_and_filter_resources(datapackage)[source]#
_mask_resource_arrays(resource, mask)[source]#
_raw_biosphere_iterator()[source]#
_raw_technosphere_iterator(negative=True)[source]#
_reduce_arrays_to_selected_types(resources, technosphere, production, biosphere)[source]#
class bw2data.backends.iotable.ReadOnlyExchange(**kwargs)[source]#

Bases: collections.abc.Mapping

Inheritance diagram of bw2data.backends.iotable.ReadOnlyExchange

Non-mutable dictionary which mimics bw2data.proxies.Exchange, but is read-only and doesn’t link to a SQLite database row.

as_dict[source]#
lca[source]#
unit[source]#
valid(dct: dict = None) None[source]#