-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minute_to_session raises error if passed default_start date #266
Comments
Hi @MBounouar, yes this change is intentional. Here the minute is being passed as UTC midnight on the day of the calendar's first session, although the first minute covered by the calendar will be that session's first minute, (14:30 UTC). The exception's raised as the minute passed is earlier than the first minute covered by the calendar. See the sessions and minutes tutorials for all things sessions and minutes in v4. Cheers |
Hi @maread99 If it was intentional, I will close the issue. Though, I still would have expected that Cheers, |
Without being strict a user could, without realizing it, pass any minute before the calendar's first minute and wrongly, but reasonably, assume the calendar's first session is the corresponding session. It makes no difference if the minute passed is 'just' before the first minute - without knowledge of the prior session's open/close it's not possible to know which session to assign a minute to (for example, for a 24h calendar the minute prior to the open should be assigned to the prior session). |
Hi,
before version 4.x passing the default start date wouldn't raise an error and simply return the valid session i.e.
now
nys.minute_to_session(pd.Timestamp("2002-12-11", tz="UTC"))
raises
errors.MinuteOutOfBounds(calendar, ts, param_name)
Was that change intentional?
The text was updated successfully, but these errors were encountered: