Commit Graph

2813 Commits

Author SHA1 Message Date
Scott Sanderson 8eb09f70d7 BUG: Don't crash when raising UnsupportedDataType.
Before this was raising a KeyError on failure to format the message
properly.
2015-09-21 13:20:26 -04:00
Scott Sanderson 85cacdf356 DOC: Typo fix. 2015-09-21 13:20:26 -04:00
John Ricklefs fd1bee9bf6 ENH: Don't trigger AssetDateBounds for orders of 0 shares. 2015-09-18 15:19:22 -04:00
John Ricklefs 38ff4cc913 BUG: Normalize dates in AssetDateBounds control checks
Assumes that if a given asset's end_date is
e.g. 9/17/2015 00:00:00 UTC that it means the
asset is still tradeable on 9/17/2015 during
the market day.
2015-09-18 15:19:15 -04:00
jfkirk 88495ce9b7 MAINT: Batch transform uses get_algo_instance 2015-09-18 14:17:53 -04:00
jfkirk 4db5e6c142 ENH: AssetDBWriter now overwrites symbol with file_name, if provided 2015-09-16 16:34:34 -04:00
jfkirk 082bc4f906 MAINT: Removes default_none from lookup_symbol 2015-09-16 14:55:42 -04:00
jfkirk c446e7f62a ENH: Adds fuzzy symbol look-up and makes it distinct from delimited symbols 2015-09-16 14:34:18 -04:00
jfkirk d84bdefef8 MAINT: Removes lookup_symbol_resolve_multiple method
lookup_symbol_resolve_multiple was identical to lookup_symbol, except that lookup_symbol performed upper-casing of the input string and lookup_symbol would return Nones. Now, lookup_symbol has a kwarg 'default_None=True' and all symbols are upper-cased on insertion and request.
2015-09-16 09:54:37 -04:00
jfkirk 29dce965d5 ENH: Simplifies AssetFinder symbol lookup by making fuzzy lookup the default 2015-09-16 09:54:11 -04:00
Scott Sanderson 26fd6fda8b ENH/BUG: Modeling API enhancements.
- Fixes an error where Modeling API data known as of the close of `day
  N` would be shown to algorithms during `before_trading_start` as of
  the close of the same day.  Algorithms should now only receive data
  during `before_trading_start/handle_data` that was known as of the
  simulation time at which the function would be called.

- All Term instances now have a `mask` attribute that must be a `Filter`
  or an instance of `AssetExists()`.  `mask` can be used to specify that
  a Factor should be computed in a manner that ignores the values that
  were not `True` in the mask.

- Changed the interface for `FFCLoader.load_adjusted_array` and
  `Term._compute` from `(columns, mask)`, with mask as a DataFrame, to
  `(columns, dates, assets, mask)`, where mask is a numpy array.  This
  is primarily to avoid having to reconstruct extra DataFrames when
  using masks produced by non `AssetExists` filters.

- Adds `BoundColumn.latest`, which gives the most-recently-known value
  of a column.
2015-09-16 01:47:11 -04:00
Scott Sanderson 691f6d95d7 STY: Use relative imports in engine.py. 2015-09-16 01:28:16 -04:00
Scott Sanderson 46882bfcb9 TST: Remove unnecessary instance attr assignments. 2015-09-16 01:28:16 -04:00
Scott Sanderson e32f50ba3a DOC: Better docstring. 2015-09-16 01:28:16 -04:00
Scott Sanderson b70f517077 DOC: Fix docstring types. 2015-09-16 01:28:16 -04:00
Scott Sanderson 4561c776a0 DOC: Fix typo in docstring. 2015-09-16 01:28:15 -04:00
Scott Sanderson 5730de25a4 DEV: Kill compute_from_{arrays,windows}.
All terms just implement `_compute` now. (We reserve `compute` for the
public API of `CustomFactor`.)

Also removed `TestingTermMixin` and its subclasses in favor of just
using `CustomFactor.`
2015-09-16 01:28:15 -04:00
Scott Sanderson 58ceb7b7bb DEV: Add zipline.utils.memoize.
- Moved zipline.utils.lazyval.
- Added `remember_last` which is just `lru_cache(1)` with simpler logic.
2015-09-16 01:28:15 -04:00
Scott Sanderson dad3bbd879 ENH: Add tools for visualizing FFC graphs. 2015-09-15 23:58:09 -04:00
Scott Sanderson ad54eedeea Revert "MAINT: AssetFinder now takes fuzzy characters on look-up, not init"
This reverts commit c16bc9f8db.  This
caused upstream breakage unexpectedly.  Postponing until we can synchronize.
2015-09-15 23:57:25 -04:00
jfkirk c16bc9f8db MAINT: AssetFinder now takes fuzzy characters on look-up, not init 2015-09-15 09:38:17 -04:00
Thomas Wiecki 6f2e1672d7 BUG: Forward initialize args and kwargs to user-defined function.
The initialize method of TradingAlgorithm no longer accepts and
silently ignores args and kwargs, but instead forwards them
to the user-defined function referenced by self._initialize.

To avoid passing unexpected arguments to self._initialize, the
following additional adjustments are made:

 - pop 'namespace' from the kwargs supplied to TradingAlgorithm
   rather than simply get()ing it

 - do not pass an AssetFinder to the TradingAlgorithm in
   test_modelling_algo.py, as this has been deprecated and will
   cause self._initialize to fail
2015-09-14 10:42:20 -04:00
jfkirk a6e677a1d7 MAINT: Removes unused __init__ from AssetDBWriter 2015-09-14 10:01:36 -04:00
jfkirk b0195c0d17 MAINT: Abstracts-away Timestamp conversion of Asset fields 2015-09-11 15:58:46 -04:00
jfkirk a6ce1e5e8d ENH: Adds auto_close_date field to Future objects 2015-09-11 14:08:03 -04:00
Stewart Douglas 29321af1b4 DEP: Remove quantopian_buy_applye.py as logic covered in buyapple.py 2015-09-10 17:17:46 -04:00
jfkirk 4770c5956c TST: Fixes modelling test tearDown 2015-09-10 11:53:29 -04:00
jfkirk 6e6ef447d2 TST: Adds tearDownClass methods to delete TradingEnvironments 2015-09-10 11:53:29 -04:00
jfkirk 65a4c4523e STY: Renames serialization_utils dump and load methods 2015-09-10 11:53:29 -04:00
jfkirk 262f0b7d09 MAINT: Removes mutable default method args
Also removes accidental modifications to Jenkins
2015-09-10 11:53:29 -04:00
jfkirk 608dff245b TST: Updates test for set_symbol_lookup_date 2015-09-10 11:53:29 -04:00
jfkirk 265bffbe01 TST: Updates modelling test base for new TradingEnvironment 2015-09-10 11:53:29 -04:00
jfkirk 3c1eea4ca1 MAINT: Removes references to trading.environment 2015-09-10 11:53:29 -04:00
jfkirk fd907dbabc ENH: Adds mapping of company_name and ensures str types in AssetFinder 2015-09-10 11:53:29 -04:00
jfkirk 5320fd0fc5 BUG: Adds missing parens to AssetFinder sids property 2015-09-10 11:53:28 -04:00
jfkirk 6c6ecd0a86 ENH: Adds asset_db_path arg to TradingEnvironment init 2015-09-10 11:53:28 -04:00
jfkirk fa5f24fb2a BUG: Removes default table values causing issues 2015-09-10 11:53:28 -04:00
jfkirk 93c8808e4a ENH: Adds root_symbol_id column for use in creating Future sids 2015-09-10 11:53:28 -04:00
jfkirk 2a28d09380 MAINT: Removes exchange_id and root_symbol_id columns from AssetDB 2015-09-10 11:53:28 -04:00
jfkirk 35ed8c28a8 TST: Fixes modelling test to use new TradingEnvironment framework 2015-09-10 11:53:28 -04:00
jfkirk a2cacfb613 MAINT: Pulls out methods that should be free 2015-09-10 11:53:28 -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
jfkirk 661314ce49 ENH: AssetWriter now writes one Asset per insert statement 2015-09-10 11:53:27 -04:00
Stewart Douglas a517929cbb DOC: Improve documentation in asset_writer.py 2015-09-10 11:53:27 -04:00
Stewart Douglas 22827d1c89 MAINT: Convert map to list in lookup_future_chain 2015-09-10 11:53:27 -04:00
Stewart Douglas ee9c79a6f8 MAINT: Reduce end_date int for SQLite Python3.3 compatibility 2015-09-10 11:53:27 -04:00
Stewart Douglas 593e114f0a BLD: Include sqlalchemy and toolz in .travis.yml 2015-09-10 11:53:27 -04:00
Stewart Douglas d3516959a3 MAINT: Don't set string to upper before writing, remove unused libs 2015-09-10 11:53:27 -04:00
Stewart Douglas 3224085a1d ENH: Check whether identifier columns provided in DataFrame 2015-09-10 11:53:27 -04:00