bw2io.strategies.simapro#

Module Contents#

Functions#

change_electricity_unit_mj_to_kwh(db)

Change datasets with the string electricity in their name from units of MJ to kilowatt hour.

fix_localized_water_flows(db)

Change Water, BR to Water.

fix_zero_allocation_products(db)

Drop all inputs from allocated products which had zero allocation factors.

link_technosphere_based_on_name_unit_location(db[, ...])

Link technosphere exchanges based on name, unit, and location. Can't use categories because we can't reliably extract categories from SimaPro exports, only exchanges.

normalize_simapro_biosphere_categories(db)

Normalize biosphere categories to ecoinvent standard.

normalize_simapro_biosphere_names(db)

Normalize biosphere flow names to ecoinvent standard

normalize_simapro_formulae(formula, settings)

Convert SimaPro formulae to Python

set_lognormal_loc_value_uncertainty_safe(db)

Make sure loc value is correct for lognormal uncertainty distributions

sp_allocate_products(db)

Create a dataset from each product in a raw SimaPro dataset

split_simapro_name_geo(db)

Split a name like 'foo/CH U' into name and geo components.

Attributes#

detoxify_pattern

detoxify_re

bw2io.strategies.simapro.change_electricity_unit_mj_to_kwh(db)[source]#

Change datasets with the string electricity in their name from units of MJ to kilowatt hour.

bw2io.strategies.simapro.fix_localized_water_flows(db)[source]#

Change Water, BR to Water.

Biosphere flows can’t have locations - locations are defined by the activity dataset.

bw2io.strategies.simapro.fix_zero_allocation_products(db)[source]#

Drop all inputs from allocated products which had zero allocation factors.

The final production amount is the initial amount times the allocation factor. If this is zero, a singular technosphere matrix is created. We fix this by setting the production amount to one, and deleting all inputs.

Does not modify datasets with more than one production exchange.

Link technosphere exchanges based on name, unit, and location. Can’t use categories because we can’t reliably extract categories from SimaPro exports, only exchanges.

If external_db_name, link against a different database; otherwise link internally.

bw2io.strategies.simapro.normalize_simapro_biosphere_categories(db)[source]#

Normalize biosphere categories to ecoinvent standard.

bw2io.strategies.simapro.normalize_simapro_biosphere_names(db)[source]#

Normalize biosphere flow names to ecoinvent standard

bw2io.strategies.simapro.normalize_simapro_formulae(formula, settings)[source]#

Convert SimaPro formulae to Python

bw2io.strategies.simapro.set_lognormal_loc_value_uncertainty_safe(db)[source]#

Make sure loc value is correct for lognormal uncertainty distributions

bw2io.strategies.simapro.sp_allocate_products(db)[source]#

Create a dataset from each product in a raw SimaPro dataset

bw2io.strategies.simapro.split_simapro_name_geo(db)[source]#

Split a name like ‘foo/CH U’ into name and geo components.

Sets original name to simapro name.

bw2io.strategies.simapro.detoxify_pattern = '^(?P<name>.+?)/(?P<geo>[A-Za-z]{2,10})(/I)? [SU]$'[source]#
bw2io.strategies.simapro.detoxify_re[source]#