-
Notifications
You must be signed in to change notification settings - Fork 157
Description
Over recent PRs (culminating with #71) the ExchangeCalendar's more client-facing (as opposed to calendar-definition) properties/methods have been revised to include parsing, annotation and standardised documentation. Concepts of 'session(s)' and 'minute(s)' are now expressed consistently throughout the class:
- in
Session,MinuteandDatetype annotations (and anticipatedTradingMinutetype). - within method documentation.
- within error messages of parsing functions.
- from release 4.0, it's proposed (todo for release 4.0 #61) that parameter names be consolidated from the various names currently employed to
sessionandminute. - The README will be revised to clearly express these concepts (Path to release 3.4 #86).
I'd propose going the final step and renaming the following methods to support this consistency and make the names less verbose (the lexicographical grouping of like methods would also aid users searching for methods from auto-complete menus).
Methods to be renamed to drop '_label' part:
-
previous_session_labeltoprevious_session -
next_session_labeltonext_session -
date_to_session_labeltodate_to_session -
minute_to_session_labeltominute_to_session
Methods that interrogate a session (all to be consistent with the likes of session_open:
-
open_and_close_for_sessiontosession_open_close. -
break_start_and_end_for_sessiontosession_break_start_end. -
minutes_for_sessiontosession_minutes.
Methods that interrogate a range of sessions:
-
session_opens_in_rangetosessions_opens. -
session_closes_in_rangetosessions_closes. -
minutes_for_sessions_in_rangeto orsessions_minutes. -
minutes_count_for_sessions_in_rangetosessions_minutes_count. -
session_distancetosessions_distance.
Methods that interrogate a range of minutes:
-
minute_index_to_session_labelstominutes_to_sessions.
Calendar properties:
-
all_sessionstosessions -
all_minutestominutes -
all_minutes_nanostominutes_nanos -
first_trading_minutetofirst_minute. -
last_trading_minutetolast_minute. -
first_trading_sessionto already existing propertyfirst_session. -
last_trading_sessionto already existing propertylast_session. -
has_breakstosessions_has_break(and add genuine propertyhas_breakthat refers to all calendar sessions).
Calendar attributes:
-
market_opens_nanostoopens_nanos. -
market_closes_nanostocloses_nanos. -
market_break_starts_nanostobreak_starts_nanos. -
market_break_ends_nanostobreak_ends_nanos.
Renaming Process
Intention would be to include newly named methods (with any newly named parameter names - #61) and deprecate the old-named methods in an upcoming release (3.4?). The deprecated methods would be retained (together with existing parameter names) although revised to:
- dispatch to the corresponding newly named method.
- raise a FutureWarning advising of renaming and that the deprecated name will be removed in version 4.0.
#71 adds a deprecate decorator to exchange_calendar.py. The decorator's currently only used for deprecating the execution_mintues_* methods although it can accommodate deprecations for renaming - under which it raises a FutureWarning that advises the user:
- that the method has been renamed.
- of the new method name.
- that the method is deprecated from release 3.4.
- that the method will be removed in release 4.0.
@gerrymanoim, what are you thoughts? Would you be happy for me to get a PR together prior to 3.4 to put the following name changes in motion?