Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement option for right limit ealier than now
To `base.PricesBase`: - adds `live_prices` method. - adds `limit_right_daily` property. - adds `limit_right_intraday` property. - adds `latest_requestable_minute` property. - adds `_bis_available_any`, `_bis_available_any_no_partial_indicies` and `_bis_any` to evaluate bis for which ANY data is available over the requested period. This provides for returning prices when strict False and end is to the right of the right limit. - revises `_get_bi_table_intraday` to accommodate returning data when end is to the right of the right limit and strict is False. - renames `_bis_available` as `_bis_available_all`. - revises `_bis_valid` to raise `EndOutOfBoundsError`. - revises `_bis_available_all` and `_bis_available_end` to also raise `PricesUnavailableIntervalError` when start is right of right limit or end is left of left limit. - revises `GetPricesParams` to support right limits and adds `request_all_availabla_data` property to query if the params are requesting all available data. - tidies `get` to make code paths clearer. - revises `price_at` and dependents to support right limit. - overhauls implementation of `_price_at_from_daily` to FIX bug where daily data could return inaccurate prices at a specific minute when sessions of underlying symbols overlapped. To `daterange._Getter`: - adds support for a right limit. - adds 'limit' parameter to `get_start`, `get_end` and `_get_start_end`. - adds 'strict' parameter to `get_end` to override instance stict. - enforces consistency of behaviour when evaluated period is partially out-of-limits when strict is False, only start or end is defined and the other is evaluated from a duration. Now always evaluates period independent of limits and returns prices for the part of the period for which prices are available. To `parsing` module: - revises `parse_start_end` and dependents to support a right limit. To `data` module: - adds `data.Data.available_any` method to query if data is avaialble for any timestamp within a range. To `errors` module: - revises and reworks messages for `PricesIntradayUnavailableError`. - adds: - `EndTooLateError` - `PriceAtUnavailableError` - `PriceAtUnavailableLimitError` - `PriceAtUnavailableLivePricesError` - `EndOutOfBoundsRightError` To `csv` module: - implements `_request_data` and calls from constructor to get all data upfront, after which further calls to method will fail. To TEST modules: - revisions to existing tests to support changes that implemented a right limit. - new `test_limits` test module to test effect of a right limit on `PricesBase.get` and `PricesBase.price_at`. - adds `test_parsing.test_start_end_right_limit_now_now` to test support for right limit when parsing start and end params. - adds 2 days of daily data to right extreme of some daily .csv resource files to bring the availability of daily data in line with that of intraday data.
- Loading branch information