-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in writing superstructure #190
Comments
Hi @OliverLyon, can you paste the script you used? |
@OliverLyon can you check that you have a flow called:
|
Hi @romainsacchi, the script is pasted below: from bw2data import databases ndb = NewDatabase( ndb.write_superstructure_db_to_brightway(name="test_superstructure"), |
cx
I used the following code to check the flow Nickel, ion: import bw2data as bd bd.projects.set_current('yourProject') importer = SingleOutputEcospold2Importer( importer.drop_unlinked(True) importer.write_database() bio = bd.Database(db_name) nickel_ion_flows = bio.search('Nickel, ion') filtered_flows = [flow for flow in nickel_ion_flows if 'water, ground' in flow['categories']] if filtered_flows: I gave me an output of 'No flows found for 'Nickel, ion' in 'water, ground'. Is it the correct way to check the flow? |
Not exactly. This flow should be found in your |
@OliverLyon, has your |
No, did not use activity browser for the project, right now I'm just trying to import the database file and output the superstructure with scenarios. |
Hello! im having a very similar problem. This is the script that im using: Set up Brightway projectBW_PROJECT = 'premise_project' # name your project bw.projects.set_current(BW_PROJECT) Validate biosphere3 databaseif "biosphere3" not in databases: Check if ecoinvent database is already imported; if not, proceed with importif EI_DATABASE in bw.databases:
and: from premise import * Step 3: Migrate the Project to Brightway 2.5 Format#print("Migrating the project to Brightway 2.5 format if necessary...") Activate the Brightway projectbw2data.projects.set_current("premise_project") # Select the project where you want the database to be created List currently installed databasesprint("Databases in the project:", bw2data.databases) Define the IAM scenarios for 2030, 2040, and 2050scenarios = [ Create the Premise NewDatabase objectndb = NewDatabase( Update all sectors with IAM dataprint("Updating database with IAM scenarios...") Step 1: Rename Databases for Simplicitysimple_names = { Step 2: Register Databases with Simple Namesfor original_name, simple_name in simple_names.items(): Optional: Superstructure DatabaseThis step is skipped if simple naming is only needed for individual databasesndb.write_superstructure_db_to_brightway()print("Premise scenarios for 2030, 2040, and 2050 successfully created, renamed, and registered!") Write individual databasesndb.write_db_to_brightway() Thanks a lot, |
Hi @33nickels , you do not need to run the biosphere function. |
I was trying to write the scenarios created from ecoinvent 3.7.1 based on the inbuilt scenarios using:
ndb.write_superstructure_db_to_brightway(name="test_superstructure"),
It gave me an error of:
UnknownObject: Exchange between ('biosphere3', 'e030108f-2125-4bcb-a73b-ad72130fcca3') and ('test_superstructure', '00110620-4d86-4fd5-82d3-3cf415a4b941') is invalid - one of these objects is unknown (i.e. doesn't exist as a process dataset)
Does anyone know what unknown object it is referring to and how to solve this problem?
Thanks
The text was updated successfully, but these errors were encountered: