Skip to content

Commit 924bb35

Browse files
committed
doc(module desc): improves top file desc
1 parent e06a3e7 commit 924bb35

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

climada/trajectories/risk_trajectory.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
1717
---
1818
19+
This file implements risk trajectory objects, to allow a better evaluation
20+
of risk in between two points in time (snapshots).
21+
1922
"""
2023

2124
import datetime

climada/trajectories/riskperiod.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
1717
---
1818
19-
This modules implements the Snapshot and SnapshotsCollection classes.
19+
This modules implements the CalcRiskPeriod class.
20+
21+
CalcRiskPeriod are used to compute risk metrics (and intermediate requirements)
22+
in between two snapshots.
23+
24+
As these computations are not always required and can become "heavy", a so called "lazy"
25+
approach is used: computation is only done when required, and then stored.
2026
2127
"""
2228

@@ -212,7 +218,7 @@ def date_idx(self, value, /):
212218
if not isinstance(value, pd.DatetimeIndex):
213219
raise ValueError("Not a DatetimeIndex")
214220

215-
self._date_idx = value.normalize()
221+
self._date_idx = value.normalize() # Avoids weird hourly data
216222
self._time_points = len(self.date_idx)
217223
self._interval_freq = pd.infer_freq(self.date_idx)
218224
self._prop_H1 = np.linspace(0, 1, num=self.time_points)

climada/trajectories/snapshot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
1717
---
1818
19-
This modules implements the Snapshot and SnapshotsCollection classes.
19+
This modules implements the Snapshot class.
20+
21+
Snapshot are used to store the a snapshot of Exposure, Hazard, Vulnerability
22+
at a specific date.
2023
2124
"""
2225

0 commit comments

Comments
 (0)