Skip to content
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

v4 #201

Merged
merged 19 commits into from
Jun 22, 2022
Merged

v4 #201

merged 19 commits into from
Jun 22, 2022

Conversation

maread99
Copy link
Collaborator

Merges v4 branch into master.

See commits for details (also, PRs to v4 branch are between #179 and #199 inclusive).

maread99 and others added 19 commits June 3, 2022 12:43
Also
- Adds typing to, adds doc to and renames parameters of:
  - some private `ExchangeCalendar` initialization methods.
  - some private `XKRXExchangeCalendar` initialization methods.
  - `pandas_utils.days_at_time`.
Fixes warnings:
- pandas `union_many` deprecated.
- `pd.Series.append` deprecated.
- writting to a copy of an array (pandas).

Also:
- adds `indexes_union` function to `pandas_utils`.
- adds doctests in `pandas_utils` to test suite.
Fixes bug that included close (wrongly) when `force` was True,
`intervals` was False and closed was `left` or `neither`. Revises test.

Revises so that `start` and `end` can be passed as either date or
minute. Adds `TestTradingIndex.test_start_end_times`.

Updates tutorial `trading_index.ipynb`.

Also:
- adds following functions to `calendar_helpers` and associated
test(s) to `test_calendar_helpers`:
  - `is_date`
  - `to_utc`
  - `parse_date_or_minute`
Revises following `ExchangeCalendar` methods, and associated tests,
so that `count` parameter reflects window length (previously window
length was `count` + 1):
- `sessions_window`.
- `minutes_window`.

Also changes methods' parameter names:
- `start_dt` renamed `minute`.
- `session_label` renamed `session`.
Changes error raised when prev or next minute or session is
out-of-bounds. Changed from `ValueError` to `Requested*OutOfBounds`.

Simplifies minute_to_*_session methods.
Changes `ExchangeCalendar` bound* and default* properties to class
methods.

To support change also makes
`PrecomputedExchangeCalendar.precomputed_holidays` a class method.
Renames following `ExchangeCalendar.schedule` columns:
- 'market_open' renamed 'open'
- 'market_close' renamed 'close'

Renames parameters of following `ExchangeCalendar` methods (as #61):
- `session_open`
- `session_close`
- `session_break_start`
- `session_break_end`
- `sessions_in_range`
- `is_session`
- `is_open_on_minute`
- `previous_open`
- `pervious_close`
- `next_open`
- `next_close`
- `previous_minute`
- `next_minute`
Deprecates following `ExchangeCalendar` methods:
- `sessions_opens` (use .opens[start, end] instead).
- `sessions_closes` (use .closes[start, end] instead).

Removes following `ExchangeCalendar` methods deprecated in v3.4:
- `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`
- Replaces`@lazyval` with `@functools.cached_property`
- Replaces `@functools.lru_cache` with `@functools.cached_property`
where lru_cache was decorating a 'would-be' property.
- Introduces Literal type annotation.
- Removes 3.7 from test and build workflow.
- Sets test and build workflow to run on 3.8 and 3.10 (min and max
python versions supported).

Also:
- changes tests with pytest.skip() to pass silently rather than skip
loudly if test not relevant to calendar.
- Removes following redundant errors:
  - `ScheduleFunctionWithoutCalendar`
  - `ScheduleFunctionInvalidCalendar`
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Selective linting of exchange_calendar.py (using mypy and pylint).

Also, adds a mypy config section to setup.cfg.
Changes default calendar side to "left" for all calendars (from "right"
for 24h calendars and "both" for all others).
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Updates README and tutorials for v4.0.

Also:
- adds `changes_renamed.md`.
- renames parameters of `minutes_in_range`.
Updates workflows:
- to accommodate changes to requirements files.
- on main workflow moves caching of dependencies to setup-python action.

Removes from etc:
- `requirements.in`
- `requirements_dev.in`
- `requirements_locked.txt`
- `requirements_locked_old.txt`

Adds following files generated from pip-compile looking at setup.cfg:
- `requirements.txt`
- `requirements_dev.txt`
Adds new `is_open_at_time` calendar method, adds tests and adds
example to calendar_methods.ipynb

Also
- corrects `minutes.ipynb` text that identifies which session break
bounds are considered as trading minutes for a given side.
Also updates README link to anticipated 4.0 disucssion address.
@maread99 maread99 merged commit 965bac8 into master Jun 22, 2022
@maread99 maread99 deleted the v4 branch June 22, 2022 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants