Commit Graph

2386 Commits

Author SHA1 Message Date
Maya Tydykov e8185a1512 MAINT: reorganize - move testing mixin to fixtures
BUG: correctly create asset finder

MAINT: rename fixture

STY: fixes for flake8

STY: add space around assignment

MAINT: add var back to constructor

MAINT: remove unused import

MAINT: compare var with None directly

MAINT: fix merge errors
2016-03-29 13:15:16 -04:00
Maya Tydykov 6b3560ade8 MAINT: remove redundant function and move to utils 2016-03-29 13:12:51 -04:00
Maya Tydykov 06dd6e958d TST: recfator tests to use fixtures
MAINT: use np.array

MAINT: return cols rather than modifying attribute
2016-03-29 13:12:50 -04:00
Maya Tydykov 8a28e82d32 ENH: add dividends to pipeline
MAINT: remove record date - not needed.

MAINT: restructure dividends dataset.

MAINT: restructure dividends factors.

WIP: update dividends tests.

MAINT: correct the way to get the 'next' event frame.
2016-03-29 13:12:50 -04:00
Scott Sanderson 9a04621781 ENH: Add eq and __ne__ to Classifier. 2016-03-28 15:46:28 -04:00
Scott Sanderson 92feaa3a7d BUG/TEST: Dict key order isn't guaranteed. 2016-03-28 10:21:57 -04:00
Scott Sanderson a932628627 BUG: Use six viewkeys. 2016-03-28 09:24:56 -04:00
Scott Sanderson 9e0ad5de15 DOC: Fix bincount in docstring. 2016-03-25 15:11:18 -04:00
Scott Sanderson 18bd7010b5 ENH: Improve short_reprs of classifier/normalizer.
GroupedRowTransform now shows the name of its transform, and Quantiles
shows the number of quantiles.

These are used by Pipeline.show_graph().
2016-03-25 15:11:18 -04:00
Scott Sanderson 758d6c74fc ENH: Add isnull and notnull for classifiers. 2016-03-25 15:11:18 -04:00
Scott Sanderson 5ed1a4fcd1 ENH: Add quartiles/quintiles/deciles.
They're all syntactic sugar for the equivalent invocations of quantiles.
2016-03-25 15:11:18 -04:00
Scott Sanderson 872b84e09a ENH: Implement Factor.quantiles. 2016-03-25 15:11:18 -04:00
Scott Sanderson 16c5aecba6 DEV: Add utility for permuting rows in an array.
Useful for testing rank-order functions on arrays.
2016-03-25 15:11:18 -04:00
Scott Sanderson d0625e8a8d MAINT: Move ignore_nanwarnings to numpy_utils. 2016-03-25 15:11:18 -04:00
Scott Sanderson 1f237d43a3 MAINT: Make preprocessor factories closures. 2016-03-25 15:11:18 -04:00
Scott Sanderson 1245552340 DEV: Add expect_dimensions preprocessor. 2016-03-25 15:11:18 -04:00
Scott Sanderson b85eb36da8 TEST: Add test for demean example. 2016-03-25 15:11:18 -04:00
Eddie Hebert 75213ac176 MAINT: Write open and closes for minute bar format
Write arrays representing corresponding market opens and market closes,
which will eventually replace the `minute_index` field.

The market closes are being added for incoming work on another branch
which will use the market closes to generate a list of non-market
minutes to filter out when returning data from `unadjusted_window`.
2016-03-24 23:18:42 -04:00
Richard Frank dd8175b1d9 TST: Forward arguments to numpy 2016-03-23 15:26:53 -04:00
Richard Frank d873038a7e BUG: Specify int64 instead of system int
to handle 32bit python
2016-03-23 15:26:52 -04:00
dmichalowicz 7e83a8df5f BUG: NumericalExpressions fail to merge with too many inputs 2016-03-23 14:04:50 -04:00
Maya Tydykov 4164ffdcb0 BUG: call correct method 2016-03-21 16:41:23 -04:00
Scott Sanderson 387c43511a DOC: Add missing word in docstring. 2016-03-20 17:05:48 -04:00
Scott Sanderson 396d2f4327 DOC: Update Filter/Factor/Classifier docstrings. 2016-03-19 19:09:16 -04:00
Scott Sanderson 381a231725 MAINT: Clean up mixin usage.
- Use RestrictedDTypeMixin for dtype validation in
  Filter/Factor/Classifier.
- Use new LatestMixin for Latest{Filter,Factor,Classifier} instead of
  duplicating logic across all three.
- Always ignore return values in _validate.
- Consistently call super() first in validation mixins.
2016-03-19 19:09:16 -04:00
Scott Sanderson cace5f3a6c MAINT: Delete old classifier.py 2016-03-19 17:04:28 -04:00
Scott Sanderson 9505363f50 DOC: Add comment. 2016-03-19 17:04:28 -04:00
Scott Sanderson dd842bfde5 BUG: .latest, not latest.
The latter happens to work on py2 :(.
2016-03-19 17:04:28 -04:00
Scott Sanderson e6361ae48b MAINT: Re-export CustomFilter and CustomClassifier. 2016-03-19 17:04:28 -04:00
Scott Sanderson 53d3b0855b ENH: Add support for Classifiers.
Classifiers are computations that represent grouping keys. They can be
used in conjuction with normalization functions like ``zscore`` or
``demean`` to perform normalizations over subsets of a dataset.

Notable changes:

- Added ``demean()`` and ``zscore()`` methods to ``Factor``.

- Added a classifier versions of ``Latest`` and ``CustomTermMixin``.
  The .latest attribute of int64 dataset columns no produces a
  classifier by default.

- Added ``Everything``, a classifier that maps all data to the same
  value.

- Added ``zipline.lib.normalize``, which implements a naive, pure-Python
  grouped normalize function.  This will likely be moved to Cython in a
  subsequent PR.
2016-03-19 17:04:28 -04:00
Scott Sanderson 1f0e1e8908 BUG: Allow Filter comparisons with AssetExists.
Allow comparisons like SomeFilter() & AssetExists().

Previously such comparisons would fail because & and | on Filters
explicitly checked that the other side of the operator was also a
Filter.

We now only enforce that the other side of the expression is a Term
with a dtype of bool_.
2016-03-19 17:04:28 -04:00
Scott Sanderson 705f87215b DOC: Update engine docstrings. 2016-03-19 17:04:28 -04:00
Scott Sanderson 56942e4598 DOC: Fix typo in docstring. 2016-03-15 20:34:40 -04:00
Scott Sanderson 73562a159d MAINT: Cleanups while reading fixtures. 2016-03-15 20:25:37 -04:00
Joe Jevnik 71f4e28e90 Merge pull request #1054 from quantopian/with-trading-env
WithTradingEnvironmnet and WithSimParams
2016-03-15 19:35:33 -04:00
Joe Jevnik 792860b4cb MAINT: rename bz.Data -> bz.data 2016-03-15 14:29:48 -04:00
dmichalowicz 990c76e9fb BUG: Empty pipeline failed to tz_localize 2016-03-15 14:19:31 -04:00
Richard Frank 2976280a76 DOC: Fixed example notebook to include required calls to symbol 2016-03-15 11:08:44 -04:00
Eddie Hebert 0f14972e08 ENH: Unadjusted window data for minute bars.
Add a method to minute bar reader which returns the OHLCV for all
requested fields for a list assets over the specified start and end
minutes.

Initial usage is intended for use by a loader which consumes minute bar
data to resample into daily bars, but may also be used when aggregating
minute data during '1d' history calls in Q2.0.

This iteration does not include including of early closes.
2016-03-14 21:52:01 -04:00
Joe Jevnik 4f247e3aaa TST: Adds WithLogger and WithTradingEnvironment 2016-03-14 19:32:55 -04:00
Maya Tydykov 8022a47f74 BUG: fix previous frame logic and buyback auth tests
WIP: earnings test case separated works

WIP: fix/reorganize buyback auth.

MAINT: clean up

MAINT: fix merge conflicts
2016-03-14 10:39:17 -04:00
Stewart Douglas ccdb376489 Merge pull request #1018 from quantopian/order-multiplier-values
BUG: Ensure consistent ordering of amounts, prices & multipliers
2016-03-11 17:49:50 -05:00
Scott Sanderson 7a6d2fb66e MAINT: Use more specific signature in decorator.
`if_not_float64_tell_caller_to_use_isnull` can't take additional
arguments, and accepting *args/**kwargs causes Sphinx to generate an
incorrect signature for decorated methods.
2016-03-11 15:29:44 -05:00
Stewart Douglas e47cb96479 BUG: Ensure consistent ordering of amounts, prices & multipliers
Previously, we have assumed that the `amounts` and `last_sale_prices`
lists have the same order as the `value_multipliers`. This is not
correct, since to populate the `amounts` and `last_sale_prices` lists
we iterate over a `dict` (self.positions). The order of this `dict`
can change in arbitrary ways when it is updated, which occurs when
we call `update_positions`. Our `value_multipliers` however are stored
in an `OrderedDict`, meaning the order of existing key/value pairs
is not changed when they are updated.

To address this issue, we make sure that `self.positions` subclasses
`OrderedDict`.
2016-03-11 13:16:24 -05:00
Joe Jevnik 4f0babc558 DOC: update TradingAlgorithm docstring 2016-03-11 11:38:43 -05:00
Joe Jevnik 721dd36116 TST: move test_utils and adds test fixture classes
Renames zipline.utils.test_utils to zipline.testing

Adds zipline.testing.fixtures.ZiplineTestCase to manage setup and
teardown and adds mixins to define fixtures like an asset finder or
trading calendar.
2016-03-10 15:39:52 -05:00
Maya Tydykov 328d449e60 MAINT: don't test handler. 2016-03-08 19:29:28 -05:00
Maya Tydykov 195c2fffb6 DOC: update doc.
DOC: update docs.
2016-03-08 17:24:04 -05:00
Maya Tydykov c87293942f TST: remove logging test and move missing sid test.
DOC: add docstring.

TST: reduce test data redundancy.

MAINT: use string constant.
2016-03-08 17:24:04 -05:00
Maya Tydykov ecb493e1a1 MAINT: remove logging. 2016-03-08 17:24:04 -05:00