Skip to content

Commit 077795d

Browse files
committed
Update Project.toml file for case study
1 parent 6fa7d5b commit 077795d

18 files changed

Lines changed: 1167 additions & 651 deletions

File tree

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2-
3-
using DataFrames
4-
using CSV
5-
6-
input_data_file = "base-input-data/simple-case-2-scenarios/1995equal"
7-
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8-
9-
df_profiles = filter(row -> row.scenario == 1995, df_profiles) # I keep only 1995 scenario
10-
# now i need 2008 with profiles same as 1995
11-
df_dup = copy(df_profiles)
12-
df_dup.scenario .= 2008
13-
df_profiles_new = vcat(df_profiles, df_dup)
14-
15-
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
1+
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2+
3+
using DataFrames
4+
using CSV
5+
6+
input_data_file = "base-input-data/simple-case-2-scenarios/1995equal"
7+
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8+
9+
df_profiles = filter(row -> row.scenario == 1995, df_profiles) # I keep only 1995 scenario
10+
# now i need 2008 with profiles same as 1995
11+
df_dup = copy(df_profiles)
12+
df_dup.scenario .= 2008
13+
df_profiles_new = vcat(df_profiles, df_dup)
14+
15+
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2-
3-
using DataFrames
4-
using CSV
5-
6-
input_data_file = "base-input-data/simple-case-2-scenarios/equal"
7-
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8-
9-
df_profiles = filter(row -> row.scenario == 2008, df_profiles) # I keep only 2008 scenario
10-
# now i need 2009 with profiles same as 2008
11-
df_dup = copy(df_profiles)
12-
df_dup.scenario .= 2009
13-
df_profiles_new = vcat(df_profiles, df_dup)
14-
15-
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
1+
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2+
3+
using DataFrames
4+
using CSV
5+
6+
input_data_file = "base-input-data/simple-case-2-scenarios/equal"
7+
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8+
9+
df_profiles = filter(row -> row.scenario == 2008, df_profiles) # I keep only 2008 scenario
10+
# now i need 2009 with profiles same as 2008
11+
df_dup = copy(df_profiles)
12+
df_dup.scenario .= 2009
13+
df_profiles_new = vcat(df_profiles, df_dup)
14+
15+
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2-
3-
using DataFrames
4-
using CSV
5-
6-
input_data_file = "base-input-data/simple-case-2-scenarios/modified"
7-
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8-
9-
df_profiles = filter(row -> row.scenario == 2008, df_profiles) # I keep only 2008 scenario
10-
# now i need 2009 with profiles same as 2008
11-
df_dup = copy(df_profiles)
12-
df_dup.scenario .= 2009
13-
df_profiles_new = vcat(df_profiles, df_dup)
14-
15-
16-
# now we modify availability
17-
18-
mask = (df_profiles_new.scenario .== 2009) .& (df_profiles_new.timestep .<= 504) # only for one scenario and for the first 3 weeks (24 * 7 * 3)
19-
df_profiles_new.solar[mask] .*= 0.2
20-
df_profiles_new.wind_onshore[mask] .*= 0.2
21-
df_profiles_new.wind_offshore[mask] .*= 0.2
22-
23-
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
1+
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2+
3+
using DataFrames
4+
using CSV
5+
6+
input_data_file = "base-input-data/simple-case-2-scenarios/modified"
7+
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8+
9+
df_profiles = filter(row -> row.scenario == 2008, df_profiles) # I keep only 2008 scenario
10+
# now i need 2009 with profiles same as 2008
11+
df_dup = copy(df_profiles)
12+
df_dup.scenario .= 2009
13+
df_profiles_new = vcat(df_profiles, df_dup)
14+
15+
# now we modify availability
16+
17+
mask = (df_profiles_new.scenario .== 2009) .& (df_profiles_new.timestep .<= 504) # only for one scenario and for the first 3 weeks (24 * 7 * 3)
18+
df_profiles_new.solar[mask] .*= 0.2
19+
df_profiles_new.wind_onshore[mask] .*= 0.2
20+
df_profiles_new.wind_offshore[mask] .*= 0.2
21+
22+
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2-
3-
using DataFrames
4-
using CSV
5-
6-
input_data_file = "base-input-data/simple-case-2-scenarios/modified_3scen"
7-
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8-
9-
df_profiles_1995 = filter(row -> row.scenario == 1995, df_profiles)
10-
df_profiles = filter(row -> row.scenario == 2008, df_profiles) # I keep only 2008 scenario
11-
# now i need 2009 with profiles same as 2008
12-
df_dup = copy(df_profiles)
13-
df_dup.scenario .= 2009
14-
df_profiles_new = vcat(df_profiles_1995, df_profiles, df_dup)
15-
16-
17-
# now we modify availability
18-
19-
mask = (df_profiles_new.scenario .== 2009) .& (df_profiles_new.timestep .<= 504) # only for one scenario and for the first 3 weeks (24 * 7 * 3)
20-
df_profiles_new.solar[mask] .*= 0.2
21-
df_profiles_new.wind_onshore[mask] .*= 0.2
22-
df_profiles_new.wind_offshore[mask] .*= 0.2
23-
24-
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
1+
# Run only once to prepare data (in Github there will already be correct data, so no need to run this)
2+
3+
using DataFrames
4+
using CSV
5+
6+
input_data_file = "base-input-data/simple-case-2-scenarios/modified_3scen"
7+
df_profiles = CSV.read(input_data_file * "/profiles-wide.csv", DataFrame)
8+
9+
df_profiles_1995 = filter(row -> row.scenario == 1995, df_profiles)
10+
df_profiles = filter(row -> row.scenario == 2008, df_profiles) # I keep only 2008 scenario
11+
# now i need 2009 with profiles same as 2008
12+
df_dup = copy(df_profiles)
13+
df_dup.scenario .= 2009
14+
df_profiles_new = vcat(df_profiles_1995, df_profiles, df_dup)
15+
16+
# now we modify availability
17+
18+
mask = (df_profiles_new.scenario .== 2009) .& (df_profiles_new.timestep .<= 504) # only for one scenario and for the first 3 weeks (24 * 7 * 3)
19+
df_profiles_new.solar[mask] .*= 0.2
20+
df_profiles_new.wind_onshore[mask] .*= 0.2
21+
df_profiles_new.wind_offshore[mask] .*= 0.2
22+
23+
CSV.write(input_data_file * "/profiles-wide.csv", df_profiles_new) # overwrite profiles
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# plots scenarios
Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
# Marker and color mappings for plots
2-
const MARKER_MAP = Dict(
3-
"per_scenario" => :utriangle,
4-
"cross_scenario" => :circle,
5-
)
2+
const MARKER_MAP = Dict("per_scenario" => :utriangle, "cross_scenario" => :circle)
63

7-
const LINE_MAP = Dict(
8-
"per_scenario" => :solid,
9-
"cross_scenario" => :dot,
10-
)
4+
const LINE_MAP = Dict("per_scenario" => :solid, "cross_scenario" => :dot)
115

12-
const COLOR_MAP_weight = Dict(
13-
"dirac" => :red,
14-
"convex" => :black,
15-
"conical" => :green,
16-
"conical_bounded" => :yellow,
17-
)
6+
const COLOR_MAP_weight =
7+
Dict("dirac" => :red, "convex" => :black, "conical" => :green, "conical_bounded" => :yellow)
188
const COLOR_MAP_method = Dict(
199
"convex_hull" => :black,
2010
"convex_hull_with_null" => :yellow,
@@ -23,12 +13,8 @@ const COLOR_MAP_method = Dict(
2313
# "k_medoids" => :orange
2414
)
2515

26-
const FILLER_MAP = Dict(
27-
"dirac" => :white,
28-
"convex" => :black,
29-
"conical" => :green,
30-
"conical_bounded" => :yellow
31-
)
16+
const FILLER_MAP =
17+
Dict("dirac" => :white, "convex" => :black, "conical" => :green, "conical_bounded" => :yellow)
3218
const VALUE_MAP = Dict(
3319
"rel_regret" => "Relative regret",
3420
"num_loss_of_load_e_demand" => "Number of timesteps with electricity loss of load",
@@ -38,11 +24,11 @@ const VALUE_MAP = Dict(
3824
"time_to_create" => "Time to create (s)",
3925
"time_to_solve" => "Time to solve (s)",
4026
"total_time" => "Total time (s)",
41-
"water_borrowed" => "Water borrowed"
27+
"water_borrowed" => "Water borrowed",
4228
)
4329

4430
const LEGEND_METHOD_MAP = Dict(
4531
"convex_hull" => "Convex hull",
4632
"convex_hull_with_null" => "Bounded conical hull",
4733
"conical_hull" => "Conical hull",
48-
)
34+
)

0 commit comments

Comments
 (0)