LCA-ActivityBrowser / activity-browser

GUI for brightway2
GNU Lesser General Public License v3.0
152 stars 58 forks source link

Fail Excel import/export #815

Open MaximeAgez opened 2 years ago

MaximeAgez commented 2 years ago

Hi,

Lately I've had a lot of failing exports when trying to share my databases with colleagues. Here is the error I get:

image

I think I traced the origin of the problem. For some reason, ecoinvent processes exported through an Excel have the "classifications" column appear as full of nans

image

These nans create an issue when the data is create in peewee, because the code in bw2data/backends/peewee/proxies.py is looking for a key of an empty object (I assume it's empty because classifications are nans)

image

I am fairly confident it's the origin of the problem because I created a test database in which I only exported an ecoinvent process (ecoinvent3.8) and tried to re-import it into another project, but on the same machine, same AB and it still failed.

I'm using AB 2.6.9 and bw2data 3.6.5

marc-vdm commented 2 years ago

Thanks for letting us know.

Could you let us know if this also happens when exporting to .bw2package format? I'm aware this doesn't export parameters and may not be a solution for you, but will help us narrow down the issue.

@cmutel further thoughts? This looks like it may be something in BW2

MaximeAgez commented 2 years ago

No problem with the .bw2package format.