polca / premise

Coupling Integrated Assessment Models output with Life Cycle Assessment.
BSD 3-Clause "New" or "Revised" License
101 stars 45 forks source link

ValueError: operands could not be broadcast together #110

Closed romainsacchi closed 5 months ago

romainsacchi commented 11 months ago

I'm using the version 1.6.1 of premise with 3.9 python. Using consequential modelling, when the program is running EXTRACTION IAM DATA there's an error message "ValueError: operands could not be broadcast together with shapes (20,) (19,)" on the function "binary_op" of the "variable.py" code file (code line 2705).

I've tried using a "normal" (cut-off) modelling and this error does not happen.

romainsacchi commented 11 months ago

Could you give me the script/scenarios you tried to run, so that I can reproduce the error?

KamikoNana commented 11 months ago

from premise import * from datapackage import Package

CREATE DATABSE FROM ECOSPOLD2 - CONSEQUENTIAL

args = {"range time":2, "duration":2, "foresight":False, "lead time":True, "capital replacement rate":False, "measurement": 1, "weighted slope start": 0.75, "weighted slope end": 1.00}

ndb = NewDatabase( scenarios=[ {"model":"remind", "pathway":"SSP1-Base", "year":2030}, {"model":"image", "pathway":"SSP1-Base", "year":2040}, {"model":"image", "pathway":"SSP1-Base", "year":2050}, {"model":"image", "pathway":"SSP1-Base", "year":2060}, ],

source_type="ecospold",
source_file_path=r"C:\Users\marta.tejada-ext\Desktop\databases tryout_premise\EcoinventConsequential",
source_db="EcoinventConsequential",
source_version="3.9.1",
key='xxxxxxxxxxxxxxxxxxxxxx', #i have an actual key

system_model="consequential",
system_args=args

)
KamikoNana commented 11 months ago

Do you think it can have something to do with the database I'm using? As presented in the script, is the EcoinventConsequential v.3.9.1. but the type is a SimaPro database

romainsacchi commented 11 months ago

Hey, no it is not related. I've identified the issue and will issue a fix. However, you cannot provide a Simapro database to premise. It has to be either a brightway database, or the ecospold files from the ecoinvent website.

romainsacchi commented 11 months ago

Hi @KamikoNana this should now be fixed with v.1.6.2, available in 5-10 minutes. Try with again, though not with a database in a Simapro format, but rather in ecospold format (decompress the 7z from the ecoinvent website and point to the datasets subfolder). You should be able to export it to a Simapro format afterwards. Let me know.

romainsacchi commented 10 months ago

Hi, any news? Is the issue persisting?

romainsacchi commented 5 months ago

Closing now. Re-open if the issue persists.