Skip to content
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

Memory Error unsing Premise #195

Open
git-htw opened this issue Feb 24, 2025 · 4 comments
Open

Memory Error unsing Premise #195

git-htw opened this issue Feb 24, 2025 · 4 comments

Comments

@git-htw
Copy link

git-htw commented Feb 24, 2025

Hi, I am currently trying to generate my first prospective scenarios using the Activity Browser for the foreground systems of concrete recycling. Now, I have attempted to generate a superstructured database using Premise.

I created a new environment with Premise 2.2.7 and ecoinvent 3.6 (brightway, newest version).

Maybe I am making a logical error, but at the moment, I am trying to convert the entire ecoinvent database combined with (initially) one SSP-based scenario for 2030. This results in a database of around 33GB, and I keep running into a memory error. I guess my 16GB DDR3 RAM can't handle the workload.

Is there any shortcut to generate the database in smaller steps? My goal is to create one superstructured database for 2030, 2040, and 2050, with, let's say, three variations of the IMAGE scenarios.

my script:

import os
import sys
import warnings
import time
import pandas as pd
import bw2io as bi
import brightway2 as bw
from premise import *
import bw2data as bd
from premise import NewDatabase
from datapackage import Package

Setze das gewünschte Projekt

bw.projects.set_current("LCa Beton recycling")

Überprüfe das aktuelle Projekt

print("Current project set to: ", bw.projects.current)

Zeige das aktuelle Arbeitsverzeichnis

print("Current working directory: ", os.getcwd(), "\n")

activate a brightway project containing the ecoinvent database

bw.projects.set_current("LCa Beton recycling")

ndb = NewDatabase(

scenarios=[
    {"model":"image", "pathway":"SSP2-RCP19", "year":2030}
    
    
],
source_db="eco26-cutoff", 
source_version="3.6" 

)
ndb.update(create_superstructure=True)
ndb.write_db_to_brightway()

print(f"Datenbank wurde erfolgreich erstellt und gespeichert.")
input()

@romainsacchi
Copy link
Collaborator

Hi @git-htw,

these lines are incorrect:

ndb.update(create_superstructure=True)
ndb.write_db_to_brightway()

it should be:

ndb.update()
ndb.write_superstructure_db_to_brightway()

@git-htw
Copy link
Author

git-htw commented Mar 3, 2025

hey thanks for the reply! i will let it run a second time!

@romainsacchi
Copy link
Collaborator

Hi @git-htw, did it work?

@git-htw
Copy link
Author

git-htw commented Mar 10, 2025

no unfortunally not, i will try it with a better hardware and then response again. hope that it works. Thanks for asking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants