-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
65,063 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
32,259 changes: 32,259 additions & 0 deletions
32,259
resources/data/validation/irena_generation.csv
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
"""Rules for validating historical results""" | ||
|
||
### | ||
# constants | ||
### | ||
|
||
# used for target rules | ||
CAPACITY_VALIDATION = ["ember", "irena", "eia"] | ||
GENERATION_VALIDATION = ["ember", "irena", "eia"] | ||
EMISSION_VALIDATION = ["ember", "climatewatch"] | ||
|
||
### | ||
# capacity | ||
### | ||
|
||
def capacity_validation_data(wildcards): | ||
if wildcards.datasource == "ember": | ||
return "resources/data/ember_yearly_electricity_data.csv" | ||
elif wildcards.datasource == "irena": | ||
return "resources/data/validation/irena_capacity.csv" | ||
elif wildcards.datasource == "eia": | ||
return "resources/data/validation/eia_capacity.json" | ||
|
||
def capacity_options(wildcards): | ||
if wildcards.datasource == "irena": | ||
return {"iso_codes": "resources/data/validation/iso.csv"} | ||
else: | ||
return [] | ||
|
||
rule validate_capacity: | ||
message: "Validating capacity against {wildcards.datasource}" | ||
input: | ||
unpack(capacity_options), | ||
validation_data = capacity_validation_data, | ||
og_result = "results/{scenario}/results/TotalCapacityAnnual.csv", | ||
params: | ||
result_dir="results/{scenario}/results", | ||
variable="capacity" | ||
output: | ||
expand("results/{{scenario}}/validation/{country}/capacity/{{datasource}}.png", country=COUNTRIES) | ||
script: | ||
"../scripts/osemosys_global/validation/main.py" | ||
|
||
### | ||
# generation | ||
### | ||
|
||
def generation_validation_data(wildcards): | ||
if wildcards.datasource == "ember": | ||
return "resources/data/ember_yearly_electricity_data.csv" | ||
elif wildcards.datasource == "irena": | ||
return "resources/data/validation/irena_generation.csv" | ||
elif wildcards.datasource == "eia": | ||
return "resources/data/validation/eia_generation.json" | ||
|
||
def generation_options(wildcards): | ||
if wildcards.datasource == "irena": | ||
return {"iso_codes": "resources/data/validation/iso.csv"} | ||
else: | ||
return [] | ||
|
||
rule validate_generation: | ||
message: "Validating generation against {wildcards.datasource}" | ||
input: | ||
unpack(generation_options), | ||
validation_data = generation_validation_data, | ||
og_result = "results/{scenario}/results/ProductionByTechnologyAnnual.csv", | ||
params: | ||
result_dir="results/{scenario}/results", | ||
variable="generation" | ||
output: | ||
expand("results/{{scenario}}/validation/{country}/generation/{{datasource}}.png", country=COUNTRIES) | ||
script: | ||
"../scripts/osemosys_global/validation/main.py" | ||
|
||
### | ||
# emissions | ||
### | ||
|
||
def emission_validation_data(wildcards): | ||
if wildcards.datasource == "ember": | ||
return "resources/data/ember_yearly_electricity_data.csv" | ||
elif wildcards.datasource == "climatewatch": | ||
return "resources/data/validation/climatewatch.csv" | ||
|
||
rule validate_emissions: | ||
message: "Validating emissions against {wildcards.datasource}" | ||
input: | ||
validation_data = emission_validation_data, | ||
og_result = "results/{scenario}/results/AnnualEmissions.csv" | ||
params: | ||
result_dir="results/{scenario}/results", | ||
variable="emissions" | ||
output: | ||
expand("results/{{scenario}}/validation/{country}/emissions/{{datasource}}.png", country=COUNTRIES) | ||
script: | ||
"../scripts/osemosys_global/validation/main.py" |