Skip to content

Commit 8a0410b

Browse files
authored
Merge pull request #10 from ihmeuw/feature/precipitation-days
Add precipitation days
2 parents 710120d + 813a516 commit 8a0410b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/climate_data/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ def save_daily_results(
163163
encoding_kwargs: dict[str, Any],
164164
) -> None:
165165
path = self.daily_results_path(scenario, variable, year)
166+
if path.exists():
167+
path.unlink()
166168
mkdir(path.parent, exist_ok=True, parents=True)
167169
touch(path, exist_ok=True)
168170

src/climate_data/generate/scenario_annual.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@
152152
transform_funcs=[utils.annual_sum],
153153
encoding_scale=10,
154154
),
155+
"precipitation_days": utils.Transform(
156+
source_variables=["total_precipitation"],
157+
transform_funcs=[utils.count_threshold(0.1), utils.annual_sum],
158+
),
155159
}
156160

157161

0 commit comments

Comments
 (0)