Commit Graph

372 Commits

Author SHA1 Message Date
Joe Jevnik a3dbf7590e TST: doctest failure 2016-01-13 16:36:20 -05:00
Joe Jevnik 6280614a69 DOC: whatsnew 2016-01-13 16:36:20 -05:00
Joe Jevnik 5351b60a4c ENH: adds optionally for preprocessors 2016-01-13 15:26:37 -05:00
Joe Jevnik 5a235bdaef ENH: allows users to specify the cutoff time for data query in blaze
loaders

This allows people to set their cutoff time to the time they will
actually execute 'before_trading_start'. Currently this is just passed
to the constructor of the loader; however, I would like to make this
managed by the algorithm simulation runner. This would help keep all of
the loaders in sync and lock 'before_trading_start's execution to the
time the data is queried for.
2016-01-13 15:26:13 -05:00
Scott Sanderson b6175de5f1 DOC/TEST: Add doctest and docs for coerce kwargs. 2016-01-12 17:51:13 -05:00
Scott Sanderson 43b6344d5f ENH: Add `coerce` preprocessor. 2016-01-12 17:36:36 -05:00
Joe Jevnik fb6d1ea3d1 MAINT: move some helpers to test_utils 2016-01-08 13:11:31 -05:00
Joe Jevnik a2d1fedffd ENH: Adds classlazyval for computed values on a class 2016-01-08 13:11:31 -05:00
Joe Jevnik a524cf1880 BUG: fix bug that caused symbols to be added to the asset finder twice 2016-01-05 16:27:46 -05:00
Eddie Hebert b863733953 REF: Move order class to distinct module. 2015-12-15 16:23:59 -05:00
Scott Sanderson 4469fbef76 MAINT: Just the value if dtype doesn't have a name. 2015-12-10 17:34:38 -05:00
llllllllll 48536add73 TST: fix doctests 2015-12-09 11:22:13 -05:00
Scott Sanderson 8220d1ee86 ENH: Adds support for different typed adjusted arrays and adds an
EarningsCalendar loader.

- Moves most of AdjustedArray back into Python. The window iterator is
  the only part that's performance-intensive.

- Adds a bootleg templating system for creating specialized versions of
  AdjustedArrayWindow for each concrete type we care about.

- Adds support for differently dtyped terms in pipeline. This allows us
  to use datetime64s which are needed in the EarningsCalendar.

- Adds EarningsCalendar dataset for the next and previous earnings
  announcements in pipeline.

- Adds in memory loader for EarningsCalendar.

- Adds blaze loader for EarningsCalendar.
2015-12-08 20:24:06 -05:00
Scott Sanderson 3fda7a7be5 MAINT: Alias methods for 0.17 compat. 2015-12-01 10:48:20 -05:00
llllllllll 0e246a2eee MAINT: error message cleanup 2015-11-24 16:55:07 -05:00
llllllllll 7896520bce ENH: better error and don't catch attrerror 2015-11-24 16:45:52 -05:00
llllllllll c62ac9ba74 ENH: cannot create two sentinels with same name and different doc 2015-11-24 16:45:52 -05:00
llllllllll 0cf85dec98 BUG: fix issues with sentinel 2015-11-24 15:07:27 -05:00
Scott Sanderson d91267c811 STY: Rename assets to sids. 2015-11-20 23:05:16 -05:00
Scott Sanderson 4832004c33 TEST: Test fallback to start_date/end_date sorting.
Adds tests asserting that we resolve conflicts in accordance with the
following rules when we have multiple assets holding the same symbol at
the same time:

If multiple SIDs exist for symbol S at time T, return the candidate
SID whose start_date is highest. (200 cases)

If multiple SIDs exist for symbol S at time T, the best candidate
SIDs share the highest start_date, return the SID with the highest
end_date. (34 cases)

It is the opinion of the author (ssanderson) that we should consider
this malformed input and fail here.  But this is the current indended
behavior of the code, and I accidentally broke it while refactoring.
These will serve as regression tests until the time comes that we
decide to enforce this as an error.

See https://github.com/quantopian/zipline/issues/837 for more
details.
2015-11-13 18:26:54 -05:00
Scott Sanderson 657a132f1e ENH: Make retrieve specific type functions public.
We rely on these upstream, for better or worse, so add tests and docs.

Also adds distinct `EquitiesNotFound` and `FutureContractsNotFound`
exceptions.
2015-11-13 18:26:54 -05:00
Scott Sanderson 3619a24e4d TEST: Add support for futures to tmp_asset_finder. 2015-11-13 18:26:54 -05:00
Scott Sanderson 9e463fd5d8 MAINT: make_rotating_asset -> make_rotating_equity. 2015-11-13 18:26:54 -05:00
Scott Sanderson 4109640acb MAINT: make_simple_asset_info -> make_simple_equity_info. 2015-11-13 18:26:54 -05:00
Scott Sanderson ff51510d88 PERF: Cache the result of failed lookups.
Otherwise we'll keep trying to look them up.
2015-11-13 18:26:54 -05:00
llllllllll f0dd92772f MAINT: typos 2015-11-11 19:24:25 -05:00
llllllllll b24c8fc7f4 TST: Adds a subtest decorator.
Allows us to run subtests while still seeing which parameter
combination caused the tests to fail. The decorator can be used to
create subtests inside a test or to parameterize an entire test method.

We cannot use something like unittest2.TestCase.subTest because our test
runner does not support that.
2015-11-11 19:22:53 -05:00
llllllllll 88a53fbdd1 ENH: update context_tricks
Moves _nop_context to context_tricks under the name nop_context.
Uses an explicit object for the actual context manager in callback
manager.
2015-11-11 14:19:13 -05:00
llllllllll 0cb4c38717 ENH: Allow users to pass a context manager to wrap all scheduled
functions.

This includes handle_data.
2015-11-11 14:19:13 -05:00
Scott Sanderson 7d35a17f76 Merge pull request #822 from quantopian/cant-set-lazy
ENH: Raise on attempt to set a lazyval.
2015-11-06 13:20:34 -05:00
Scott Sanderson 6b49081f54 MAINT: __set__ takes instance and value. 2015-11-06 13:03:31 -05:00
Scott Sanderson f3f001e14a ENH: Raise on attempt to set a lazyval. 2015-11-06 12:39:59 -05:00
Scott Sanderson a14c61e7ff MAINT: Remove unused 'asset_type' metadata entry. 2015-11-05 13:35:05 -05:00
llllllllll 420df53d78 ENH: pull sentinel construction into a function 2015-10-19 16:55:32 -04:00
llllllllll 5112421334 BUG: Fix the firstlineno of the validated functions 2015-10-19 16:55:32 -04:00
llllllllll b8452b88c3 TST: test case where there are more sids requested than available 2015-10-19 16:35:03 -04:00
llllllllll 4238391f6f DOC: docstring cleanup 2015-10-19 16:35:03 -04:00
llllllllll 3fb91e4d39 MAINT: cleanup doctests 2015-10-19 16:35:03 -04:00
llllllllll e9ec709453 MAINT: expect_value doctest and lambda over toolz 2015-10-19 16:35:03 -04:00
llllllllll c7ca0166cc MAINT: refactor tmp_db_uri to use make_simple_assetinfo 2015-10-19 16:35:03 -04:00
llllllllll 22ffe3fe49 ENH: adds expect_element preprocessor 2015-10-19 16:35:03 -04:00
llllllllll f88cd17028 TST: adds tmp_assets_db and tmp_asset_finder so we don't need an entire trading env 2015-10-19 16:35:02 -04:00
Thomas Wiecki d21aec17e2 MAINT Change relativedelta to Timedelta as pandas 0.17.0 deprecated relativedelta. 2015-10-16 16:15:25 +02:00
jfkirk 2686e3875a MAINT: Removes unnecessary benchmark load on some TradingEnvironments 2015-10-14 12:04:58 -04:00
Scott Sanderson 1336dfc181 BUG: RSI wasn't even close to working.
Fixed and added tests.
2015-10-09 20:10:30 -04:00
Stewart Douglas 4e2039c9b0 ENH: Coerce user input with API method decorator
Previously we have capitalized input strings at different levels in
our code: in the user-facing API methods and in the asset finder.
This commit moves input string capitalization exclusively to the API
method to which the string was supplied. Specifically, the string is
capitalized by a preprocess API method decorator. The preprocess
decorator passes the input string to the newly defined
ensure_upper_case() method, which returns a TypeError if the argument
supplied is not a string.

ensure_upper_case() is defined in a new file, zipline/utils/input_validation.py.
The existing expect_types() method is also moved there.

Various tests in tests/test_assets.py are modified to account for the
fact that the asset finder method lookup_symol() no longer capitalizes
its supplied argument.
2015-10-08 15:41:33 -04:00
Scott Sanderson 8e59d12daf ENH: Pipeline API
- Adds `zipline.pipeline.Pipeline`, a new user-facing class for managing
  pipelines of Modeling API expressions.

- Adds `attach_pipeline` and `drain_pipeline` as API methods

- Removes `add_factor` and `add_filter` as API methods.  These have been
  replaced two new methods on `Pipeline`: `add`, and `apply_screen`.

- Adding a `Filter` as a column no longer implicitly truncates rows from
  the Modelling API output.  It simply causes a new column, of dtype
  `bool` to show up in the output. Removal of rows is now handled by the
  new `apply_screen` method of `Pipeline`.

- Refactors the existing Modeling API tests to reflect the new APIs.
2015-10-01 18:03:53 -04:00
Scott Sanderson 524c7a0bb1 DOC: Fix example for require_not_initialized. 2015-10-01 18:03:53 -04:00
Scott Sanderson a483455183 ENH: Add zipline.utils.numpy_utils.
Currently provides two functions for doing fancy things with array
strides: `repeat_first_axis` and `repeat_last_axis`.
2015-10-01 18:03:53 -04:00
Scott Sanderson b766ce6ebd ENH: Add zipline.utils.cache.
Implements a `CachedObject` utility class for wrapping cached results
with an expiration date.
2015-10-01 18:03:53 -04:00