Skip to content

Commit

Permalink
Specify directly the backend when writing db with bw25
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Jul 27, 2024
1 parent 5028f3d commit 0e45ee8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion premise/brightway25.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from copy import copy

from bw2data import Database, databases
from bw2data.backends.iotable.backend import IOTableBackend
from bw2io.importers.base_lci import LCIImporter
from wurst.linking import change_db_name, check_internal_linking, link_internal

Expand Down Expand Up @@ -92,7 +93,8 @@ def biosphere_generator(data, lookup):
"flip": False,
}

Database(self.db_name).write_exchanges(
db = IOTableBackend(name=self.db_name)
db.write_exchanges(
technosphere_generator(self.data, lookup),
biosphere_generator(self.data, lookup),
list(dependents),
Expand Down
Binary file modified premise/data/additional_inventories/lci-biofuels.xlsx
Binary file not shown.

0 comments on commit 0e45ee8

Please sign in to comment.