quantlab.utils.date_range.check_range#

quantlab.utils.date_range.check_range(start, end, owner)[source]#

Return the first and last instants of [start, end].

Parameters:
start, endstr, datetime.date or pd.Timestamp

The inclusive range.

ownerstr

The Class.method() quoted in the error message.

Raises:
ValueError

If start is after end.

Examples

>>> check_range("2024-01-02", "2024-01-05", "Demo.panel()")
(Timestamp('2024-01-02 00:00:00'), Timestamp('2024-01-05 23:59:59.999999999'))