brightway-lca / brightway2

Metapackage for brightway2 imports and documentation
https://brightway.dev/
BSD 3-Clause "New" or "Revised" License
100 stars 37 forks source link

ExcelImporter write_database issue #80

Open danielPclos opened 4 months ago

danielPclos commented 4 months ago

Hi,

I'm trying to import an excel LCI with ExcelImporter. After successfully running the apply_strategies(), match_database(with 0 unlinked exchanges) and statistics(), the program crashes when running the write_database() method. Before that error however, it does load all the activities of the file to Brightway (confirmed by activity-browser inspection). The erro is: KeyError: ("name_of_the_loaded_database", "code_of_one_of_the_loaded_activities"). If I removed that activity from the excel file then I get the same error with another of the succesfully loaded activities.

Next if I try to run a minimalistic LCA on that inventory I get the following error: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\xxx\AppData\Local\pylca\Brightway3\name_project\processed\name_database_numbers.npy'

I suspect this file should have been created by write_database but didn't happen due to the error described above.

I attach a simplified version of the excell file with only 2 activities for reference.

Thanks in advance for any help on this issue.

Regards, Daniel lci_bw_minim.xlsx