Commit Graph
105 Commits
Author SHA1 Message Date
Stewart Douglas e33fa988f2 DEP: Remove _convert_asset_str_fields
_convert_asset_str_fields was added to address the fact that the
unicode returned by SQLAlchemy was causing test failures, in
particular test_repr and test_root_symbols failed because of the
leading 'u' character in the unicode of python-2.x. Later it was
pointed out that this method would behave differently in python 2
and 3, in particular the str() method would return bytes in python
2 and unicode in python 3. After investigating it was found that
the _convert_asset_str_fields was no longer  necessary. It is unclear
why the original tests were failing. It is not due to SQLAlchemy
versions, as tests pass for version >1 and <1.
2015-10-01 15:02:23 -04:00
Warren O'Neill 66b36919a3 BUG: missing comma in _asset_timestamp_fields 2015-10-01 10:57:54 +02:00
John Ricklefs b0de423b38 MAINT: Add indexes to company_symbol/fuzzy_symbol.
Reduces AssetFinder.lookup_symbol call times
dramatically:

With fuzzy=True: 2.32ms per call -> 391 micros
With fuzzy=False: 2.35ms  -> 451 microseconds
2015-09-24 21:14:48 -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 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
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
jfkirk 262f0b7d09 MAINT: Removes mutable default method args
Also removes accidental modifications to Jenkins
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 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 a2cacfb613 MAINT: Pulls out methods that should be free 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 Douglasandjfkirk a517929cbb DOC: Improve documentation in asset_writer.py 2015-09-10 11:53:27 -04:00
Stewart Douglasandjfkirk 22827d1c89 MAINT: Convert map to list in lookup_future_chain 2015-09-10 11:53:27 -04:00
Stewart Douglasandjfkirk ee9c79a6f8 MAINT: Reduce end_date int for SQLite Python3.3 compatibility 2015-09-10 11:53:27 -04:00
Stewart Douglasandjfkirk d3516959a3 MAINT: Don't set string to upper before writing, remove unused libs 2015-09-10 11:53:27 -04:00
Stewart Douglasandjfkirk 3224085a1d ENH: Check whether identifier columns provided in DataFrame 2015-09-10 11:53:27 -04:00
Stewart Douglasandjfkirk 92f99e62f0 MAINT: AssetFinder should not write to db 2015-09-10 11:53:26 -04:00
Stewart Douglasandjfkirk 9d313ab877 BUG: Various bug fixes to assets.py
Bug fixes include:
	- Do not call float on tuples
	- Correct indentation
	- Do not call value() on int
	- Use fuzzy correctly
	- Use symbol for lookup
	- Ensure we raise Error
2015-09-10 11:53:26 -04:00
Stewart Douglasandjfkirk 16488d9053 ENH: Base new sid creation on existing sids in database 2015-09-10 11:53:26 -04:00
Stewart Douglasandjfkirk 1d958bd7eb ENH: Allow AssetDBWriterFromList to consume Assets 2015-09-10 11:53:26 -04:00
Stewart Douglasandjfkirk aa110dd149 ENH: Add init_db to transaction so table exists=>it has also been written to 2015-09-10 11:53:26 -04:00
Stewart Douglasandjfkirk 667f0695d5 BUG: Avoid NOT NULL violation by checking for data first 2015-09-10 11:53:26 -04:00
Stewart Douglasandjfkirk e5875af784 DOC: Documentation improvements 2015-09-10 11:53:26 -04:00
Stewart Douglasandjfkirk e529df06ea ENH: Add autoload=True for compatibility with SQLAlchemy < 1.0.0 2015-09-10 11:53:25 -04:00
Stewart Douglasandjfkirk ded6f8543f BUG: Cast datetime to Timestamp to call value 2015-09-10 11:53:25 -04:00
Stewart Douglasandjfkirk c8b88432cc BUG: Account for sid == 0 in if statement 2015-09-10 11:53:25 -04:00
Stewart Douglasandjfkirk 4300ab357a BUG: Convert sqlalchemy RowProxy to dict for assignment 2015-09-10 11:53:25 -04:00
Stewart Douglasandjfkirk 46346ecb5d BUG: Ensure symbols are made upper case in db 2015-09-10 11:53:25 -04:00
Stewart Douglasandjfkirk 678aec2cae MAINT: Convert dates to INTs for SQLite and set default end_date 2015-09-10 11:53:25 -04:00
Stewart Douglasandjfkirk 32b663c5ca MAINT: Enforce uniqueness of sid column 2015-09-10 11:53:25 -04:00
Stewart Douglasandjfkirk 9660447ed0 MAINT: Ensure correct pandas.DataFrame is returned 2015-09-10 11:53:24 -04:00
Stewart Douglasandjfkirk d55920a43b ENH: Return namedtuple from load methods 2015-09-10 11:53:24 -04:00
Stewart Douglasandjfkirk b658f579d2 ENH: Consolidate logic into load_data method 2015-09-10 11:53:24 -04:00
Stewart Douglasandjfkirk 59f5a9683b DEP: Remove legacy writer classes 2015-09-10 11:53:24 -04:00
Stewart Douglasandjfkirk 47ed3a2fdb ENH: Update AssetDBWriterFromList to consume identifiers
Allow consumption of a list of identifiers, including assigning
sids if necessary.
2015-09-10 11:53:24 -04:00
Stewart Douglasandjfkirk 8fc97b99b2 MAINT: Default constraints=True in AssetDBWriter 2015-09-10 11:53:24 -04:00
Stewart Douglasandjfkirk 38f3e6c713 ENH: Add UNIQUE and NOT NULL constraints 2015-09-10 11:53:24 -04:00