Closed romainsacchi closed 4 years ago
I think I've come across something like this before, is it possible that at some point you imported data through brightway and used create_new_biosphere
method? I think that is the only method that quietly creates a 'file' database instead of defaulting to sqlite.
The easiest 'fix' on your end would be to remove the database through brightway. Probably not something you want to do.
Brightway2 code says we can iterate through a singlefile database, so some slight changes to the AB should fix the issue.
Together with the databases table there are 4 instances of len
being called on bw.Database
.
That could indeed be the issue. Thanks for the answer. I'll see in the meanwhile if I can do without the additional biosphere db.
Yes, I can reproduce the error in brighway2.
This would throw an error:
len(bw.Database("additional_biosphere"))
A short solution would be to use sum(1 for _ in bw.Database("additional_biosphere"))
where it counts all the activities.
Going through the code I've noticed a few other possible issues (bw.Database
is being pumped directly into a pandas DataFrame in the MetaDataStore
class) but I'm unsure if these require changes or if the __iter__
implementation in the SingleFileDatabase
allows all of that to work correctly.
Building a development version with the fix included now. Thanks for reporting this @romainsacchi and please don't hesitate to bring up any other issues you come across!
I am experiencing issues switching from one project to another, on the welcome page. The error thrown is the following:
The app does not totally crash, but the content of the project is not shown.