get an iterator of sliced data with given periods Args: periods (int): number of periods. min_periods (int): minimum periods for sliced dataframe. kwargs (dict): will be passed to `self.fetch`.
(
self, periods: int, min_periods: Optional[int] = None, **kwargs
)
| 362 | return slice(ref_date, cur_date) |
| 363 | |
| 364 | def get_range_iterator( |
| 365 | self, periods: int, min_periods: Optional[int] = None, **kwargs |
| 366 | ) -> Iterator[Tuple[pd.Timestamp, pd.DataFrame]]: |
| 367 | """ |
| 368 | get an iterator of sliced data with given periods |
| 369 | |
| 370 | Args: |
| 371 | periods (int): number of periods. |
| 372 | min_periods (int): minimum periods for sliced dataframe. |
| 373 | kwargs (dict): will be passed to `self.fetch`. |
| 374 | """ |
| 375 | trading_dates = self._data.index.unique(level="datetime") |
| 376 | if min_periods is None: |
| 377 | min_periods = periods |
| 378 | for cur_date in trading_dates[min_periods:]: |
| 379 | selector = self.get_range_selector(cur_date, periods) |
| 380 | yield cur_date, self.fetch(selector, **kwargs) |
| 381 | |
| 382 | |
| 383 | class DataHandlerLP(DataHandler): |
nothing calls this directly
no test coverage detected