sup3r.preprocessing.utilities.get_date_range_kwargs#
- get_date_range_kwargs(time_index)[source]#
Get kwargs for pd.date_range from a DatetimeIndex. This is used to provide a concise time_index representation which can be passed through the cli and avoid logging lengthly time indices.
Note
If the time index has leap days but is otherwise regular frequency, the kwarg
drop_leapwill be added to the output dict to indicate that leap days should be removed after generating the date range.- Parameters:
time_index (pd.DatetimeIndex) – Output time index.
- Returns:
kwargs (dict) – Dictionary to pass to pd.date_range(). Can also include kwarg
drop_leap