File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ class Snapshot:
5252 The date of the Snapshot, it can be an integer representing a year,
5353 a datetime object or a string representation of a datetime object
5454 with format "YYYY-MM-DD".
55+ ref_only : bool, default False
56+ Should the `Snapshot` contain deep copies of the Exposures, Hazard and Impfset (False)
57+ or references only (True).
5558
5659 Attributes
5760 ----------
@@ -80,10 +83,11 @@ def __init__(
8083 hazard : Hazard ,
8184 impfset : ImpactFuncSet ,
8285 date : int | datetime .date | str ,
86+ ref_only : bool = False ,
8387 ) -> None :
84- self ._exposure = copy .deepcopy (exposure )
85- self ._hazard = copy .deepcopy (hazard )
86- self ._impfset = copy .deepcopy (impfset )
88+ self ._exposure = exposure if ref_only else copy .deepcopy (exposure )
89+ self ._hazard = hazard if ref_only else copy .deepcopy (hazard )
90+ self ._impfset = impfset if ref_only else copy .deepcopy (impfset )
8791 self ._measure = None
8892 self ._date = self ._convert_to_date (date )
8993
You can’t perform that action at this time.
0 commit comments