Skip to content

Commit 5df73e0

Browse files
committed
Merge branch 'feature/snapshots' into feature/impact-computation-strategies
2 parents 87332be + 25fbcda commit 5df73e0

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

climada/trajectories/snapshot.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def _convert_to_date(date_arg) -> datetime.date:
191191

192192
raise TypeError("date_arg must be an int, str, or datetime.date")
193193

194-
def apply_measure(self, measure: Measure) -> "Snapshot":
194+
def apply_measure(self, measure: Measure, ref_only: bool = False) -> "Snapshot":
195195
"""Create a new snapshot by applying a Measure object.
196196
197197
This method creates a new `Snapshot` object by applying a measure on
@@ -211,6 +211,11 @@ def apply_measure(self, measure: Measure) -> "Snapshot":
211211
LOGGER.debug("Applying measure %s on snapshot %s", measure.name, id(self))
212212
exp, impfset, haz = measure.apply(self.exposure, self.impfset, self.hazard)
213213
snap = Snapshot(
214-
exposure=exp, hazard=haz, impfset=impfset, date=self.date, measure=measure
214+
exposure=exp,
215+
hazard=haz,
216+
impfset=impfset,
217+
date=self.date,
218+
measure=measure,
219+
ref_only=ref_only,
215220
)
216221
return snap

doc/api/climada/climada.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ Software documentation per package
77
climada.engine
88
climada.entity
99
climada.hazard
10+
climada.trajectories
1011
climada.util
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
climada\.trajectories module
3+
============================
4+
5+
.. toctree::
6+
7+
climada.trajectories.snapshot
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
climada\.trajectories\.snapshot module
2+
----------------------------------------
3+
4+
.. automodule:: climada.trajectories.snapshot
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

0 commit comments

Comments
 (0)