Commit Graph

1152 Commits

Author SHA1 Message Date
Eddie Hebert bc4c6fb245 MAINT: Use reader dict for last sale dt lookup.
Also, add direct coverage of last_traded_dt in the `test_data_portal`
module.

Prepares for adding test coverage of `get_last_traded_dt` for `Future` assets.
2016-08-08 10:02:18 -04:00
Eddie Hebert c7020a9945 TST: Use data portal fixture.
Wire in data portal fixture for test data_portal, prepare for putting
more coverage of results in test_data_portal suite.
2016-08-08 08:25:20 -04:00
Eddie Hebert dd2c7db22d TST: Use sum for volume on daily data resample.
Change the mock minute data to no longer use an increasing arange, so
that a days worth of minute data can be summed and fit inside of a
uint32.

This change was required because of working on new test data that looked
like [0, 100, 200, 0, ] which was resulting in a daily rollup of 0 data,
when the coverage needed a non-0 value.

Also, factor out the resampling function, with an eye on a making it
easier to convert from minute bars to daily bars during ingest/load
processes.
2016-08-05 14:24:14 -04:00
Eddie Hebert e934c6aeaf TST: Make room for multiple calendars in tests.
When adding fixtures for futures data, there will be a need for multiple
calendars in the fixture ecosystem. e.g. a test that includes both
equities and futures would need an overall calendar which encompasses
both equities and futures; however, the test data for equities should
still still be limited to the bounds set by the NYSE calendar.

Make the fixtures that setup trading calendars and values dervied from
the trading calendar (e.g. trading sessions) accept an iterable of
calendars which need to be created, then populate those values into a
dict keyed by the calendar name.

Change `WithNYSETradingDays` to include sessions in the name,
since we are moving to session as the name for the 'day' unit.

Provide `trading_days` which is really "NYSE trading sessions` on
`WithTradingSessions` for backwards compatibility.
2016-08-05 12:17:27 -04:00
Jean Bredeche 2a41331da3 BUG: Need to set simulation_dt in before_trading_start
so that log lines in b_t_s have the proper dt.
2016-08-04 11:59:48 -04:00
Jean Bredeche d1077a36c2 TST: Fix broken tests, updated example data 2016-08-04 09:38:18 -04:00
Jean Bredeche e6af4e4f1b ENH: made exchange a required parameter to Asset and its subclasses
This required updating a lot of tests.
2016-08-02 23:21:39 -04:00
Jean Bredeche 9ae725b940 ENH: update register_calendar API to take a specific name 2016-08-02 23:12:07 -04:00
Jean Bredeche 97ccb54326 MAINT: PR cleanup 2016-08-02 23:12:07 -04:00
Jean Bredeche 6020752a1d TST: Filter out pandas performance warnings in tests (for now) 2016-08-02 23:12:07 -04:00
Jean Bredeche fd03004d9f TST: Add tests to verify that we check the correct exchange calendar for can_trade
Also added temporary code to skip trying to get the last price of a
Future until we have finished the Futures data layer.
2016-08-02 23:12:07 -04:00
Jean Bredeche 2854c77d55 ENH: Clock now fires a BEFORE_TRADING_START_BAR event.
`AlgorithmSimulator` listens to that event to call the algorithm's
`before_trading_start` method.
2016-08-02 23:12:07 -04:00
Jean Bredeche d8af3fb92e ENH: Augment data.can_trade to check whether the asset's exchange is currently
open.
2016-08-02 23:11:10 -04:00
Joe Jevnik 1f10fff1c4 BUG: support querying more than 999 assets at a time 2016-08-02 18:53:57 -04:00
Gil Wassermann 483397e554 ENH: Added AtLeastN filter 2016-08-02 16:34:32 -04:00
Joe Jevnik 74c46732e5 Merge pull request #1361 from quantopian/point-in-time-assets-db-again
Point in time assets db again
2016-08-02 15:35:56 -04:00
Joe Jevnik 6708ef1bdf ENH: update assets-db-error-msg 2016-08-02 14:25:10 -04:00
Joe Jevnik 4265a13edf Revert "Merge pull request #1354 from quantopian/revert-1302-point-in-time-asset-db"
This reverts commit 3b633011c6, reversing
changes made to 70ac5323de.
2016-08-02 14:25:10 -04:00
Andrew Liang 5b9d2e2d04 Merge pull request #1353 from quantopian/yield_capital_changes2
ENH: Yield capital change information
2016-08-02 14:19:55 -04:00
Jean Bredeche ecac6e9e08 Merge pull request #1360 from quantopian/shorten-equity-exchange
ENH: Adding `exchange_full` to equity asset column
2016-08-02 11:35:27 -04:00
Jean Bredeche c54ede896c rebuilt in py3/pandas16 2016-08-02 10:43:04 -04:00
Scott Sanderson 129d16fd3d Merge pull request #1358 from quantopian/smoothing
ENH: added smoothing to zipline
2016-08-02 10:32:11 -04:00
Jean Bredeche 33bef2165c rebuilt data in py3 2016-08-02 10:17:19 -04:00
Jean Bredeche a40d205afa ENH: Adding exchange_full to equity asset column 2016-08-02 09:35:08 -04:00
Scott Sanderson f13294de4e ENH: Rename StrictlyTrue to All and add Any().
Also, moved All() and Any() to `zipline.pipeline.filters.smoothing`.
2016-08-01 22:10:28 -04:00
Gil Wassermann 574d7b197f TEST: test for rolling nature of smoothing filter 2016-08-01 15:35:22 -04:00
Andrew Liang 5904ecb40f ENH: Yield capital change information 2016-08-01 15:19:11 -04:00
Andrew Liang 18aba63da9 Merge pull request #1359 from quantopian/refactor_subperiod
MAINT: Refactor application of capital changes
2016-08-01 14:00:48 -04:00
Gil Wassermann 7623c0f6eb MAINT: .sum() behaviour 2016-08-01 13:48:14 -04:00
Andrew Liang 98f3fc9326 MAINT: Refactor application of capital changes
Previously, on the dt of a capital change, we use the un-updated
prices to find the ending performance of the previous subperiod and
then got the new prices to determine the portfolio value used to
calculate the delta, without actually updating the performance
before applying the capital change. This logic is confusing and
unintuitive. Instead, save the ending performance as we do previously,
but have temp values for the starting current subperiod value.
Update those temp values after processing the capital change
2016-08-01 11:51:45 -04:00
Gil Wassermann c10af2a0b9 TEST: more thorough testing 2016-08-01 11:40:14 -04:00
Gil Wassermann 73de8e6182 STY: style changes and strictly_true_filter 2016-08-01 11:16:02 -04:00
Gil Wassermann 694d9e952a ENH: added smoothing to zipline 2016-08-01 08:20:10 -04:00
Joe Jevnik 9103516e82 Merge pull request #1313 from nathanwolfe/master
BUG: Add support for Panel data in accordance with documentation
2016-07-29 20:11:56 -04:00
Nathan Wolfe 0a196c7a69 MAINT: Correct PanelBarReader sessions property, expand test
`tests/test_panel_daily_bar_reader.py` expanded to cover minute
frequency as well, using the same tests. Renamed to
`test_panel_bar_reader.py`.
2016-07-29 17:36:18 -04:00
Nathan Wolfe ab9a899c5b MAINT: Switch PanelBarReader to take trading calendar and freq args 2016-07-29 17:36:08 -04:00
Nathan Wolfe 763f2ab8b4 MAINT: Combine daily and minute into PanelBarReader.
Also simplify `load_raw_arrays` and `get_last_traded_dt`.
2016-07-29 17:34:28 -04:00
Nathan Wolfe bdce4ef257 TST: Expand Panel data test to test for multiple sids. 2016-07-29 17:32:00 -04:00
Nathan Wolfe 55b79e8f32 TST: Test TradingAlgorithm.run and run_algorithm on raw Panel data 2016-07-29 17:15:35 -04:00
Jean Bredeche a937d6e6b1 Merge pull request #1352 from quantopian/move-daily-aggregator
MAINT: Move daily aggregator to own module.
2016-07-28 09:45:50 -04:00
Joe Jevnik 814a2be7b7 Revert "Point in time asset db" 2016-07-27 23:29:08 -04:00
Eddie Hebert e00a25568d MAINT: Move daily aggregator to own module.
Break out the daily history aggregator into its own module, instead of
being collocated with DataPortal.
2016-07-27 16:59:26 -04:00
Jean Bredeche 3305933089 DEV: Change daily mode to use last minute of session instead of session itself. 2016-07-27 09:20:24 -04:00
Jean Bredeche 2462929368 Revert "Merge pull request #1340 from quantopian/by-daily-i-mean-minutely"
This reverts commit f4456719b0, reversing
changes made to 4be07e4628.
2016-07-26 16:20:14 -04:00
Joe Jevnik fb532c3fe8 TST: Adds test for symbol changes 2016-07-26 13:34:58 -04:00
Joe Jevnik 7fd8c29880 ENH: add point in time aspect to equity symbol mapping
Changes the overlap behavior so that it is an error to write data which
would have two companies holding the same ticker. Other than one test
around which company would win in that case, all the other tests are
passing. That single test has been changed to check the write-time
error.
2016-07-26 13:34:58 -04:00
Jean Bredeche bcb547d5a8 DEV: Change daily mode to use last minute of session instead of session itself. 2016-07-26 12:49:49 -04:00
Scott Sanderson 49bb8264dc ENH: Finish adding groupby to rank/top/bottom.
- Added test coverage for grouped and masked top/bottom.

- Added test coverage for grouped rank on datetime factors.

- Fixed an issue where grouped rank would fail on datetime inputs
  because unary-negative isn't defined for datetimes.  We now instead
  directly invoke a function from rank.pyx that does the normalizations
  as neeeded.

- Fixed an issue where GroupedRowTransform assumed that it produced the
  same dtype as its input.  This isn't true for rank() of a
  datetime-dtype factor.  GroupedRowTransform now takes a required dtype
  parameter.

- Similarly, fixed an issue where GroupedRowTransform assumed that its
  missing_value was the same as its parent's, which isn't true for
  rank() of a datetime-dtype factor.  GroupedRowTransform now takes a
  required dtype parameter.

- Fixed an issue where Factor.demean() and Factor.zscore() weren't
  properly cached because their static_identity included a closure that
  was dynamically generated on each invocation.  They both now always
  use a function defined at module scope.
2016-07-26 02:57:35 -04:00
Andrey Portnoy 9e3404646e add groupby to rank, top, and bottom 2016-07-25 23:53:33 -04:00
Lotanna Ezenwa 161922897e Merge pull request #1282 from quantopian/fix-data-tests-discovery
TST: fix bundle test discovery
2016-07-25 18:36:38 -04:00