Commit Graph

35 Commits

Author SHA1 Message Date
Eddie Hebert 16fd6681a6 ENH: Rewrite of Zipline to use lazy access pattern
More documentation to follow in release notes.

Based on lazy-mainline branch, see for more details.

Also-By: Jean Bredeche <jean@quantopian.com>
Also-By: Andrew Liang <aliang@quantopian.com>
Also-By: Abhijeet Kalyan <akalyan@quantopian.com>
2016-04-04 16:12:58 -04:00
Scott Sanderson 1245552340 DEV: Add expect_dimensions preprocessor. 2016-03-25 15:11:18 -04:00
Richard Frank d873038a7e BUG: Specify int64 instead of system int
to handle 32bit python
2016-03-23 15:26:52 -04: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
Scott Sanderson e810f26097 ENH: Add utilities for checking types generically. 2016-03-07 16:18:33 -05:00
Joe Jevnik e33cc25265 TST: fix redundant partial 2016-02-11 18:46:42 -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
llllllllll f8ab8a5159 TST: py3 compat qualname in preprocess tests 2015-12-09 12:49:59 -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
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 aef38c4a74 MAINT: Remove unused import. 2015-11-17 11:22:08 -05:00
Scott Sanderson 0f349fc3ed MAINT: Fix type coercion warnings with numpy 1.10.
Numpy warns about adding Python integers to uint32s and converting date
objects to datetime64.
2015-11-15 22:42:36 -05:00
llllllllll 0f5cf78492 MAINT: use subtest to quiet the output from test_events 2015-11-11 19:23:20 -05:00
llllllllll 1e05a1c4ae TST: fix py2 compat for test 2015-10-19 16:35:03 -04:00
llllllllll 22ffe3fe49 ENH: adds expect_element preprocessor 2015-10-19 16:35:03 -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 4f2d3d783a TEST: Template in module name.
Fixes failures when tests are invoked from different paths.
2015-10-01 18:03:54 -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
Scott Sanderson 00c413e9d4 ENH: Add zipline.utils.preprocess.
Implements tools for preprocessing the arguments to user-facing
functions.
2015-10-01 18:03:53 -04:00
jfkirk 6e6ef447d2 TST: Adds tearDownClass methods to delete TradingEnvironments 2015-09-10 11:53:29 -04:00
jfkirk f1f3f9b751 TST: Fixes broken event test 2015-09-10 11:53:28 -04:00
jfkirk dc964a7e7d MAINT: Removes the ability to reference a global TradingEnvironment
This commit removes the ability to reference a shared TradingEnvironment through the zipline.finance.trading module. In place, the classes that require a TradingEnvironment, or its child AssetFinder, contain their own references to those objects.

This commit also adds serialization utilities that allow for the pickling/unpickling of objects without unintentionally their TradingEnvironments or AssetFinders.
2015-09-10 11:53:28 -04:00
Jonathan Kamens e942275108 STY: Flake8
Upgrade the version of the flake8, pep8, and mccabe PyPI packages, and
make the code changes necessary for compatibility with the updated
packages.
2015-03-19 17:21:25 -04:00
Joe Jevnik f7b4d3100d ENH: Makes the offset of market_close relative to 20:00 UTC
Changed from relative to 20:01 UTC.
2014-11-19 11:38:26 -05:00
Joe Jevnik ca59abcc43 ENH: Makes schedule_function work in daily mode. 2014-11-06 10:49:49 -05:00
Joe Jevnik 93429d69f5 BUG: HistoryContainer creation at runtime did not work as intended. 2014-11-05 18:31:11 -05:00
llllllllll 9ddb033e67 ENH: Changes the default offset for time_rules.market_open to 1, and
makes it an offset from 13:30 UTC.

This is to be more consistent with the market_close, which is an offset
from 20:00 UTC.

This also makes market_open and market_close cache the dt to offset from
for each day.
2014-11-05 14:59:48 -05:00
Joe Jevnik c6e85d08f0 ENH: Does value checking for time offsets for market_open and market_close 2014-10-20 17:17:34 -04:00
Joe Jevnik 69124cb6ab BUG: Fixed a bug with offsets in week_start and week_end 2014-10-20 17:17:34 -04:00
Joe Jevnik d360b9d9bd ENH: Provides a more descriptive error if market_open or market_close are provided a non-keyword argument that is not a datetime.timedelta 2014-10-20 17:17:34 -04:00
Joe Jevnik df234f516c BUG: Fixes various bugs with the event manager:
- NotHalfDay only worked at midnight
- week_(start|end) were actually month_(start|end)
- Removes check_args from api.
- Default offset of 30mins for market_(open|close)
2014-10-09 14:01:56 -04:00
Joe Jevnik 3c37704a5b ENH: Adds a new api method schedule_function.
schedule_function takes a date rule, a time rule, and a function and
will call the function, passing context and data only when the two rules
fire. This allows for code that is conditional to the datetime of the
algo.

This is implemented internally with `Event` objects which are pairings
of `EventRule`s and callbacks.

handle_data becomes a special event with a rule that always fires. This
makes the logic for handling events more complete and compact.
2014-10-06 13:42:36 -04:00
Joe Jevnik 4db4256cfe MAINT: Adds a tests/utils/ directory and renames test_utils.py
to utils/test_factory.py
2014-09-29 12:57:39 -04:00