bw2io.data#

Submodules#

Attributes#

Functions#

_add_new_ecoinvent_biosphere_flows(version)

add_example_database([overwrite, searchable])

add_suffix(→ pathlib.Path)

convert_ecoinvent_2_301()

Write a migrations data file from ecoinvent 2 to 3.1.

convert_lcia_methods_data()

convert_simapro_ecoinvent_3_migration_data()

convert_simapro_ecoinvent_elementary_flows()

Write a correspondence list from SimaPro elementary flow names to ecoinvent 3 flow names to a JSON file.

get_biosphere_2_3_category_migration_data()

Get data for 2 -> 3 migration for biosphere flow categories

get_biosphere_2_3_name_migration_data()

Get migration data for 2 -> 3 biosphere flow names.

get_csv_example_filepath()

get_ecoinvent_pre35_migration_data()

get_exiobase_biosphere_migration_data()

Migrate to ecoinvent3 flow names

get_sheet(path, name)

get_simapro_ecoinvent_3_migration_data(version)

Write a migrations data file from SimaPro activity names to ecoinvent 3 processes.

get_simapro_water_migration_data()

get_us_lci_migration_data()

Fix US LCI database name inconsistencies

get_valid_geonames()

Get list of short location names used in ecoinvent 3

get_xlsx_example_filepath()

update_db_ecoinvent_locations(database_name)

Update ecoinvent location names for an existing database.

write_json_file(data, name)

Package Contents#

bw2io.data._add_new_ecoinvent_biosphere_flows(version)[source]#
bw2io.data.add_example_database(overwrite=True, searchable=True)[source]#
bw2io.data.add_suffix(root: pathlib.Path | str, suffix: str) pathlib.Path[source]#
bw2io.data.convert_ecoinvent_2_301()[source]#

Write a migrations data file from ecoinvent 2 to 3.1.

This is not simple, unfortunately. We have to deal with at least the following:
  • Unit changes (e.g. cubic meters to MJ)

  • Some datasets are deleted, and replaced by others

bw2io.data.convert_lcia_methods_data()[source]#
bw2io.data.convert_simapro_ecoinvent_3_migration_data()[source]#
bw2io.data.convert_simapro_ecoinvent_elementary_flows()[source]#

Write a correspondence list from SimaPro elementary flow names to ecoinvent 3 flow names to a JSON file.

Uses custom SimaPro specific data. Ecoinvent 2 -> 3 conversion is in a separate JSON file.

bw2io.data.get_biosphere_2_3_category_migration_data()[source]#

Get data for 2 -> 3 migration for biosphere flow categories

bw2io.data.get_biosphere_2_3_name_migration_data()[source]#

Get migration data for 2 -> 3 biosphere flow names.

This migration must be applied only after categories have been updated.

Note that the input data excel sheet is modified from the raw data provided by ecoinvent - some biosphere flows which had no equivalent in ecospold2 were mapped using my best judgment. Name changes from 3.1 were also included. Modified cells are marked in dark orange.

Note that not all rows have names in ecoinvent 3. There are a few energy resources that we don’t update. For water flows, the categories are updated by a different strategy, and the names don’t change, so we just ignore them for now.

bw2io.data.get_csv_example_filepath()[source]#
bw2io.data.get_ecoinvent_pre35_migration_data()[source]#
bw2io.data.get_exiobase_biosphere_migration_data()[source]#

Migrate to ecoinvent3 flow names

bw2io.data.get_sheet(path, name)[source]#
bw2io.data.get_simapro_ecoinvent_3_migration_data(version)[source]#

Write a migrations data file from SimaPro activity names to ecoinvent 3 processes.

Correspondence file is processed from Pré, and has the following fields:

  1. SimaPro name

  2. Ecoinvent flow name

  3. Location

  4. Ecoinvent activity name

  5. System model

  6. SimaPro type

Note that even the official matching data from Pré is incorrect, but works if we cast all strings to lower case.

SimaPro type is either System terminated or Unit process. We always match to unit processes regardless of SimaPro type.

bw2io.data.get_simapro_water_migration_data()[source]#
bw2io.data.get_us_lci_migration_data()[source]#

Fix US LCI database name inconsistencies

bw2io.data.get_valid_geonames()[source]#

Get list of short location names used in ecoinvent 3

bw2io.data.get_xlsx_example_filepath()[source]#
bw2io.data.update_db_ecoinvent_locations(database_name)[source]#

Update ecoinvent location names for an existing database.

Returns number of modified datasets.

bw2io.data.write_json_file(data, name)[source]#
bw2io.data.add_ecoinvent_33_biosphere_flows[source]#
bw2io.data.add_ecoinvent_34_biosphere_flows[source]#
bw2io.data.add_ecoinvent_35_biosphere_flows[source]#
bw2io.data.add_ecoinvent_36_biosphere_flows[source]#
bw2io.data.add_ecoinvent_37_biosphere_flows[source]#
bw2io.data.add_ecoinvent_38_biosphere_flows[source]#
bw2io.data.add_ecoinvent_39_biosphere_flows[source]#
bw2io.data.dirpath[source]#