OSeMOSYS / osemosys_global

A global power system model generator for OSeMOSYS
https://osemosys-global.readthedocs.io/
GNU Affero General Public License v3.0
27 stars 14 forks source link

[BUG] Allow user_defined_capacity in no_invest_technologies #156

Closed SimoneOseiOwusu closed 1 year ago

SimoneOseiOwusu commented 1 year ago

Conda environment check

Current Behavior

My goal is to only allow investment in a technology in one specific year. To do this, I first set the technology as a 'no_invest_technologies' in the configuration file. Next, I added the planned investments to the 'user_defined_capacity' in configuration file. This causes TotalAnnualMaxCapacityInvestment to be defined twice in the data file.

Expected Behavior

I would expect the TotalAnnualMaxCapacityInvestment for user defined capacity to override the zero value of TotalAnnualMaxCapacityInvestment from the no_invest_technologies

Steps To Reproduce

  1. Add a technology to 'no_invest_technologies'
  2. Add the technology to user_defined_capacity for any year of the model horizon
  3. Run workflow

Operating System

macOS

Log output

GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
 -m resources/osemosys_fast_preprocessed.txt -d results/base_without_ic_/PreProcessed_base_without_ic_.txt
 --wlp results/base_without_ic_/base_without_ic_.lp --check
Reading model section from resources/osemosys_fast_preprocessed.txt...
1130 lines were read
Reading data section from results/base_without_ic_/PreProcessed_base_without_ic_.txt...
results/base_without_ic_/PreProcessed_base_without_ic_.txt:163169: TotalAnnualMaxCapacityInvestment[GLOBAL,PWRSPVAGOXX01,2024] already defined
Context:  GLOBAL TRNNAMXXZMBXX 2050 0 GLOBAL PWRSPVAGOXX01 2024 2.172
MathProg model processing error
[Thu Jun  8 08:07:25 2023]
Error in rule create_lp_file:
    jobid: 4
    output: results/base_without_ic_/base_without_ic_.lp
    log: results/base_without_ic_/logs/create_lp_file.log (check log file(s) for error message)
    shell:
        glpsol -m resources/osemosys_fast_preprocessed.txt -d results/base_without_ic_/PreProcessed_base_without_ic_.txt --wlp results/base_without_ic_/base_without_ic_.lp --check 2> results/base_without_ic_/logs/create_lp_file.log
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Anything else?

No response