Skip to content

Commit

Permalink
Added bootstrap configs for new forecast variables (#212)
Browse files Browse the repository at this point in the history
- HWDI
- CDDs
- HDDs

Also fixed invalid CDD description
  • Loading branch information
ricardogsilva authored Aug 29, 2024
1 parent 5125191 commit 67f0a8a
Show file tree
Hide file tree
Showing 8 changed files with 2,472 additions and 16 deletions.
12 changes: 12 additions & 0 deletions arpav_ppcv/bootstrapper/cliapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

from .coverage_configurations import (
cdd,
cdds,
fd,
hdds,
hwdi,
pr,
r95ptot,
snwdays,
Expand Down Expand Up @@ -188,9 +191,12 @@ def bootstrap_coverage_configurations(
}
coverage_configurations = []
coverage_configurations.extend(cdd.generate_configurations(conf_param_values))
coverage_configurations.extend(cdds.generate_configurations(conf_param_values))
coverage_configurations.extend(
fd.generate_configurations(conf_param_values, variables)
)
coverage_configurations.extend(hdds.generate_configurations(conf_param_values))
coverage_configurations.extend(hwdi.generate_configurations(conf_param_values))
coverage_configurations.extend(
pr.generate_configurations(conf_param_values, variables)
)
Expand Down Expand Up @@ -233,7 +239,10 @@ def bootstrap_coverage_configurations(
to_update = {}
for name, related_names in {
**cdd.get_related_map(),
**cdds.get_related_map(),
**fd.get_related_map(),
**hdds.get_related_map(),
**hwdi.get_related_map(),
**pr.get_related_map(),
**r95ptot.get_related_map(),
**snwdays.get_related_map(),
Expand All @@ -249,7 +258,10 @@ def bootstrap_coverage_configurations(

for name, uncertainties in {
**cdd.get_uncertainty_map(),
**cdds.get_uncertainty_map(),
**fd.get_uncertainty_map(),
**hdds.get_uncertainty_map(),
**hwdi.get_uncertainty_map(),
**pr.get_uncertainty_map(),
**r95ptot.get_uncertainty_map(),
**snwdays.get_uncertainty_map(),
Expand Down
23 changes: 22 additions & 1 deletion arpav_ppcv/bootstrapper/configurationparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,37 @@ def generate_configuration_parameters() -> list[ConfigurationParameterCreate]:
name="cdd",
display_name_english="CDD",
display_name_italian="CDD",
description_english="Consecutive Cold Days",
description_english="Consecutive Dry Days",
description_italian="Giorni secchi",
),
ConfigurationParameterValueCreateEmbeddedInConfigurationParameter(
name="cdds",
display_name_english="CDDs",
display_name_italian="CDDs",
description_english="Cooling degree days",
description_italian="Gradi giorno di raffrescamento",
),
ConfigurationParameterValueCreateEmbeddedInConfigurationParameter(
name="fd",
display_name_english="FD",
display_name_italian="FD",
description_english="Frozen Days",
description_italian="Giorni di gelo",
),
ConfigurationParameterValueCreateEmbeddedInConfigurationParameter(
name="hdds",
display_name_english="HDDs",
display_name_italian="HDDs",
description_english="Heating degree days",
description_italian="Gradi giorno di riscaldamento",
),
ConfigurationParameterValueCreateEmbeddedInConfigurationParameter(
name="hwdi",
display_name_english="HWDI",
display_name_italian="HWDI",
description_english="Duration of heat waves",
description_italian="Durata delle ondate di calore",
),
ConfigurationParameterValueCreateEmbeddedInConfigurationParameter(
name="pr",
display_name_english="PR",
Expand Down
7 changes: 3 additions & 4 deletions arpav_ppcv/bootstrapper/coverage_configurations/cdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
_DISPLAY_NAME_ENGLISH = "Consecutive dry days"
_DISPLAY_NAME_ITALIAN = "Giorni secchi"
_DESCRIPTION_ENGLISH = (
"Number of days with average temperature less than 2 °C and daily precipitation "
"greater than 1 mm"
"Maximum number of consecutive dry days (daily precipitation less than 1 mm)"
)
_DESCRIPTION_ITALIAN = (
"Numero di giorni con temperatura media inferiore a 2 °C e precipitazioni "
"giornaliere superiori a 1 mm"
"Numero massimo di giorni consecutivi asciutti (precipitazione giornaliera "
"inferiore a 1 mm)"
)


Expand Down
Loading

0 comments on commit 67f0a8a

Please sign in to comment.