Commit Graph

892 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 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 0ebb72fe0d TEST: Explicitly use int64 everywhere.
Otherwise these tests will fail on 32-bit systems.
2016-03-28 12:21:58 -04:00
Scott Sanderson 076868f5a1 MAINT: Refactor shared code into test method. 2016-03-28 11:56:15 -04:00
Scott Sanderson fe22bde998 TEST: Test uneven buckets in quantiles. 2016-03-28 11:34:58 -04:00
Scott Sanderson c6e58af51b TEST: Test quantiles with better input.
Take the log of arange so that we know we don't depend on linearity of
the input.
2016-03-28 09:24:56 -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 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 a1ad717920 TST: Clean up refs to adjustments db, so windows can remove its dir 2016-03-23 15:26:53 -04:00
Richard Frank 335f73e1e9 TST: Windows fixups 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
Scott Sanderson 3c53b4944b TEST: Test not calling super()._validate. 2016-03-19 19:09:16 -04:00
Scott Sanderson bae78ae522 MAINT: Use clearer parameter name. 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
Adam Blackwell ebda1b2ec8 TST: fixing relative imports 2016-03-16 12:17:53 -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
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
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 0e97a01c05 TST: Test multiple calls to update_positions 2016-03-11 13:16:25 -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 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 6976f7e459 # This is a combination of 8 commits.
# The first commit's message is:
BUG: ignore sids in deltas missing from asset index.

# This is the 2nd commit message:

MAINT: use correct debugger.

# This is the 3rd commit message:

MAINT: fix set add.

# This is the 4th commit message:

WIP: move sid filtering.

# This is the 5th commit message:

WIP: move filtering logic.

# This is the 6th commit message:

WIP: working test.

# This is the 7th commit message:

TST: clean up test.

# This is the 8th commit message:

STY: fix flake8.
2016-03-08 17:24:04 -05:00
Eddie Hebert 102f08535e Merge pull request #1034 from quantopian/add-floor-to-trading-env
ENH: Add min date to TradingEnvironment.
2016-03-08 15:08:25 -05:00
Scott Sanderson 1b5bc20e38 Merge pull request #1035 from quantopian/refactor-atomic
MAINT: Remove notion of "atomic" pipeline terms.
2016-03-08 14:50:24 -05:00
Eddie Hebert 3208bfdbb6 ENH: Add min date to TradingEnvironment.
Allow creation of TradingEnvironment to specify a minimum date, so that
trading days, market opens, etc. can trimmed to a range more relevant to
the backtest.

This changes is with an eye towards storing all market minutes in the
trading environment, where storing values for much more than the
simulation range starts to become more costly.
2016-03-08 14:40:42 -05:00
Scott Sanderson 535d05e714 MAINT: Remove notion of "atomic" pipeline terms.
Replace it by distinguishing between "Loadable" and "Computable".

This is useful because it's now  possible to write computable terms that
don't require  any inputs  (e.g. an `Always`  filter or  an `Everything`
classifier).
2016-03-08 13:49:45 -05:00
Maya Tydykov eb8fed501b MAINT: add buyback auth to factors init. 2016-03-08 12:28:16 -05:00
Scott Sanderson dd3b3f3afb Merge pull request #1026 from quantopian/pipeline-generic-isempty
ENH: Add `isnull` and `notnull` methods to Factor.
2016-03-07 18:26:42 -05:00
Scott Sanderson f635a14289 ENH: Add isnull and notnull methods to Factor. 2016-03-07 16:19:08 -05:00
Scott Sanderson e810f26097 ENH: Add utilities for checking types generically. 2016-03-07 16:18:33 -05:00
Maya Tydykov 810862eef4 MAINT: rename variables to simplify. 2016-03-03 15:27:16 -05:00
Joe Jevnik 79e7c84a40 TST: use rel imports from tests 2016-02-26 20:22:02 -05:00
Maya Tydykov 18d838be87 MAINT: modify coersion logic.
MAINT: make expected_cols class attributes.

MAINT: make concrete_loader a class attribute.

MAINT: drop sid column before creating loader.

TST: add method to fill df with event cases.

TST: move common case df into test_events.py.

TST: improve tests and fix error message assertions.

STY: fix whitespace.

DOC: update docs.

STY: fix style.

MAINT: clean up

STY: fix indentation.

MAINT: use different assertion method to check error message for python3.4 compatibility.
2016-02-26 09:51:58 -05:00
Maya Tydykov 5b37af6e04 TST: enhance test; add more common data.
STY: fixes for PEP8.
2016-02-25 17:33:46 -05:00
Maya Tydykov e257dc1da9 MAINT: refactor constants to common file.
TST: refactor constants and clarify comments.

TST: clean up/extract constants in tests.

MAINT: add/modify constants.

MAINT: remove obsolete and alphabetize.

MAINT: clean up.

MAINT: modify constants to have named params.

MAINT: extract constants.

STY: fix indentation.

MAINT: refactor common part out of buyback_auth.

MAINT: refactor earnings test logic.
2016-02-25 17:33:45 -05:00
Maya Tydykov ae922bf3ee MAINT: modify next_date_frame and prev_date_frame to mirror previous_value.
MAINT: clean up and improve docs.

BUG: fix imports.

MAINT: refactor test.

MAINT: change class name.

MAINT: remove error since won't be reached.

TST: improve and expand tests.

MAINT: change class name.

MAINT: change class name.

MAINT: extract string constants and remove error that won't be reached.

STY: fix line length.

MAINT: undo name change.
2016-02-25 17:33:44 -05:00
Maya Tydykov 8ceff892c5 BUG: specify UTC and no name-checking.
DOC: fix doc.

MAINT: revert to using getitem.
2016-02-25 17:33:43 -05:00
Maya Tydykov 7ddf18b407 MAINT: use column's missing value.
STY: fix flake8 failures.

MAINT: fixes for compatibility with py2.

MAINT: fix import error.

MAINT: use dict.items() for compatibility with py3.
2016-02-25 17:33:42 -05:00
Maya Tydykov 7100e60474 MAINT: accept more data structures, verify, and select loader dynamically.
MAINT: add fields based on changes to events loader.

MAINT: modify based on expectations of events loader.

MAINT: modify args.

TST: clean up and clarify df access.

TST: fix bugs in test that didn't properly split datasets' data.

MAINT: fix merge error.
2016-02-25 17:33:41 -05:00