OSeMOSYS / OSeMOSYS_Pyomo

The Pyomo implementation of OSeMOSYS
Apache License 2.0
15 stars 13 forks source link

Addition of RE production target constraints #9

Closed ThomasHeggarty closed 4 years ago

ThomasHeggarty commented 4 years ago

As agreed. Closes #8

willu47 commented 4 years ago

I've added a simple test which runs the model using the included UTOPIA model. I notice that these changes have caused the test to fail with the following error:

$ pyomo solve --solver=glpk osemosys.py UTOPIA_2015_08_27.dat
[    0.00] Setting up Pyomo environment
[    0.00] Applying Pyomo preprocessing actions
[    0.34] Creating model
ERROR: Rule failed when generating expression for constraint
    FuelProductionByTechnologyAnnual with index ('UTOPIA', 'E01', 'CSV',
    1990): KeyError: "Index '('UTOPIA', 'E01', 'CSV', 1990, 'ID')' is not
    valid for indexed component 'ProductionByTechnology'"
ERROR: Constructing component 'FuelProductionByTechnologyAnnual' from
    data=None failed:
        KeyError: "Index '('UTOPIA', 'E01', 'CSV', 1990, 'ID')' is not valid
        for indexed component 'ProductionByTechnology'"
[    9.55] Pyomo Finished
ERROR: Unexpected exception while running model:
        Index '('UTOPIA', 'E01', 'CSV', 1990, 'ID')' is not valid for indexed
        component 'ProductionByTechnology'
The command "pyomo solve --solver=glpk osemosys.py UTOPIA_2015_08_27.dat" exited with 1.
ThomasHeggarty commented 4 years ago

Sorry about this, it is due to an inconsistency in the order in which sets appear in constraint definitions. Here is the correction.

ThomasHeggarty commented 4 years ago

OSeMOSYS_11_06_20.py.txt

willu47 commented 4 years ago

@ThomasHeggarty - if you just make another commit on this same branch, you're changes will update the pull request.

ThomasHeggarty commented 4 years ago

@willu47 - Sorry, still trying to get my head around github.