This repository was archived by the owner on Sep 11, 2023. It is now read-only.
File tree 1 file changed +17
-0
lines changed
nowcasting_dataset/data_sources
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ def datetime_index(self) -> pd.DatetimeIndex:
136
136
# of a list of datetimes (e.g. for DatetimeDataSource).
137
137
raise NotImplementedError ()
138
138
139
+ # TODO: Remove this function (and any tests) after get_contiguous_time_periods() is implemented.
139
140
def get_t0_datetimes (self ) -> pd .DatetimeIndex :
140
141
"""Get all the valid t0 datetimes.
141
142
@@ -158,6 +159,22 @@ def get_t0_datetimes(self) -> pd.DatetimeIndex:
158
159
max_gap = self .sample_period_dur ,
159
160
)
160
161
162
+ def get_contiguous_time_periods (self ) -> pd .DataFrame :
163
+ """Get all the time periods for which this DataSource has contiguous data.
164
+
165
+ Optionally filter out any time periods which don't make sense for this DataSource,
166
+ e.g. remove nighttime.
167
+
168
+ Returns:
169
+ pd.DataFrame where each row represents a single time period. The pd.DataFrame
170
+ has two columns: `start_dt` and `end_dt` (where 'dt' is short for 'datetime').
171
+ """
172
+
173
+ # TODO:
174
+ # Modify nd_time.get_start_datetimes so that it returns the segment boundaries
175
+ # as a pd.DataFrame?
176
+ raise NotImplementedError ()
177
+
161
178
def _get_time_slice (self , t0_dt : pd .Timestamp ):
162
179
"""Get a single timestep of data. Must be overridden."""
163
180
raise NotImplementedError ()
You can’t perform that action at this time.
0 commit comments