mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-07 13:00:58 +08:00
Backtest Mypy (#1130)
* Done * Fix test errors * Revert profit_attribution.py * Minor * A minor update on collect_data type hint * Resolve PR comments * Use black to format code * Fix CI errors
This commit is contained in:
@@ -108,14 +108,16 @@ class CalendarProvider(abc.ABC):
|
||||
_, _, si, ei = self.locate_index(start_time, end_time, freq, future)
|
||||
return _calendar[si : ei + 1]
|
||||
|
||||
def locate_index(self, start_time, end_time, freq, future=False):
|
||||
def locate_index(
|
||||
self, start_time: Union[pd.Timestamp, str], end_time: Union[pd.Timestamp, str], freq: str, future: bool = False
|
||||
):
|
||||
"""Locate the start time index and end time index in a calendar under certain frequency.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
start_time : str
|
||||
start_time : pd.Timestamp
|
||||
start of the time range.
|
||||
end_time : str
|
||||
end_time : pd.Timestamp
|
||||
end of the time range.
|
||||
freq : str
|
||||
time frequency, available: year/quarter/month/week/day.
|
||||
|
||||
Reference in New Issue
Block a user