forked from quantopian/trading_calendars
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Renaming of some ExchangeCalendar methods #85
Comments
This was referenced Sep 15, 2021
Closed
Closed
Yeah - this makes perfect sense. |
maread99
added a commit
that referenced
this issue
Oct 21, 2021
Renames various `ExchangeCalendar` methods as GH issue #85. Methods with old names retained to: - dispatch to newly named methods. - advise of deprecation of old-named methods. - warn of removal of old-named methods in 4.0. Also: - For some renamed methods also changes parameter names to commnon names `session`, `minute`, `minutes`, `date`, `start` and `end`. - Adds `ExchangeCalendar.has_break` property to query if any session of calendar has a break. - Adds `test_deprecated` to test deprecated methods are raising FutureWarning errors. - Renames `Answers` properties: - `first_trading_minute` to `first_minute` - `last_trading_minute` to `last_minute`
maread99
added a commit
that referenced
this issue
Oct 22, 2021
Renames various `ExchangeCalendar` methods as GH issue #85. Methods with old names retained to: - dispatch to newly named methods. - advise of deprecation of old-named methods. - warn of removal of old-named methods in 4.0. Also: - For some renamed methods also changes parameter names to commnon names `session`, `minute`, `minutes`, `date`, `start` and `end`. - Adds `ExchangeCalendar.has_break` property to query if any session of calendar has a break. - Adds `test_deprecated` to test deprecated methods are raising FutureWarning errors. - Renames `Answers` properties: - `first_trading_minute` to `first_minute` - `last_trading_minute` to `last_minute`
maread99
added a commit
that referenced
this issue
Oct 23, 2021
Renames various `ExchangeCalendar` methods as GH issue #85. Methods with old names retained to: - dispatch to newly named methods. - advise of deprecation of old-named methods. - warn of removal of old-named methods in 4.0. Also: - For some renamed methods also changes parameter names to commnon names `session`, `minute`, `minutes`, `date`, `start` and `end`. - Adds `ExchangeCalendar.has_break` property to query if any session of calendar has a break. - Adds `test_deprecated` to test deprecated methods are raising FutureWarning errors. - Renames `Answers` properties: - `first_trading_minute` to `first_minute` - `last_trading_minute` to `last_minute`
maread99
added a commit
that referenced
this issue
Oct 25, 2021
Renames various `ExchangeCalendar` methods as GH issue #85. Methods with old names retained to: - dispatch to newly named methods. - advise of deprecation of old-named methods. - warn of removal of old-named methods in 4.0. Also: - For some renamed methods also changes parameter names to commnon names `session`, `minute`, `minutes`, `date`, `start` and `end`. - Adds `ExchangeCalendar.has_break` property to query if any session of calendar has a break. - Adds `test_deprecated` to test deprecated methods are raising FutureWarning errors. - Renames `Answers` properties: - `first_trading_minute` to `first_minute` - `last_trading_minute` to `last_minute`
maread99
added a commit
that referenced
this issue
Oct 25, 2021
Renames various `ExchangeCalendar` methods as GH issue #85. Methods with old names retained to: - dispatch to newly named methods. - advise of deprecation of old-named methods. - warn of removal of old-named methods in 4.0. Also: - For some renamed methods also changes parameter names to commnon names `session`, `minute`, `minutes`, `date`, `start` and `end`. - Adds `ExchangeCalendar.has_break` property to query if any session of calendar has a break. - Adds `test_deprecated` to test deprecated methods are raising FutureWarning errors. - Renames `Answers` properties: - `first_trading_minute` to `first_minute` - `last_trading_minute` to `last_minute`
Implemented #105. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:Session
,Minute
andDate
type annotations (and anticipatedTradingMinute
type).session
andminute
.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_label
toprevious_session
next_session_label
tonext_session
date_to_session_label
todate_to_session
minute_to_session_label
tominute_to_session
Methods that interrogate a session (all to be consistent with the likes of
session_open
:open_and_close_for_session
tosession_open_close
.break_start_and_end_for_session
tosession_break_start_end
.minutes_for_session
tosession_minutes
.Methods that interrogate a range of sessions:
session_opens_in_range
tosessions_opens
.session_closes_in_range
tosessions_closes
.minutes_for_sessions_in_range
to orsessions_minutes
.minutes_count_for_sessions_in_range
tosessions_minutes_count
.session_distance
tosessions_distance
.Methods that interrogate a range of minutes:
minute_index_to_session_labels
tominutes_to_sessions
.Calendar properties:
all_sessions
tosessions
all_minutes
tominutes
all_minutes_nanos
tominutes_nanos
first_trading_minute
tofirst_minute
.last_trading_minute
tolast_minute
.first_trading_session
to already existing propertyfirst_session
.last_trading_session
to already existing propertylast_session
.has_breaks
tosessions_has_break
(and add genuine propertyhas_break
that refers to all calendar sessions).Calendar attributes:
market_opens_nanos
toopens_nanos
.market_closes_nanos
tocloses_nanos
.market_break_starts_nanos
tobreak_starts_nanos
.market_break_ends_nanos
tobreak_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:
#71 adds a
deprecate
decorator to exchange_calendar.py. The decorator's currently only used for deprecating theexecution_mintues_*
methods although it can accommodate deprecations for renaming - under which it raises a FutureWarning that advises the user:@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?
The text was updated successfully, but these errors were encountered: