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

errors importing exiobase in monetary units #254

Open mfastudillo opened 4 months ago

mfastudillo commented 4 months ago

using bw2io version 0.9.dev26 if I run

bw2io.bw2setup()
folder_path = Path().home()/'Downloads'
ex_monetary_2015 = folder_path / 'IOT_2015_pxp.zip'
ex = Exiobase3MonetaryImporter(ex_monetary_2015, "Exiobase 3.8.1 Monetary 2015")
ex.apply_strategies()
ex.write_database()

I get a KeyError

imagen

I have not explored the root cause in detail, that elementary flow seems to be in the correspondence table

https://github.com/brightway-lca/brightway2-io/blob/main/bw2io/data/lci/EXIOBASE-ecoinvent-biosphere.csv

If I query the new extra biosphere database created looking for HFC I get only

{'name': 'HFC (CO2-eq)',
 'unit': 'kilogram CO2-eq.',
 'categories': ('air',),
 'comment': 'Weird unit means no 1-to-n matches possible',
 'database': 'Exiobase 3.8.1 Monetary 2015 biosphere',
 'code': 'HFC (CO2-eq)',
 'id': 4825}
michaelweinold commented 1 month ago

Hello there! I will have a look at this next month. Feel free to ping me here if I have not updated the issue by then.