Commit Graph

1071 Commits

Author SHA1 Message Date
Eddie Hebert 4840e124af TST: Speed up TestMiscellaneousAPI
Limit the date range to one day, instead of a year.

On my local machine the following goes from taking 12 seconds to 0.6 seconds.

`$ nosetests -x tests/test_algorithm.py:TestMiscellaneousAPI`
2016-07-11 10:34:08 -04:00
dmichalowicz d8e9fa91bd Loader return column vector for no sids case 2016-07-01 12:18:32 -04:00
David Michalowicz d6c1c5fce9 Merge pull request #1309 from nathanwolfe/adv-fix
BUG: Correct AverageDollarVolume NaN handling
2016-06-30 14:04:43 -04:00
Eddie Hebert 51eda06323 MAINT: Add equity to naming of bar data classes.
In preparation of adding futures, add equity to the names of both the
classes and methods for writing bcolz data. Futures data will use a
different minutes per day with a separate reader. This change will allow
both equity and futures fixtures to be side by side.

Also, break out the method which generates the dataframes and trading
days member into fixtures (`EquityMinuteBarData` and
`EquityDailyBarData`) on which the `*BarReader` fixture depends.  This
fixture is separated out to enable reader/writers in different formats
to use the same data setup. (There is internal code which needs to write
minute and daily bar data in a database format.)
2016-06-30 08:21:42 -04:00
Nathan Wolfe 985e6bafee DOC: Add comment explaining ADV NaN test expected result calculation. 2016-06-29 11:34:21 -04:00
Nathan Wolfe e67b5e5516 TST: Change AverageDollarVolume test to check case of partial NaNs 2016-06-29 11:16:39 -04:00
Nathan Wolfe ebbcca73e8 TST: Add NaN cases to AverageDollarVolume factor test. 2016-06-29 10:12:35 -04:00
Andrew Daniels 5ac66aa19e BUG: Don't use calendar from daily bars in USEquityPricingLoader
This calendar only has up to the last trading day, use
default_nyse_schedule instead.
2016-06-28 13:38:17 -04:00
Eddie Hebert ca58632815 MAINT: Remove DataSource and derived classes.
The `DataSource` class and other classes derived from it are no longer
used. Instead `DataPortal` and various `MinuteBarReader` and
`DailyBarReaders` should be used.
2016-06-27 13:06:41 -04:00
Scott Sanderson 07b84f87fb PERF: Speed up test_events.
Use arrays in more places, and use permutations of indexers instead of
permutations of the values.

MAINT: add testing of boundary conditions

MAINT: use check_arrays to work with both pandas versions
2016-06-23 13:54:37 -04:00
Maya Tydykov 321e6f719f TST: expand tests
DOC: add comment to workaround line
2016-06-23 12:14:24 -04:00
Maya Tydykov 9395a469f0 BUG: change timestamp normalization to account for pandas bug
BUG: revert to old normalization algo with extra normalization
2016-06-23 12:14:22 -04:00
dmichalowicz 393f82e81e ENH: Add single-column input/output capabilities to pipeline terms 2016-06-23 10:24:09 -04:00
Scott Sanderson e510cbbf7b Merge pull request #1280 from quantopian/bad-pipeline-columns
BUG: Fail fast on invalid pipeline columns
2016-06-22 18:44:40 -04:00
Richard Frank 69b6cff964 Merge pull request #1289 from quantopian/wildcard
wildcard object and doctests
2016-06-22 18:09:57 -04:00
Joe Jevnik d608e0af4f Merge pull request #1276 from quantopian/blaze-loader-checkpoints
ENH: add ffill checkpointing to blaze core loader
2016-06-21 16:48:08 -04:00
Joe Jevnik ca37d73c7b TST: fix setup in test_flip_algo 2016-06-21 15:07:03 -04:00
Joe Jevnik 5925107052 TST: fix doctests to actually run 2016-06-21 15:07:03 -04:00
Joe Jevnik cb266b983a TST: more test for checkpoints 2016-06-21 13:20:52 -04:00
Andrew Liang 65bf854897 Merge pull request #1296 from quantopian/fix_month_start_rule
BUG: get_first_trading_day_of_month needs to return normalized dt
2016-06-21 12:55:06 -04:00
Andrew Liang 1643bd1db6 BUG: get_first_trading_day_of_month needs to return normalized dt 2016-06-21 12:26:40 -04:00
Eddie Hebert 87843e22fe MAINT: Remove unused module.
Remove module, last usage was removed during lazy access pattern
rewrite.
2016-06-21 09:50:00 -04:00
Joe Jevnik caebdf7cfc MAINT: shuffle the complex expression checks 2016-06-20 13:35:07 -04:00
Joe Jevnik cb67ee425e TST: coverage 2016-06-17 17:59:56 -04:00
Joe Jevnik c8cf5a6761 ENH: add ffill checkpointing to blaze core loader 2016-06-17 17:59:56 -04:00
dmichalowicz 6b9b9fb8e7 BUG: Fail fast on invalid pipeline columns 2016-06-15 17:46:41 -04:00
Scott Sanderson bc302beec9 MAINT: Rework event datasets.
- Refactored EventsLoader and BlazeEventsLoader to not require a
  subclass per dataset.  Instead, you now pass a map from columns to
  event fields directly to the EventsLoader constructor.

- Removed a large number of Quantopian-specific datasets and associated
  tests.

- Rewrote the core logic of EventsLoader and BlazeEventsLoader to share
  index calculations across multiple requested columns.

- Fixed a bug where event fields were incorrectly forward-filled when
  null values were present in an event.
2016-06-10 19:22:27 -04:00
Andrew Daniels 60cd4aab91 Use new API in tests/data/bundles/test_core.py 2016-06-08 16:24:36 -04:00
Jean Bredeche b5633aa87c DEV: Fix merge issues. 2016-06-08 14:16:17 -04:00
Andrew Daniels 02a91ec4ab MAINT: Removes the set_first_trading_day method of DataPortal
Since the first trading day is now passed directly to the DataPortal on
init, there's no need for a method that does this. Moves all the
additional logic/assignments into the init. Also corrects an issue where
we would never create certain attributes if self._first_trading_day was
None.

Adds the ability to specify the first trading day for a data portal in a
test case when using the WithDataPortal fixture.
2016-06-08 13:34:23 -04:00
Jean Bredeche b1428aaad1 DEV: Cleaned up trading_minute_window
Removed it from ExchangeCalendar.

Fixed TradingSchedule’s implementation to be much faster.  Removed the
`step` parameter.
2016-06-08 13:34:23 -04:00
jfkirk 39cc355066 TST: Finishes fixing fixes for the fixed fixtures 2016-06-08 13:34:23 -04:00
jfkirk d437a5d675 MAINT: Rebase fixes 2016-06-08 13:34:23 -04:00
jfkirk 2a8f69fc01 MAINT: DataPortal env -> asset_finder 2016-06-08 13:34:22 -04:00
jfkirk 0a6ad9ac9e STY: Your flake is on fleek 2016-06-08 13:34:22 -04:00
jfkirk 581e817603 MAINT: Rebase reconciliation 2016-06-08 13:34:22 -04:00
jfkirk 2a81c2066f ENH: Adds the option to force calendar registration 2016-06-08 13:34:21 -04:00
jfkirk da99cd6192 ENH: Adds BMF, LSE, and TSX exchange calendars 2016-06-08 13:34:21 -04:00
jfkirk 219f20989f BUG: Fixes after-hours behavior on session_date 2016-06-08 13:34:21 -04:00
jfkirk 10a118d94c MAINT: Removes references to tradingcalendar 2016-06-08 13:34:20 -04:00
jfkirk 75e0e4723d TST: Refactors more tests to use WithTradingSchedule 2016-06-08 13:34:20 -04:00
jfkirk d9fc514fa8 TST: Adds TradingSchedule test fixture 2016-06-08 13:34:20 -04:00
jfkirk 31f9f06c9a MAINT: Removes static calendar from schedule_function rules 2016-06-08 13:34:19 -04:00
jfkirk 705fb4e89f MAINT: Removes use of partials in schedule classes 2016-06-08 13:34:19 -04:00
jfkirk ddaf3d5b02 MAINT: Consolidates minute_window methods in schedule classes 2016-06-08 13:34:19 -04:00
jfkirk 26742dda67 MAINT: Removes obsolete tradingcalendar module 2016-06-08 13:34:19 -04:00
jfkirk 241abda2a5 STY: Flake8 2016-06-08 13:34:19 -04:00
jfkirk 4b7390ac81 WIP: Refactors tests to use TradingSchedule 2016-06-08 13:34:19 -04:00
jfkirk c8304e8601 ENH: Adds ExchangeCalendar, TradingSchedule, and implementations
Conflicts:
	tests/data/test_minute_bars.py
	tests/data/test_us_equity_pricing.py
	tests/finance/test_slippage.py
	tests/pipeline/test_engine.py
	tests/pipeline/test_us_equity_pricing_loader.py
	tests/serialization_cases.py
	tests/test_algorithm.py
	tests/test_assets.py
	tests/test_bar_data.py
	tests/test_benchmark.py
	tests/test_exception_handling.py
	tests/test_fetcher.py
	tests/test_finance.py
	tests/test_history.py
	tests/test_perf_tracking.py
	tests/test_security_list.py
	tests/utils/test_events.py
	zipline/algorithm.py
	zipline/data/data_portal.py
	zipline/data/us_equity_loader.py
	zipline/errors.py
	zipline/finance/trading.py
	zipline/testing/core.py
	zipline/utils/events.py
2016-06-08 13:34:18 -04:00
Eddie Hebert b450ab841f BUG: Apply latest adjustment for minute 1d
Fix behavior in minute mode history with frequency `1d`, where on the
day immediately following an adjustment action, the overnight adjustment
would not apply. (However the adjustment would be applied after a 1 day
lag.)

The root cause of the bug was that the history data for minute mode when
using `1d` stitches together a sliding window of the daily data for
previous  and the current minute. That daily data sliding window and
corresponding adjustments was being read as if the data was being viewed
from on the last day of the window; however in this case the data is
being viewed from the day after the window has completed. The difference
in view points requires the adjustments to popped and applied by the
adjusted array one index earlier. The fix uses the `extra_slot` value as
signifier on whether the data is being viewed on the following day and
then accordingly adjusts the index of the mulitpy object.

Also, change the split and merger test data ratios to have different values,
to ensure that different adjustment values are applied; as opposed to
doubling up on just one of the values.
2016-06-07 10:41:18 -04:00