GenXProject / GenX.jl

GenX: a configurable power system capacity expansion model for studying low-carbon energy futures. More details at : https://genx.mit.edu
https://genxproject.github.io/GenX.jl/
GNU General Public License v2.0
266 stars 113 forks source link

ERROR: write_multi_stage_capacities_discharge not defined #276

Closed sambuddhac closed 1 year ago

sambuddhac commented 1 year ago

I came across this bug while running comprehensive tests on all the example cases on GenX for my ongoing language upgrade and Stochastic GenX reformulation work. It's surprising that I didn't run into this error while testing the last DDP upgrade from Jack. If some things have changed since then, I will be on the way to tracking that down. In the mean time, if @dharik13 , @xuqingyu or @jf-morris has quick fix, would be great.

ERROR: LoadError: UndefVarError: write_multi_stage_capacities_discharge not defined
Stacktrace:
 [1] write_multi_stage_outputs(stats_d::Dict{Any, Any}, outpath::String, settings_d::Dict{Any, Any}, inputs_dict::Dict{Any, Any})
   @ GenX ~/code/GenX_Clone/GenX/src/multi_stage/dual_dynamic_programming.jl:279
 [2] run_genx_case_multistage!(case::String, mysetup::Dict{Any, Any})
   @ GenX ~/code/GenX_Clone/GenX/src/case_runners/case_runner.jl:179
 [3] run_genx_case!(case::String)
   @ GenX ~/code/GenX_Clone/GenX/src/case_runners/case_runner.jl:39
 [4] top-level scope
   @ ~/code/GenX_Clone/GenX/Example_Systems/SmallNewEngland/OneZone_MultiStage/Run.jl:19
 [5] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [6] top-level scope
   @ REPL[3]:1
in expression starting at /Users/sc87/code/GenX_Clone/GenX/Example_Systems/SmallNewEngland/OneZone_MultiStage/Run.jl:19
dharik13 commented 1 year ago

You need to include the following files in GenX.jl - they are currently not in it. hence it cannot find the functions.

write_multi_stage_capacities_discharge(outpath, multi_stage_settings_d)
write_multi_stage_capacities_charge(outpath, multi_stage_settings_d)
write_multi_stage_capacities_energy(outpath, multi_stage_settings_d)
write_multi_stage_network_expansion(outpath, multi_stage_settings_d)
write_multi_stage_costs(outpath, multi_stage_settings_d, inputs_dict)
write_multi_stage_stats(outpath, stats_d)
sambuddhac commented 1 year ago

@dharik13 I just added those lines and came across a few more bugs while testing. But, I think, I now have a good idea of the fix. PR coming your way soon !!!!

sambuddhac commented 1 year ago

PR #227 fixes this.

sambuddhac commented 1 year ago

Merging of PR #277 to Develop has fixed this issue. Subsequent merge to main branch before patch release 0.3.3 under the way.