Commit Graph

2738 Commits

Author SHA1 Message Date
Stewart Douglas 59f5a9683b DEP: Remove legacy writer classes 2015-09-10 11:53:24 -04:00
Stewart Douglas 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 Douglas 8fc97b99b2 MAINT: Default constraints=True in AssetDBWriter 2015-09-10 11:53:24 -04:00
Stewart Douglas 38f3e6c713 ENH: Add UNIQUE and NOT NULL constraints 2015-09-10 11:53:24 -04:00
llllllllll ee4aa7327b MAINT: more bugfixes 2015-09-10 11:53:23 -04:00
llllllllll 9cd3707440 BLD: Adds sqlalchemy to reqs 2015-09-10 11:53:23 -04:00
llllllllll 874abee1d8 BUG: itemgetter is in operator 2015-09-10 11:53:23 -04:00
Stewart Douglas fc8ea9b39b MAINT: Remove NOT NULL constraint when constraints=False 2015-09-10 11:53:23 -04:00
llllllllll dd956116b7 ENH: sqlalchemy 2015-09-10 11:53:23 -04:00
Stewart Douglas 17c6ecbfff STY: Formating changes 2015-09-10 11:53:23 -04:00
Stewart Douglas 06894c301e DEP: Stop exporting deprecated methods 2015-09-10 11:53:23 -04:00
Stewart Douglas 4b763f4138 ENH: Update load_data method 2015-09-10 11:53:23 -04:00
Stewart Douglas 97e980751f MAINT: Integrate asset writer changes into TradingEnvironment 2015-09-10 11:53:23 -04:00
Stewart Douglas abcb6704e8 TST: Modify tests given new AssetFinder behavior 2015-09-10 11:53:22 -04:00
Stewart Douglas f12c9aa0b7 ENH: Create AssetDBWriterFromDataFrame class 2015-09-10 11:53:22 -04:00
Stewart Douglas ad28d5ee0a ENH: Remove all writing functionality from AssetFinder 2015-09-10 11:53:22 -04:00
Stewart Douglas 696d8f2846 MAINT: Insert data into asset_router 2015-09-10 11:53:22 -04:00
Stewart Douglas 449400426d ENH: Enable fuzzy matching for equities 2015-09-10 11:53:22 -04:00
Stewart Douglas c8cb2d92dd MAINT: Use raw SQL driver rather than pandas to_sql method
Allows us to create an SQL transaction to avoid errors
from race conditions.
2015-09-10 11:53:22 -04:00
Stewart Douglas 746f70a133 ENH: Create AssetDBWriter class
The AssetDBWriter class and its subclasses will
ultimately be responsible for creating the SQLite
database tables and writing data to these tables.

In the longer term AssetDBWriter and AssetFinder will
be decoupled, sharing only an SQLite connection.
However, for backward compatibility reasons this has
not yet been fully implemented.

Modify tests since AssetFinder no longer has a
metadata_cache attribute.
2015-09-10 11:53:22 -04:00
Stewart Douglas 45adc57267 TST: Simulate running an algo using scripts/run_algo.py
Previously we have not had test coverage of the parse_args() or
run_pipeline() functions invoked when running scripts/run_algo.py.
2015-09-10 11:47:45 -04:00
Stewart Douglas 283c959cc4 MAINT: Move analyze methods into algorithm files 2015-09-10 11:36:14 -04:00
Stewart Douglas 723c5bb069 ENH: Add if name == main blocks to examples 2015-09-10 11:32:41 -04:00
Stewart Douglas 3f4bbc521a ENH: Add axis label to olmar output plot 2015-09-10 11:32:41 -04:00
Stewart Douglas dee69f39fe BUG: Allow dual_em_talib.py to be executed with run_algo.py 2015-09-08 11:55:06 -04:00
Stewart Douglas e507ee097d TST: Add coverage for set_symbol_lookup_date method 2015-09-08 11:01:04 -04:00
Stewart Douglas 1e31866471 MAINT: FutureChain should only accept Timestamp 2015-09-08 11:01:04 -04:00
Stewart Douglas ad31e1ff6e MAINT: Coerce user input to Timestamps, catching errors 2015-09-08 11:01:04 -04:00
Stewart Douglas c2159d429b ENH: Allow user to set the symbol lookup date
Previously symbols were resolved to sids based on the end of
simulation date. This commit allows the user to specify the
date for which resolution will take place using a new
set_symbol_lookup_date() API method.

If the user does not use this method the lookup date will
default back to the simulation end date.
2015-09-08 11:01:04 -04:00
Richard Frank dcc0a31782 PERF: Re-use the faster get_open_and_closes from tradingcalendar 2015-09-08 09:21:42 -04:00
Jonathan Kamens 510dc2ae7b TST: test_finance.py can't handle being parallelized 2015-09-08 08:49:11 -04:00
jfkirk cf41373f8f BUG: Symbol look-up now uses the sim_params.period_end as a look-up date 2015-09-01 12:39:03 -04:00
Warren O'Neill de09433fd4 MAINT: allows contract_multiplier to be non-integer 2015-09-01 11:54:09 -04:00
Scott Sanderson 6e8a4b8144 ENH: Improvements to rank().
- Add an `ascending=True` keyword to `rank()`.

- Add `top(N)` and `bottom(N)` methods to Factor.  These return Filters
  that pass the top and bottom N elements each day.

- Add a slightly faster path for rank(method='ordinal').  I had
  originally thought the fast path was 2-3x faster because I had my
  benchmark data axes flipped.  The actual speedup is only 5-10%, which
  means it probably wasn't worth the effort to Cythonize...but we have a
  slightly faster version now so we might as well use it.

- Refactor test_filter and test_factor to make it easier to implement
  and test transformations on factors.  These tests now subclass
  BaseFFCTestCase, which provides facilities for passing a dict of terms
  and an "initial_workspace", the values for which are used by
  SimpleFFCEngine rather than needing to manually manage the inputs and
  outputs of each term.
2015-08-31 00:32:33 -04:00
Scott Sanderson a04dcfa6b8 TEST: Rename test. 2015-08-29 23:55:59 -04:00
Scott Sanderson 90e81d0df0 MAINT: Add TermGraph class.
Use a subclass of networkx.DiGraph to encapsulate the state of our
dependency graph.
2015-08-29 23:55:59 -04:00
Scott Sanderson 7eae44fff7 STY: _add_to_graph fits on one line. 2015-08-29 23:55:59 -04:00
Scott Sanderson 6c2d7ff395 STY: Use same names in subclass. 2015-08-29 23:55:59 -04:00
Scott Sanderson dd1f9221f9 Merge pull request #691 from quantopian/500-errors
Add SidNotFound exception case
2015-08-28 18:51:24 -04:00
dmichalowicz 14ab02bfaa Remove comment 2015-08-28 15:16:04 -04:00
dmichalowicz b7cf84e4ec Add SidNotFound exception case 2015-08-28 13:27:22 -04:00
Scott Sanderson 83f160dca0 Merge pull request #689 from quantopian/assets-from-ffc-matrix
ENH: Return asset-indexed DataFrame for data.factors.
2015-08-26 19:04:46 -04:00
Scott Sanderson 780263da06 ENH: Return asset-indexed DataFrame for data.factors.
This makes ordering with the returned assets much easier, and there's no
performance degradation for non-broadcasting operations on the Index.

Timings
-------

    from random import sample
    finder = AssetFinder(create_table=False, assets.db')
    assets = load_8000_assets(finder)
    AAPL = finder.retrieve_asset(24)
    RANDOM_ASSETS = sample(assets, 500)
    df = DataFrame(
        index=assets,
        data=np.random.randn(len(assets), 4),
        columns=['a', 'b', 'c', 'd'],
    )
    df_int = DataFrame(
        index=map(int, assets),
        data=np.random.randn(len(assets), 4),
        columns=['a', 'b', 'c', 'd'],
    )

    %timeit df.loc[24]
    %timeit df_int.loc[24]

    10000 loops, best of 3: 45.3 µs per loop
    10000 loops, best of 3: 44.7 µs per loop

    %timeit df.loc[AAPL]
    %timeit df_int.loc[AAPL]

    10000 loops, best of 3: 45.1 µs per loop
    10000 loops, best of 3: 44.8 µs per loop

    %timeit df.loc[RANDOM_ASSETS]
    %timeit df_int.loc[RANDOM_ASSETS]

    1000 loops, best of 3: 1.53 ms per loop
    100 loops, best of 3: 2.18 ms per loop

    %timeit df.sum()
    %timeit df_int.sum()

    10000 loops, best of 3: 56 µs per loop
    10000 loops, best of 3: 55.7 µs per loop

    %timeit df.index == 3
    %timeit df_int.index == 3

    1000 loops, best of 3: 253 µs per loop
    100000 loops, best of 3: 6.76 µs per loop

    %timeit df.iloc[:50]
    %timeit df_int.iloc[:50]

    10000 loops, best of 3: 44.3 µs per loop
    10000 loops, best of 3: 44 µs per loop
2015-08-26 18:33:54 -04:00
Scott Sanderson c6aa36e5c1 Merge pull request #684 from quantopian/apparently-windows-doesnt-have-nan
BUG: Use NAN from numpy.
2015-08-25 13:10:50 -04:00
Jonathan Kamens 2521263c06 TST: Prevent some test cases from being split 2015-08-25 11:56:36 -04:00
Scott Sanderson 39321c2868 Merge pull request #685 from quantopian/data-in-before-trading-start
ENH: Make data available in before_trading_start.
2015-08-25 10:49:59 -04:00
Scott Sanderson f7039d6f52 ENH: Make data available in before_trading_start. 2015-08-21 12:37:17 -04:00
Scott Sanderson 41d4133c74 BUG: Use NAN from numpy.
MSVC doesn't define NAN in math.h because they only implement C89.

See http://tdistler.com/2011/03/24/how-to-define-nan-not-a-number-on-windows.
2015-08-21 11:33:20 -04:00
Thomas Wiecki 8dc0276d99 Merge pull request #682 from quantopian/fix_ipython_call
BUG Regression caused by adding print_algo to args parser.
2015-08-20 11:16:31 +02:00
Thomas Wiecki 0c44ebe2ad BUG Regression caused by adding print_algo to args parser. Remove default print_algo kwarg when called from IPython interface. 2015-08-20 10:58:16 +02:00