Commit Graph

4712 Commits

Author SHA1 Message Date
Richard Frank 7b65cd23db DOC: Added ANACONDA_TOKEN directions 2016-11-10 12:12:02 -05:00
Eddie Hebert b309e3ce1e Merge pull request #1587 from quantopian/fix-bug-for-continuous-future-max-date
BUG: Fix continuous future end dates.
2016-11-09 16:41:57 -05:00
Eddie Hebert e415c0f350 BUG: Fix continuous future end dates.
The end date of the last contract with a sufficient start date was being
used for the continuous future overall end date; however the end date of
that contract (which is the last day for which there is data for the
contract) is not necessarily the greatest end date out of all contracts.
It is possible for the furthest out contract to have some, but very
few, trades before it is more actively traded. Which would give it a
start date within in the range of the simulation, but an end date is
earlier than the other contracts which are active during the simulation.

This bug would result in `nan`s when getting the current price because
of the `end_date` check in `get_spot_value`. When the current simulation
time was greater than the `end_date` of the last contract the condition
which guards against attempting to get data for an instrument past its
end date would return a `nan`, even when the current underlying contract
did have data for that date.

Use max end date of all contracts instead of the last one, to ensure
that the continuous future last date is always great enough to allow
access to all contracts with in the chain.

Also, use min start date to accurately mirror the end date behavior.
2016-11-09 16:19:19 -05:00
Eddie Hebert fa6e4fe8b1 Merge pull request #1586 from quantopian/fix-continuous-future-daily-get-value
BUG: Fix bad attribute lookup on session continuous future reader.
2016-11-08 16:15:05 -05:00
Eddie Hebert 512e62b13e BUG: Fix bad attribute lookup on session continuous future reader.
Use `roll_style` not `roll`.

Also, add test case to cover using the session bar reader `get_value`,
by adding a test which uses `close`, since only `contract` was being
exercised, which does not exercise the session daily bar reader.
2016-11-08 15:48:28 -05:00
Eddie Hebert b5d4df6223 Merge pull request #1585 from quantopian/pricing-data-associable
MAiNT: Add a pricing data shared abc.
2016-11-08 12:26:02 -05:00
Eddie Hebert 5e8faa2fbb MAiNT: Add a pricing data shared abc.
Register equities, futures, and continuous futures to an `abc` which
signifies that the type is associable with data, and thus can be used in
a history context.

May want to use this in `check_parameters` for `BarData` methods, but
work would need to be done to make sure the error message still displays
the registered types.
2016-11-08 11:36:45 -05:00
Eddie Hebert 44b97be712 Merge pull request #1584 from quantopian/allow-single-continuous-future
BUG: Fix `data.history` with a single continuous future.
2016-11-08 11:33:57 -05:00
Eddie Hebert 25eb13ccff Merge pull request #1583 from quantopian/allow-sliding-window-to-reset
ENH: Allow arbitrary history queries.
2016-11-07 22:31:13 -05:00
Eddie Hebert e419e20acf ENH: Allow arbitrary history queries.
In preparation for using `DataPortal` in notebooks, remove restriction on
the `HistoryLoader` to dates that are monotonically increasing. Notebook
usage of the `DataPortal` is more useful when the end of the history
window can be arbitrary dates without having to restart the notebook kernel.

Due to the implementation of the prefetch and caching logic, the end
date of history calls could previously only increase. e.g. `2016-11-01`,
`2016-11-02`, `2016-11-03`. This pattern was sufficient for backtesting
and live simulations, since the current time of the algorithm only ever increases.

With this change, which resets the underlying sliding window when the
last fetched idx is greater than the

Now calls to history in the same process with end dates such
`2016-11-01`, `2016-10-31`, `2015-11-02` should work.
2016-11-07 16:40:51 -05:00
Eddie Hebert 3e3d95ebb9 BUG: Fix data.history with a single continuous future.
Allow `ContinuousFuture` when checking for a single "asset".

This could be further improved by:

- Defininng a tuple of the `Asset`-like types OR making
`ContinuousFuture` and `Asset` share a common type (whether that is
`ContinuousFuture` inheriting from `Asset` or making `Asset` and
`ContinuousFuture` share a common type.)

- Make a `history` test which uses `BarData` + `ContinuousFuture`,
instead of just using the history loader directly from tests.
2016-11-07 16:34:26 -05:00
Andrew Daniels 993b694d49 BUG: Allows 'contract' in get_spot_value with daily frequency (#1582)
Also removes duplicate check in test_current_contract.
2016-11-07 16:28:48 -05:00
Eddie Hebert 84e1813e95 Merge pull request #1581 from quantopian/import-style-on-calendars
STY: Add space between import and open parens.
2016-11-04 14:08:05 -04:00
Eddie Hebert 974d846ac6 Merge pull request #1580 from quantopian/research-compatible-history-loader
ENH: Allow configurable history prefetch length.
2016-11-04 14:07:33 -04:00
Eddie Hebert d1b2511864 STY: Add space between import and open parens.
For compliance with newer flake8 versions.

Should be no functional change.
2016-11-04 13:45:19 -04:00
Eddie Hebert abc4f55f64 ENH: Allow configurable history prefetch length.
To support using a `DataPortal` and `HistoryLoader` in a notebook, allow
the prefetch length to be configurable, so that it can be set to 0.
Unlike backtesting where the prefetch is useful for repeated history
windows viewed from datetimes which are monotonically increasing by a
small amount, the notebook usage of history windows needs only to
retrieve the exact data needed for the window specified.

This patch also fixes some boundary conditions related to rolls and
adjustments which were uncovered by querying for the adjustments with an
end date near the end of the window.
2016-11-04 13:30:30 -04:00
Andrew Daniels 87c49ae44b PERF: Use ctable.resize to speed up BcolzMinuteBarWriter.truncate (#1578)
This is significantly faster than the previous approach of writing a new
ctable with a slice of the existing table.
2016-11-04 10:31:41 -04:00
Scott Sanderson c89c618ccf Merge pull request #1574 from quantopian/make-corrcoefs-window-safe
ENH: Mark statistical terms as window_safe.
2016-11-01 12:49:27 -04:00
Scott Sanderson df78f57a51 ENH: Mark statistical terms as window_safe. 2016-11-01 12:16:34 -04:00
Scott Sanderson 88ff033288 Merge pull request #1573 from quantopian/rename-specific-assets
MAINT: Rename `SpecificAssets` to `StaticAssets`.
2016-11-01 12:15:10 -04:00
Scott Sanderson 1b9b3c1a29 MAINT: Rename SpecificAssets to StaticAssets.
This better reflects the intended usage of accepting a fixed set of
predetermined assets.
2016-11-01 11:01:36 -04:00
Joe Jevnik f878bf2365 BUG: load extensions in IPython magic (#1543) 2016-10-28 16:00:51 -04:00
Joe Jevnik 156678ab6c Merge pull request #1521 from quantopian/add-optimization-pass-for-initial-workspace
Add optimization pass for initial workspace
2016-10-28 15:42:52 -04:00
Scott Sanderson 2536ad29c3 STY: Put 0 at the end. (#1569) 2016-10-28 15:14:22 -04:00
Joe Jevnik dd191f4ab2 STY: cleanup 2016-10-28 15:04:18 -04:00
Scott Sanderson bb2d25e67c ENH: Allow windows of NumericalExpression.
If all the inputs to an expr are window-safe, then the expr is itself
window-safe.
2016-10-28 15:04:18 -04:00
Scott Sanderson 582c44a4aa TEST: Add more populate_initial_workspace tests.
- Tests different pipeline lengths and window lengths.
- Tests a term that depends on a window of a term that's been
  precomputed.
2016-10-28 15:04:18 -04:00
Joe Jevnik d07f133579 STY: remove unused imports and method, clean up docs 2016-10-28 15:04:18 -04:00
Joe Jevnik af3e1016a0 TST: add tests for postprocess and to_workspace_value 2016-10-28 15:04:18 -04:00
Joe Jevnik bac7af580b TST: add more dispatches 2016-10-28 15:04:18 -04:00
Joe Jevnik bae4088cc0 ENH: cleanup branch based on feedback 2016-10-28 15:04:18 -04:00
Joe Jevnik 0123bb8a97 ENH: prune the graph based on the initial workspace 2016-10-28 15:04:18 -04:00
Joe Jevnik e3e4ad2735 ENH: update aliasedmixin repr 2016-10-28 15:04:18 -04:00
Joe Jevnik c8e40a3736 ENH: Make aliases filters, factors, and classifiers to give them their methods 2016-10-28 15:04:18 -04:00
Scott Sanderson 13c8139d45 WIP: Add Alias expression. 2016-10-28 15:04:18 -04:00
Joe Jevnik 67b35168db ENH: provide a hook for prepopulating the initial workspace 2016-10-28 15:04:18 -04:00
Joe Jevnik a1d4ceae54 ENH: Provide methods to undo the 'postprocess' step in computing pipeline output 2016-10-28 15:04:18 -04:00
Scott Sanderson 5ecb5c3754 Merge pull request #1568 from quantopian/fix-microoptimizations
Fix microoptimizations
2016-10-28 14:57:43 -04:00
Scott Sanderson 21a3f1a7ed MAINT: Consolidate data_portal names.
Rename _get_daily_window_for_sids to _get_daily_window_data.
Rename _get_minute_window_for_assets to _get_minute_window_data.
Rename _get_daily_data to get_daily_spot_value.
2016-10-28 14:35:05 -04:00
Scott Sanderson 8ccef7b9ab DOC: Comment on outdated code. 2016-10-28 14:06:35 -04:00
Scott Sanderson 1fbc17d281 BUG: Raise SidsNotFound in retrieve_asset. 2016-10-28 14:05:49 -04:00
Richard Frank 2c819a672b Merge pull request #1567 from bernoullio/master
MAINT: Restore @property decorator
2016-10-28 12:10:58 -04:00
keang 265c02b0c1 MAINT: Restore @property decorator
This will keep `opens`, `closes`, `early_closes`, etc to the
same pattern.
2016-10-28 23:25:53 +08:00
Scott Sanderson 285b5f7d77 Merge pull request #1561 from quantopian/micro-optimizations-2
Micro optimizations 2
2016-10-28 10:36:33 -04:00
Eddie Hebert 9a51efc7d2 Merge pull request #1565 from quantopian/fix-offset-history
BUG: Fix continuous future history with offsets.
2016-10-28 09:44:34 -04:00
Eddie Hebert 575a8cf048 BUG: Protect against contract offset at end of range. (#1564)
This boundary case was exposed with internal fixture data which used a
continuous future with a contract chain of size one.
2016-10-27 16:48:34 -04:00
Eddie Hebert 4235dbd758 BUG: Fix continuous future history with offsets.
Apply offset value when writing out the rolls in a continuous future
which is offset from the primary.
2016-10-27 16:23:03 -04:00
Eddie Hebert 43ca435e1a Merge pull request #1563 from quantopian/use-same-session-for-contract-closes
BUG: Use proxy for settlement on future adjustments.
2016-10-27 13:31:12 -04:00
Eddie Hebert aa021531d9 BUG: Use proxy for settlement on future adjustments.
Instead of using the difference between the session close of the front
contract before the roll and and the open of back contract on the
beginning of the roll, use the close of both at the end of the session
before the roll.

The closes of the session prior to roll is in lieu of settlement data.
2016-10-27 12:40:59 -04:00
Scott Sanderson 70cc6022f9 PERF: Call concatenate directly instead of hstack.
Avoids a couple function calls in a hot path.
2016-10-26 23:49:48 -04:00