Commit Graph
2946 Commits
Author SHA1 Message Date
Jean Bredeche 8048cdcfb0 PERF: Be smarter about counting the number of minutes across a contiguous bunch of sessions. 2016-09-19 13:25:03 -04:00
Andrew DanielsandGitHub 4a2faa3e13 ENH: Adds truncate method to BcolzMinuteBarWriter (#1499) 2016-09-19 13:02:48 -04:00
Eddie Hebert 6486e64530 Revert "Merge pull request #1490 from quantopian/use-load-adjustments-for-history"
This reverts commit 86c7635b45, reversing
changes made to c77f2b92df.

Some real world cases hit errors with this change, due to the new offset
logic attempting to create Adjustments with invalid parameters.

Will identify exact conditions that cause this error and add as a test
case before remerging.
2016-09-19 08:53:31 -04:00
Jean Bredeche 31cbdde7f0 PERF: Save up to 75% of the calls to minute_to_session_label
One year NYSE test that buys a lot triggers 492,963 calls to
minute_to_session_label.  Only 98924 ~(390 * 252) make it past the
cache and trigger the heavier computation.
2016-09-16 15:18:50 -04:00
Jean Bredeche a7f345e651 ENH: Switching from cachetools.LRUCache to lru-dict's LRU cache.
lru-dict is written in C and seems much more performant.
2016-09-16 11:03:13 -04:00
Eddie HebertandGitHub f2a1263d90 Merge pull request #1490 from quantopian/use-load-adjustments-for-history
MAiNT: Use load_adjustments for history.
2016-09-15 16:01:23 -04:00
Jean BredecheandGitHub ed08f25224 Merge pull request #1488 from quantopian/who-said-you-could-forward-fill-stop-that
ENH: Make reader.get_value raise NoDataOnDate if the date is not in the calendar.
2016-09-15 15:41:36 -04:00
Eddie Hebert 1d06a779b3 MAiNT: Use load_adjustments for history.
Instead of `HistoryLoader` containing separate adjustment calculation
logic, use `SQLiteAdjustmentReader.load_adjustments`.

This change required the addition of two offset parameters to
`load_adjustments` since the perspective on the data from within
`schedule_function` is skewed from how Pipeline looks at historical
data.

This is working towards creating an `AdjustmentReader` abc which
`SQLiteAdjustmentReader` and a upcoming continuous future adjustment
reader will share.
2016-09-15 15:32:10 -04:00
Jean Bredeche 0fd35e7fd1 ENH: Make reader.get_value raise NoDataOnDate if the date is not in the calendar.
DataPortal now catches the NoDataOnDate exception and returns nan for
OHLC and 0 for V.

Price is still forward filled, unchanged.
2016-09-14 22:21:43 -04:00
Scott SandersonandGitHub 7ac024fb5c Merge pull request #1484 from quantopian/refcount-pipelines
PERF: Release unneeded pipeline terms.
2016-09-14 20:24:10 -04:00
Scott Sanderson 7c58bf1e5b STY: Flake8 and parameter rename. 2016-09-14 14:45:00 -04:00
Jean Bredeche 2856fd0ecf MAINT: Add BarReader base class for both minute and session readers 2016-09-14 13:47:12 -04:00
Scott Sanderson a0e1b881aa MAINT: Move refcount management into TermGraph. 2016-09-14 11:16:40 -04:00
Scott Sanderson 6aa885dbeb PERF: Release unneeded pipeline terms.
Refcount pipeline terms during execution and release terms once they're
no longer needed.

This dramatically reduces memory usage on large pipelines.
2016-09-13 23:28:25 -04:00
John RicklefsandGitHub 1f859d34e5 MAINT: Add additional fields to __getitem__ for Order (#1483)
These were previously available like the others.
2016-09-13 15:49:16 -04:00
John RicklefsandGitHub e6a647edf1 Revert "added DGZ to delete list" (#1481)
This reverts commit a5ecaf4c3a.

This causes downstream problems; unsure why, Jamie advised
reverting.
2016-09-13 14:45:12 -04:00
Richard Frank 6afdb318ee BUG: run_algorithm with no data source should default
to 'quantopian-quandl' bundle
2016-09-12 12:17:17 -04:00
Richard FrankandGitHub 7a10d9392d Merge pull request #1467 from quantopian/check_param-string_types
Check param string types
2016-09-08 14:59:38 -04:00
Kathryn GlowinskiandGitHub 9ad670bd46 More Fuzzy Symbol Fixes (#1475)
* REF: More options before raise MultiFound.

* TST: Checks corner case for fuzzy matching.
2016-09-08 14:52:57 -04:00
Scott SandersonandGitHub c66d3ad820 Merge pull request #1471 from quantopian/fix-slow-startup
PERF: Remove import-time calendar creations.
2016-09-08 10:21:00 -04:00
Scott Sanderson ff1bc51bd1 STY: Fix flake8. 2016-09-07 21:58:15 -04:00
Scott Sanderson 85ce093270 MAINT: Updates from Joe's PR feedback. 2016-09-07 20:42:19 -04:00
James McCorristonandGitHub bb22af747d Merge pull request #1434 from quantopian/update-leveraged-etfs
MAINT: Update leveraged ETF list
2016-09-07 13:48:12 -04:00
Jamie McCorriston e6ef82fc4c added DGZ to delete list 2016-09-07 13:12:34 -04:00
Eddie HebertandGitHub 6c7af70155 Merge pull request #1473 from quantopian/release-1.0.2
REL: Prepare for 1.0.2 release.
2016-09-06 21:33:49 -04:00
Eddie Hebert b1e50b3434 REL: Prepare for 1.0.2 release.
Update release notes.

Generate api stubs.
2016-09-06 16:59:34 -04:00
Joe Jevnik 863e2ffbea ENH: improve warning for protocol getitem 2016-09-06 15:11:43 -04:00
Scott Sanderson bd420f938b MAINT/TEST: Update default calendar smoketest. 2016-09-06 14:13:32 -04:00
Joe JevnikandGitHub 1e030c77b2 Merge pull request #1449 from quantopian/getitem-is-not-getattr
MAINT: remove __getitem__ as alias of __getattr__
2016-09-06 13:48:17 -04:00
Joe Jevnik b66d9ae976 DEV: update copyright in protocol.py (added code) 2016-09-06 12:42:06 -04:00
Joe Jevnik 631984e1f5 ENH: just deprecate __getitem__, don't remove 2016-09-06 12:39:29 -04:00
kglowinski e7e4db0701 BUG: Fixing 2/3 compat. 2016-09-06 10:12:01 -04:00
kglowinski 15ab8ac95e BUG: Handle case with mult symbol options for same sid. 2016-09-06 10:12:01 -04:00
kglowinski 8056dd8a90 BUG: Fixing SymbolNotFound to be raised. 2016-09-06 10:12:00 -04:00
Scott Sanderson a8a2cc1582 PERF: Remove module-scope calendar creations.
Remove module scope invocations of `get_calendar('NYSE')`, which cuts
zipline import time in half on my machine. This make the zipline CLI
noticeably more responsive, and it reduces memory consumed at import
time from 130MB to 90MB.

Before:

$ time python -c 'import zipline'

real    0m1.262s
user    0m1.128s
sys     0m0.120s

After:

$ time python -c 'import zipline'

real    0m0.676s
user    0m0.536s
sys     0m0.132s
2016-09-06 09:57:23 -04:00
John RicklefsandGitHub 43b9fa84d7 Revert "BUG: Capital change deltas rely on cash, not portfolio_value" (#1470)
This reverts commit 5b1aa5ec55.

The paradigm is: we're calculating a new capital base for the
performance period. We are therefore using the total
portfolio_value, not just the cash, to calculate the
difference from the specified target as the algorithm
has meaningful holdings.
2016-09-05 14:12:04 -04:00
Richard Frank 7f6db68fc6 BUG: Fix up check_parameters usage of string_types
and corresponding tests
2016-09-02 16:47:32 -04:00
phil.zhangandRichard Frank eb6b6d046d BUG: Change str to string_types to avoid errors
When in python2.7, and unicode_literals is imported
type check will raise error because 'type' is not str but unicode
2016-09-02 16:47:13 -04:00
Scott SandersonandGitHub 548e0675be Merge pull request #1466 from quantopian/disallow-length-1-regressions
ENH: Dont allow length=1 regressions/correlations.
2016-09-02 15:49:03 -04:00
Scott Sanderson b0a93d57a0 DOC: Clarify expect_bounded docstring. 2016-09-02 13:33:55 -04:00
Scott Sanderson 8b2446aec6 ENH: Dont allow length=1 regressions/correlations.
They're not meaningful, and they cause warnings from numpy.

Implemented in terms of a new preprocessor, `expect_bounded`, which
takes a tuple of `upper_bound` and `lower_bound`.
2016-09-02 12:49:09 -04:00
Eddie Hebert 1269250dde MAINT: Remove unused data portal methods.
The apply adjustments behavior had been moved to the `HistoryLoader`
class.
2016-09-02 12:12:22 -04:00
Ana Ruelas ec7e4f2333 BUG: Do not adjust returns for sharpe and sortino 2016-09-02 10:41:50 -04:00
Eddie HebertandGitHub c5c7a4ac4a Merge pull request #1460 from quantopian/daily-aggregator-corner-cases
TST/BUG: Full coverage on resample module.
2016-09-01 17:24:56 -04:00
Eddie Hebert baff6a84bc TST/BUG: Full coverage on resample module.
test_resample now fully covers the resample module.

Fix a bug exposed by increased coverage, where daily aggregation on
`high` would return `nan` for an asset instead of 1) during the
course of day `1d` history was called on non-consecutive minutes and 2)
either, a) the value for the previously inspected dt was `nan` or b)
there were only `nan`s between the previous and current dt.

`low` had a similar bug which was only triggered if the value for the
previously inspected dt was `nan`.
2016-09-01 16:41:45 -04:00
John Ricklefs 0d40b84550 ENH: Allow passing additional adjustments to calculate_capital_changes
If subclasses have additional capital change information that
is required to correctly calculate the target values for
cash capital changes, it can now be provided via
"portfolio_value_adjustment".
2016-09-01 16:04:46 -04:00
John Ricklefs 3ab907ee4f BUG: Capital change deltas rely on cash, not portfolio_value
The value of holdings is irrelevant when altering the
capital base of the current perf period.
2016-09-01 15:19:55 -04:00
Eddie Hebert 59d06a1883 TST/BUG: Cover all reindex session public methods.
Increase coverage on `ReindexSessionBarReader` so that all methods which
are considered part of the interface are covered by `test_resample`.

Fix bug in `get_value`, exposed by increased coverage, where the
`NoDataOnDate` exception was bubbling from the bcolz reader all the way
up when a session which was a holidy on the underlying reader was passed
to the reindex reader. (The reindex reader should return nan/0 in that
case.)

Also, move location of data index exceptions so that they are agnostic
to bcolz/us_equity_pricing; since the exception is now used by the
resample module to fix aforementioned bug.
2016-09-01 11:51:00 -04:00
Jean Bredeche 46c0c064fe ENH: Update can_trade to check exchange time
BarData now takes the trading calendar as a parameter.

can_trade now checks if the asset’s exchange is open at the current or
next market minute (defined by the given trading calendar).
2016-08-31 21:22:06 -04:00
Eddie HebertandGitHub af75a1f67c Merge pull request #1457 from quantopian/allow-last-date-for-session-get-last-traded-dt
TST: Fix get_last_traded_dt on bcolz daily reader.
2016-08-31 15:53:36 -04:00