bw2io.extractors.ecospold1#

Module Contents#

Classes#

Ecospold1DataExtractor

Functions#

getattr2(obj, attr1, attr2)

class bw2io.extractors.ecospold1.Ecospold1DataExtractor[source]#

Bases: object

classmethod extract(path, db_name, use_mp=True)[source]#

Extract data from ecospold1 files.

Parameters#

pathstr

Path to the directory containing the ecospold1 files or path to a single file.

db_namestr

Name of the database.

use_mpbool, optional

If True, uses multiprocessing to parallelize extraction of data from multiple files, by default True.

Returns#

list

List of dictionaries containing data from the ecospold1 files.

classmethod is_valid_ecospold1(dataset)[source]#

Check if a dataset is a valid ecospold1 file.

Parameters#

datasetlxml.objectify.ObjectifiedElement

A dataset from an ecospold1 file.

Returns#

bool

True if the dataset is a valid ecospold1 file, False otherwise.

classmethod process_allocation(exc, dataset)[source]#
classmethod process_dataset(dataset, filename, db_name)[source]#
classmethod process_exchange(exc, dataset)[source]#

Process exchange.

Input groups are:

  1. Materials/fuels

  2. Electricity/Heat

  3. Services

  4. FromNature

  5. FromTechnosphere

Output groups are:

  1. Reference product

  2. Include avoided product system

  3. Allocated byproduct

  4. Waste to treatment

  5. ToNature

A single-output process will have one output group 0; A MO process will have multiple output group 2s. Output groups 1 and 3 are not used in ecoinvent.

classmethod process_exchanges(dataset)[source]#
classmethod process_file(filepath, db_name)[source]#

Process a single ecospold1 file.

Parameters#

filepathstr

Path to the ecospold1 file.

db_namestr

Name of the database.

Returns#

list

List of dictionaries containing data from the ecospold1 file.

classmethod process_uncertainty_fields(exc, data)[source]#
bw2io.extractors.ecospold1.getattr2(obj, attr1, attr2)[source]#