Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed Sep 13, 2024
2 parents 2745091 + 407a0b4 commit eee59c5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* Add `create_products_as_new_nodes` strategy

### 0.9.DEV38 (2024-09-12)

* Fix #274: correctly set units for namespaced methods when importing ecoinvent with ecoinvent_interface

### 0.9.DEV37 (2024-09-04)

* Fix out of order but with `create_randonneur_excel_template_for_unlinked`
Expand Down
2 changes: 1 addition & 1 deletion bw2io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"useeio20",
]

__version__ = "0.9.DEV37"
__version__ = "0.9.DEV38"

from .backup import (
backup_data_directory,
Expand Down
19 changes: 15 additions & 4 deletions bw2io/ecoinvent.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,21 @@ def import_ecoinvent_release(
}
cf_col_label = CF_COLUMN_LABELS.get(version, "cf")
units_col_label = pick_a_unit_label_already(units[0])
units_mapping = {
(row["method"], row["category"], row["indicator"]): row[units_col_label]
for row in units
}
if namespace_lcia_methods:
units_mapping = {
(
f"ecoinvent-{version}",
row["method"],
row["category"],
row["indicator"],
): row[units_col_label]
for row in units
}
else:
units_mapping = {
(row["method"], row["category"], row["indicator"]): row[units_col_label]
for row in units
}

biosphere_mapping = {}
for flow in bd.Database(biosphere_name):
Expand Down

0 comments on commit eee59c5

Please sign in to comment.