gerrymanoim / exchange_calendars

Calendars for various securities exchanges.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

todo for release 4.0

maread99 opened this issue · comments

I've opened this to consolidate any breaking changes that would need to be delayed until / incorporated in any release 4.0.

  • Change times to UTC (opens, closes, break_starts and break_ends) (#42). (done #179)
  • Change sessions to tz-naive (only if #42 resolves in favour of this change). (done #179)
  • Move min supported version to 3.8. Changes as #68. (done #187)
  • session_label parameter of ExchangeCalendar methods to be renamed session (which is given context from Session type and checks imposed by subsequent parsing). Methods requiring change include:
    • previous_session_label (changed when renamed, #85)
    • next_session_label (changed when renamed, #85)
    • session_open (done #186)
    • session_close (done #186)
    • session_break_start (done #186)
    • session_break_end (done #186)
    • open_and_close_for_session (changed when renamed, #85)
    • break_start_and_end_for_session (changed when renamed, #85)
    • minutes_for_session (changed when renamed, #85)
    • sessions_window (done #184)
      For following methods, start_session_label / end_session_label parameters to be renamed start / end
    • sessions_in_range (done #186)
    • minutes_for_sessions_in_range (changed when renamed, #85)
    • session_opens_in_range (changed when renamed, #85)
    • session_closes_in_range (changed when renamed, #85)
    • session_distance (changed when renamed, #85)
      For following methods, start_session / end_session parameters to be renamed start / end
    • minutes_count_for_sessions_in_range (changed when renamed, #85)
      For following methods, start_minute / end_minute parameters to be renamed start / end
    • minutes_in_range (done #194)
      For following methods, dt to be renamed date:
    • is_session (done #186)
  • dt parameter of ExchangeCalendar methods to be renamed minute (given context from 'Minute' type and checks imposed by subsequent parsing). Methods requring change include:
    • minute_to_session_label (changed when renamed, #85)
    • is_open_on_minute (done #186)
    • previous_open (done #186)
    • previous_close (done #186)
    • next_open (done #186)
    • next_close (done #186)
    • previous_minute (done #186)
    • next_minute (done #186)
      For following methods, start_dt to be renamed minute:
    • minutes_window (done #184)
  • index parameter of minute_index_to_session_labels to be renamed minutes (changed when renamed, #85)
  • rename ExchangeCalendar.schedule columns: (done #186)
    • market_open to open
    • market_close to close
  • Remove ExchangeCalendar methods deprecated ahead of release 3.4 - all were renamed (#85) save for the four execution_* methods: (done #186)
    • execution_minutes_for_session
    • execution_minutes_for_sessions_in_range
    • execution_time_from_open
    • execution_time_from_close
    • previous_session_label
    • next_session_label
    • date_to_session_label
    • minute_to_session_label
    • open_and_close_for_session
    • break_start_and_end_for_session
    • minutes_for_session
    • session_opens_in_range
    • session_closes_in_range
    • minutes_for_sessions_in_range
    • minutes_count_for_sessions_in_range
    • session_distance
    • minute_index_to_session_labels
    • all_sessions
    • all_minutes
    • all_minutes_nanos
    • first_trading_minute
    • last_trading_minute
    • first_trading_session
    • last_trading_session
    • has_breaks
    • market_opens_nanos
    • market_closes_nanos
    • market_break_starts_nanos
    • market_break_ends_nanos
  • Remove sessions_opens and sessions_closes now that, with schedule times changing to UTC timestamps, cal.sessions_opens(start, end) will return the same as cal.opens[start:end] (there should be only one obvious way to do something...). (done #186)
  • Consider changing side default for all calendars to "left" (from "right" for 24 hour calendars and from "both" for others). See #181. (done #191)
  • Change behaviour of ExchangeCalendar methods sessions_window and minutes_window so that count parameter matches the length of the return (the length of which is currently count + 1). i.e. just add count -= 1 as methods' first line and raise ValueError if count received as 0. (done #184)
  • Consider changing behaviour of is_open_on_minute to distinguish it from is_trading_minute. Proposed that the ignore_breaks option be removed and the method act as if ignore_breaks were True, i.e. is_open_on_minute would act as is_trading_minute albeit treating any break minutes as open. Method documentation should make clear that market is considered open on break minutes. Considered, left as is.
  • Consider changing ExchangeCalendar properties bound_start and bound_end to class attributes (they are class-specific, not instance-specific) and default_start and default_end to class methods with intention of changing to class properties when min python version moves to 3.9 (as noted to #98 for valid_sides and default_side). 22/06/06 - done #184, made all class methods.
  • Amend following methods to raise errors.RequestedSessionOutOfBounds when request session/minute falls beyond calendar bound: (done #184)
    • next_session (remove from minute_to_future_session method the current_session == last_session check and raise.)
    • previous_session (remove from minute_to_past_session method the current_session == first_session check and raise.)
    • next_minute
    • previous_minute
  • Amend ExchangeCalendar.trading_index, or calendar_helpers._TradingIndex, to: (done #180)
    • allow start and end parameters to be passed as times (as opposed to only dates).
    • include convenience force option to define both force_close and force_break_close.
    • revise/add tests for added functionality.
  • Revise README to accommodate changes. (done #194)
  • Revise / re-execute .ipynb tutorials to accommodate changes. Also: (done #194)
    • Add note to top of all tutorials that best viewed in Jupyter Lab / Jupyter Notebook or via nbviewer.
    • Include clearer explanation of start and end calendar options to README Quick Start and an appropriate tutorial. (done #194)

Desired enhancements that are non-breaking:

  • Move internal representation of sessions to nanos (see discussion #87).
  • Real documentation. (#63). Going forward covered by issue #63
  • Break times to test answers. (#64)

I'd add

  • Real documentation

My preference is probably some markdown backed sphinx system on github pages.

Items incorporated to v4 PRs between #179 and #199 inclusive. Merged to master in #201.

4.0.1 released 2022-06-22.