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

New units in ei39 missed by bw2io #173

Closed romainsacchi closed 11 months ago

romainsacchi commented 1 year ago

I believe there are new units in ei39 (e.g., "Sm3", "kg*day") which are not cleaned/normalized by bw2io 0.8.8. Not really an issue in itself, but more like an aesthetic thing.

BenPortner commented 1 year ago

I can't find Sm3 in my db. Is this a bug?

import bw2data as bd
bd.projects.set_current("my_project")
{a["unit"] for a in bd.Database("cutoff391")}
Out[5]: 
{'cubic meter',
 'guest night',
 'hectare',
 'hour',
 'kg*day',
 'kilogram',
 'kilometer',
 'kilometer-year',
 'kilowatt hour',
 'litre',
 'megajoule',
 'meter',
 'meter-year',
 'person kilometer',
 'square meter',
 'square meter-year',
 'ton kilometer',
 'unit'}
romainsacchi commented 1 year ago

Strange. For "nylon 6 production, RoW", the output of "Gas, natural" is in "Sm3" in ei 39. Can you confirm you have the correct unit for that flow (which I. guess should be "cubic meter")?

romainsacchi commented 1 year ago

I see the same in ei391.

BenPortner commented 1 year ago

That's the biosphere, then:

{a["unit"] for a in bd.Database("biosphere3")}
Out[6]: 
{'EUR2005',
 'Sm3',
 'cubic meter',
 'cubic meter-year',
 'kilo Becquerel',
 'kilogram',
 'megajoule',
 'square meter',
 'square meter-year'}
romainsacchi commented 1 year ago

Yes, the biosphere for ei39 that comes with bw2io 0.8.8.

BenPortner commented 1 year ago

Can you confirm you have the correct unit for that flow (which I. guess should be "cubic meter")?

I feel like we should avoid normalizing Sm3 to cubic meter. This would lead to a loss of information, as standard cubic meter is more precise than just cubic meter (namely a cubic meter at standard pressure and standard temperature). As to renaming Sm3 to something more descriptive like standard cubic meter, I am open. Same for kg*day. Any suggestions here @romainsacchi?

romainsacchi commented 1 year ago

I don't know. Unless I'm wrong, natural gas datasets, for example, refer to cubic meters in standard conditions and use the unit cubic meter. So, in several cases, cubic meter already signifies Sm3.