-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
639 allow the user to define input and output file names #734
base: develop
Are you sure you want to change the base?
Changes from all commits
6b6c0e7
1b0319c
f420779
d2f85c2
606d747
e404b46
0dfc096
2c1a803
8377794
a760a44
77ca16f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#default_location: default/path/to/data | ||
# system | ||
#system_location: path/to/data | ||
demand: "Demand_data.csv" | ||
fuel: "Fuels_data.csv" | ||
generators: "Generators_variability.csv" | ||
|
||
# policies | ||
#policies_location: /path/to/data | ||
#co2_cap: file_or_table_name | ||
#minimum_capacity: file_or_table_name | ||
|
||
# resources | ||
|
||
# policy assignments |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
capacity: "Capacity_test.csv" | ||
capacity_factor: "capacityfactor.csv" | ||
charge: "charge.csv" | ||
charging_cost: "ChargingCost.csv" | ||
co2_prices: "CO2_prices_and_penalties.csv" | ||
commit: "commit.parquet" | ||
costs: "costs.parquet" | ||
curtail: "curtail.csv.gz" | ||
emissions_plant: "emissions_plant" | ||
nse: "nse.csv" | ||
power_balance: "power_balance.csv" | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
inputs_p1: | ||
resources_location: "inputs/inputs_p1/resources" | ||
resources: "Resource_multistage_data.csv" | ||
storage: "Storage.csv" | ||
thermal: "Thermal.csv" | ||
vre: "Vre.csv" | ||
policies_location: "inputs/inputs_p1/policies" | ||
co2_cap: "CO2_cap.csv" | ||
system_location: "inputs/inputs_p1/system" | ||
demand: "Demand_data.csv" | ||
fuel: "Fuels_data.csv" | ||
generators: "Generators_variability1.csv" | ||
network: "Network1.csv" | ||
|
||
inputs_p2: | ||
resources_location: "inputs/inputs_p1/resources" | ||
resources: "Resource_multistage_data.csv" | ||
storage: "Storage.csv" | ||
thermal: "Thermal.csv" | ||
vre: "Vre.csv" | ||
policies_location: "inputs/inputs_p2/policies" | ||
co2_cap: "CO2_cap.csv" | ||
system_location: "inputs/inputs_p2/system" | ||
demand: "Demand_data.csv" | ||
fuel: "Fuels_data.csv" | ||
generators: "Generators_variability.csv" | ||
network: "Network.csv" | ||
|
||
inputs_p3: | ||
resources_location: "inputs/inputs_p1/resources" | ||
resources: "Resource_multistage_data.csv" | ||
storage: "Storage.csv" | ||
thermal: "Thermal.csv" | ||
vre: "Vre.csv" | ||
policies_location: "inputs/inputs_p3/policies" | ||
co2_cap: "CO2_cap.csv" | ||
system_location: "inputs/inputs_p3/system" | ||
demand: "Demand_data.csv" | ||
fuel: "Fuels_data.csv" | ||
generators: "Generators_variability.csv" | ||
network: "Network.csv" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#default_location: default/path/to/data | ||
# system | ||
system_location: path/to/data | ||
demand: "Demand_data.csv" | ||
fuel: "Fuels_data.csv" | ||
generators: "Generators_variability.csv" | ||
|
||
# policies | ||
#policies_location: /path/to/data | ||
#co2_name: file_or_table_name | ||
#minimum_capacity_name: file_or_table_name | ||
|
||
# resources | ||
|
||
|
||
# policy assignments |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
capacity: "Capacity_test.csv" | ||
capacity_factor: "capacityfactor.csv" | ||
charge: "charge.csv" | ||
charging_cost: "ChargingCost.csv" | ||
co2_prices: "CO2_prices_and_penalties.csv" | ||
commit: "commit.parquet" | ||
costs: "costs.parquet" | ||
curtail: "curtail.csv.gz" | ||
emissions_plant: "emissions_plant" | ||
nse: "nse.csv" | ||
power_balance: "power_balance.csv" | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -31,19 +31,18 @@ run_genx_case!("path/to/case", Gurobi.Optimizer) | |||||||||||||
function run_genx_case!(case::AbstractString, optimizer::Any = HiGHS.Optimizer) | ||||||||||||||
genx_settings = get_settings_path(case, "genx_settings.yml") # Settings YAML file path | ||||||||||||||
writeoutput_settings = get_settings_path(case, "output_settings.yml") # Write-output settings YAML file path | ||||||||||||||
mysetup = configure_settings(genx_settings, writeoutput_settings) # mysetup dictionary stores settings and GenX-specific parameters | ||||||||||||||
|
||||||||||||||
mysetup = configure_settings(genx_settings, writeoutput_settings, case) # mysetup dictionary stores settings and GenX-specific parameters | ||||||||||||||
if mysetup["MultiStage"] == 0 | ||||||||||||||
run_genx_case_simple!(case, mysetup, optimizer) | ||||||||||||||
else | ||||||||||||||
run_genx_case_multistage!(case, mysetup, optimizer) | ||||||||||||||
end | ||||||||||||||
end | ||||||||||||||
|
||||||||||||||
function time_domain_reduced_files_exist(tdrpath) | ||||||||||||||
tdr_demand = file_exists(tdrpath, ["Demand_data.csv", "Load_data.csv"]) | ||||||||||||||
tdr_genvar = isfile(joinpath(tdrpath, "Generators_variability.csv")) | ||||||||||||||
tdr_fuels = isfile(joinpath(tdrpath, "Fuels_data.csv")) | ||||||||||||||
function time_domain_reduced_files_exist(tdrpath, setup::Dict) | ||||||||||||||
tdr_demand = isfile(joinpath(tdrpath, setup["demand"])) | ||||||||||||||
tdr_genvar = isfile(joinpath(tdrpath, setup["generators"])) | ||||||||||||||
tdr_fuels = isfile(joinpath(tdrpath, setup["fuel"])) | ||||||||||||||
return (tdr_demand && tdr_genvar && tdr_fuels) | ||||||||||||||
end | ||||||||||||||
|
||||||||||||||
|
@@ -54,8 +53,8 @@ function run_genx_case_simple!(case::AbstractString, mysetup::Dict, optimizer::A | |||||||||||||
if mysetup["TimeDomainReduction"] == 1 | ||||||||||||||
TDRpath = joinpath(case, mysetup["TimeDomainReductionFolder"]) | ||||||||||||||
system_path = joinpath(case, mysetup["SystemFolder"]) | ||||||||||||||
prevent_doubled_timedomainreduction(system_path) | ||||||||||||||
if !time_domain_reduced_files_exist(TDRpath) | ||||||||||||||
prevent_doubled_timedomainreduction(system_path, mysetup["WriteInputNamesDict"]) | ||||||||||||||
if !time_domain_reduced_files_exist(TDRpath, mysetup["WriteInputNamesDict"]) | ||||||||||||||
println("Clustering Time Series Data (Grouped)...") | ||||||||||||||
cluster_inputs(case, settings_path, mysetup) | ||||||||||||||
else | ||||||||||||||
|
@@ -108,7 +107,7 @@ function run_genx_case_multistage!(case::AbstractString, mysetup::Dict, optimize | |||||||||||||
settings_path = get_settings_path(case) | ||||||||||||||
multistage_settings = get_settings_path(case, "multi_stage_settings.yml") # Multi stage settings YAML file path | ||||||||||||||
# merge default settings with those specified in the YAML file | ||||||||||||||
mysetup["MultiStageSettingsDict"] = configure_settings_multistage(multistage_settings) | ||||||||||||||
mysetup["MultiStageSettingsDict"] = configure_settings_multistage(case,multistage_settings) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [JuliaFormatter] reported by reviewdog 🐶
Suggested change
|
||||||||||||||
|
||||||||||||||
### Cluster time series inputs if necessary and if specified by the user | ||||||||||||||
if mysetup["TimeDomainReduction"] == 1 | ||||||||||||||
|
@@ -118,8 +117,11 @@ function run_genx_case_multistage!(case::AbstractString, mysetup::Dict, optimize | |||||||||||||
first_stage_path = joinpath(case, "inputs", "inputs_p1") | ||||||||||||||
TDRpath = joinpath(first_stage_path, mysetup["TimeDomainReductionFolder"]) | ||||||||||||||
system_path = joinpath(first_stage_path, mysetup["SystemFolder"]) | ||||||||||||||
prevent_doubled_timedomainreduction(system_path) | ||||||||||||||
if !time_domain_reduced_files_exist(TDRpath) | ||||||||||||||
|
||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [JuliaFormatter] reported by reviewdog 🐶
Suggested change
|
||||||||||||||
mysetup["MultiStageSettingsDict"]["CurStage"] = 1 # Define current stage for cluster_inputs to access input_names dictionary at stage 1 | ||||||||||||||
|
||||||||||||||
prevent_doubled_timedomainreduction(system_path, mysetup["WriteInputNamesDict"]["inputs_p1"]) | ||||||||||||||
if !time_domain_reduced_files_exist(TDRpath, mysetup["WriteInputNamesDict"]["inputs_p1"]) | ||||||||||||||
Comment on lines
+123
to
+124
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [JuliaFormatter] reported by reviewdog 🐶
Suggested change
|
||||||||||||||
if (mysetup["MultiStage"] == 1) && | ||||||||||||||
(TDRSettingsDict["MultiStageConcatenate"] == 0) | ||||||||||||||
println("Clustering Time Series Data (Individually)...") | ||||||||||||||
|
@@ -148,9 +150,7 @@ function run_genx_case_multistage!(case::AbstractString, mysetup::Dict, optimize | |||||||||||||
mysetup["MultiStageSettingsDict"]["CurStage"] = t | ||||||||||||||
|
||||||||||||||
# Step 1) Load Inputs | ||||||||||||||
inpath_sub = joinpath(case, "inputs", string("inputs_p", t)) | ||||||||||||||
|
||||||||||||||
inputs_dict[t] = load_inputs(mysetup, inpath_sub) | ||||||||||||||
inputs_dict[t] = load_inputs(mysetup, case) | ||||||||||||||
inputs_dict[t] = configure_multi_stage_inputs(inputs_dict[t], | ||||||||||||||
mysetup["MultiStageSettingsDict"], | ||||||||||||||
mysetup["NetworkExpansion"]) | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶