brightway-lca / brightway2-io

Importing and exporting for the Brightway LCA framework
BSD 3-Clause "New" or "Revised" License
26 stars 40 forks source link

All methods' metadata['unit'] are 'Unknown' when importing Ecoinvent with ecoinvent_interface and using namespaced methods #274

Closed tngTUDOR closed 5 days ago

tngTUDOR commented 6 days ago

Current

When importing ecoinvent using ecoinvent_interface all the units in the methods end up being "Unknown".

Expected

the metadata item 'unit' for the methods are set to the values from the xlsx LCIA Implementation spreadsheet.

tngTUDOR commented 6 days ago

When the key is recovered at:

https://github.com/brightway-lca/brightway2-io/blob/79c3fbe9613662d535afe6ac4391af4a8933cdab/bw2io/ecoinvent.py#L383

it's probably not found when namespaced methods are used.

the units_mapping is built earlier with:

https://github.com/brightway-lca/brightway2-io/blob/79c3fbe9613662d535afe6ac4391af4a8933cdab/bw2io/ecoinvent.py#L297-L300

but when using namespaced methods, the key of the units_mapping is missing the namespace