Skip to content

Commit d489262

Browse files
Maya MuticMaya Mutic
authored andcommitted
Added error message to configure_settings
1 parent 6b9eb39 commit d489262

6 files changed

Lines changed: 28 additions & 7 deletions

File tree

example_systems/10_three_zones_define_input/settings/genx_settings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ MaxCapReq: 0
1010
MinCapReq: 1
1111
CO2Cap: 2
1212
WriteShadowPrices: 1
13-
ResultsFileType: "auto_detect"
13+
ResultsFileType: "hfedujh"
1414
ResultsCompressionType: "auto_detect"
1515
OutputFullTimeSeries: 1

example_systems/10_three_zones_define_input/settings/input_settings.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#default_location: default/path/to/data
22
# system
3-
#system_location: path/to/data
4-
demand: "Demand_data.csv"
5-
fuel: "Fuels_data.csv.gz"
6-
generators: "Generators_variability.csv"
3+
system_location: path/to/data
4+
- demand: "Demand_data.csv"
5+
- fuel: "Fuels_data.csv.gz"
6+
- generators: "Generators_variability.csv"
77

88
# policies
99
#policies_location: /path/to/data
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#default_location: default/path/to/data
2+
# system
3+
#system_location: path/to/data
4+
demand: "Demand_data.csv"
5+
fuel: "Fuels_data.csv.gz"
6+
generators: "Generators_variability.csv"
7+
8+
# policies
9+
#policies_location: /path/to/data
10+
#co2_name: file_or_table_name
11+
#minimum_capacity_name: file_or_table_name
12+
13+
# resources
14+
15+
16+
# policy assignments

src/configure_settings/configure_settings.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ function configure_settings(settings_path::String, output_settings_path::String,
6161
settings = default_settings()
6262
merge!(settings, model_settings)
6363

64+
println(settings)
65+
if settings["ResultsFileType"] ["auto_detect",".csv.gz",".parquet",".json",".json.gz","csv","parquet","json","csv.gz","json.gz"]
66+
throw("Results File Type in genx_settings.yml is not accepted. Acceptable types are csv, csv.gz, parquet, json, and json.gz.")
67+
end
68+
6469
output_settings = configure_writeoutput(output_settings_path, settings)
6570
settings["WriteOutputsSettingsDict"] = output_settings
6671

src/write_outputs/ucommit/write_commit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function write_commit(path::AbstractString, inputs::Dict, setup::Dict, EP::Model
1212
auxNew_Names = [Symbol("Resource"); Symbol("Zone"); [Symbol("t$t") for t in 1:T]]
1313
rename!(dfCommit, auxNew_Names)
1414

15-
#CSV.write(joinpath(path, "commit.csv"), dftranspose(dfCommit, false), header = false)
15+
CSV.write(joinpath(path, "commit.csv"), dftranspose(dfCommit, false), header = false)
1616
dfCommit = dftranspose(dfCommit,false)
1717
rename!(dfCommit, Symbol.(Vector(dfCommit[1,:])))
1818
dfCommit = dfCommit[2:end,:]

src/write_outputs/write_capacity.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function write_capacity(path::AbstractString, inputs::Dict, setup::Dict, EP::Mod
126126
NewChargeCap = sum(dfCap[!, :NewChargeCap]),
127127
EndChargeCap = sum(dfCap[!, :EndChargeCap]))
128128

129-
#dfCap = vcat(dfCap, total)
129+
dfCap = vcat(dfCap, total)
130130
#CSV.write(joinpath(path, "capacity.csv"), dfCap)
131131
write_output_file(joinpath(path, setup["WriteResultsNamesDict"]["capacity_name"]), dfCap, filetype = setup["ResultsFileType"], compression = setup["ResultsCompressionType"])
132132
return dfCap

0 commit comments

Comments
 (0)