Skip to content

Commit

Permalink
Added configure_settings_multistage
Browse files Browse the repository at this point in the history
  • Loading branch information
Maya Mutic authored and Maya Mutic committed May 16, 2024
1 parent ab6685c commit fba0db6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/case_runners/case_runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ end

function run_genx_case_multistage!(case::AbstractString, mysetup::Dict, optimizer::Any)
settings_path = get_settings_path(case)

# NEW: Call configure_settings_multistage(multistage_settings) to merge default settings with those specified in the YAML file
multistage_settings = get_settings_path(case, "multi_stage_settings.yml") # Multi stage settings YAML file path
mysetup["MultiStageSettingsDict"] = YAML.load(open(multistage_settings))
mysetup["MultiStageSettingsDict"] = configure_settings_multistage(multistage_settings)

### Cluster time series inputs if necessary and if specified by the user
if mysetup["TimeDomainReduction"] == 1
Expand Down
30 changes: 30 additions & 0 deletions src/configure_settings/configure_settings_multistage.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function default_settings_multistage()
Dict{Any, Any}("NumStages" => 3,
"StageLengths" => [10,10,10],
"WACC" => 0.045,
"ConvergenceTolerance" => 0.01,
"Myopic" => 0)
end

@doc raw"""
configure_settings(settings_path::String, output_settings_path::String)
Reads in the settings from the `multi_stage_settings.yml` YAML file and
merges them with the default multistage settings. It then returns the
settings dictionary.
# Arguments
- `settings_path::String`: The path to the multistage settings YAML file.
# Returns
- `settings::Dict`: The multistage settings dictionary.
"""
function configure_settings_multistage(settings_path::String)
println("Configuring Multistage Settings")
model_settings = YAML.load(open(settings_path))

settings = default_settings_multistage()
merge!(settings, model_settings)

return settings
end
1 change: 0 additions & 1 deletion src/write_outputs/write_outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ function write_outputs(EP::Model, path::AbstractString, setup::Dict, inputs::Dic
elapsed_time_power = @elapsed dfPower = write_power(path, inputs, setup, EP)
println("Time elapsed for writing power is")
println(elapsed_time_power)
println("Here")
end

if output_settings_d["WriteCharge"]
Expand Down

0 comments on commit fba0db6

Please sign in to comment.