Commit Graph

563 Commits

Author SHA1 Message Date
Richard Frank 1cb85b70f2 DOC: Updated return types in docstrings 2016-12-20 19:27:28 -05:00
Scott Sanderson 9f28b7cede MAINT: Hit more dataframe indexers. 2016-11-22 17:11:04 -05:00
Scott Sanderson 16e78bbccd BUG: sys.exc_clear is py2 only. 2016-11-22 16:34:53 -05:00
Scott Sanderson 7a5f5da6b2 MAINT: Use lazyval instead of two decorators. 2016-11-22 14:26:58 -05:00
Scott Sanderson 52ed9093eb PERF: Deterministically GC pipeline results.
Any DataFrame that's had `.loc` or `.iloc `called on it participates in
a cycle, which means they're not immediately garbage collected when they
go out of scope.  This matters for pipeline results because they consume
multiple megabytes per column, which means that a pipeline result with
many columns can hold take up over 100MB.  By manually breaking
DataFrame cycles, we can ensure that we never hold multiple pipeline
results in memory at once.
2016-11-22 14:26:58 -05:00
Richard Frank 1d2d6d843f ENH: An improved error message when calling zipline api functions
outside of a running simulation. Previously, an AttributeError was
raised.
2016-11-11 17:00:03 -05:00
Eddie Hebert d1b2511864 STY: Add space between import and open parens.
For compliance with newer flake8 versions.

Should be no functional change.
2016-11-04 13:45:19 -04:00
Joe Jevnik bae4088cc0 ENH: cleanup branch based on feedback 2016-10-28 15:04:18 -04:00
Joe Jevnik c8e40a3736 ENH: Make aliases filters, factors, and classifiers to give them their methods 2016-10-28 15:04:18 -04:00
keang 265c02b0c1 MAINT: Restore @property decorator
This will keep `opens`, `closes`, `early_closes`, etc to the
same pattern.
2016-10-28 23:25:53 +08:00
Scott Sanderson 053206327b ENH: Name overrides in preprocessor factories.
Allows ``__funcname`` to be passed to preprocessors like expect_types
and expect_dtypes to override the name displayed in error messages.
This is useful for providing clearer errors for ``__init__`` and
``__new__`` methods in classes.
2016-10-12 15:50:10 -04:00
Scott Sanderson 7fc39fed70 Merge pull request #1518 from quantopian/add-coerce_types
MAINT: Add kwarg-based helper for coerce.
2016-10-03 19:52:08 -04:00
Scott Sanderson 4448a9fa49 MAINT: Add kwarg-based helper for coerce. 2016-10-03 13:12:52 -04:00
Andrew Liang 3b5031a829 MAINT: Rename restrictions.py to asset_restrictions.py
For clarity as to what sort of restrictions these are
2016-09-30 16:35:24 -04:00
Scott Sanderson 7700987abc STY: Remove extra whitespace. 2016-09-30 16:35:24 -04:00
Scott Sanderson 5b91175651 DOC: Fix docstring typo. 2016-09-30 16:35:24 -04:00
Scott Sanderson d5ea9c4daa BUG: days_at_time should return UTC dates.
Adds an example and clarifies the docs.
2016-09-30 16:35:24 -04:00
Scott Sanderson 87daa75c0c MAINT: Use Timedelta instead of DateOffset.
In days_at_time, use a Timedelta instead of a DateOffset.  We were
previously using DateOffset to work around a pandas 16 bug even though
it raises a PerformanceWarning.  Now that we're on pandas 18, we can use
the much simpler Timedelta construction.
2016-09-30 16:35:23 -04:00
Andrew Liang bf8b030417 MAINT: Deprecate set_do_not_order_list
In favor of a new method `set_restrictions` which takes a Restrictions
object. Calls to `set_do_not_order_list` should raise a deprecation
warning and create an equivalent Restrictions object, with which
`set_restrictions` will be called. For convenience, create a
RestrictionsSet from which the "restrictions" version of a security
list can be accessed
2016-09-30 16:35:23 -04:00
Andrew Liang e465f64f91 MAINT: Create SecurityListRestrictions that takes a SecurityList
The SecurityList implements a non-exposed method
`current_securities(dt)` which SecurityListRestrictions calls to
determine if an asset is restricted. Deprecate the `__iter__` and
`__contains__` methods of security lists in favor of
`current_securities(dt)`
2016-09-29 10:11:14 -04:00
Scott Sanderson e86fffc4ca PERF: Remove or defer calls to get_loc on large indices.
Mitigation for https://github.com/quantopian/zipline/issues/1503.
2016-09-21 06:18:31 -04:00
Scott Sanderson c23dd5beaa BUG: Remove set_trace and add test coverage. 2016-09-20 17:46:27 -04:00
Scott Sanderson 70755c5416 MAINT: Silence bad perf warning from pandas. 2016-09-20 17:12:09 -04:00
Scott Sanderson d9282ef7e0 BUG: Don't fail on integral floats in event rules.
Coerce and warn instead.
2016-09-20 17:12:08 -04:00
Scott Sanderson 966c0ceedb MAINT: Remove outdated compat code. 2016-09-20 17:12:07 -04:00
Scott Sanderson 53eb1964d9 MAINT: Temporarily ignore pandas warnings in categoricals.
Pandas 0.18 doesn't like having null-ish values in categoricals.  Fixing
this properly requires re-thinking the semantics for missing_value on
pipeline terms, so we're punting on that until after we've upgraded to
0.18.
2016-09-20 17:12:07 -04:00
Scott Sanderson ca54721058 MAINT: Pandas compat for rolling_*. 2016-09-20 17:12:07 -04:00
Scott Sanderson 599d6c59ef MAINT: Fix warnings from numpy on NaT comparison. 2016-09-20 17:12:07 -04:00
Scott Sanderson 750b410a48 BUG: Use arrays for week/month group calculations.
In pandas 0.18, the behavior of ``nth()`` changed so that Grouper no
longer can be easily used to recover group labels.

Instead of using the built-in grouper behavior, we use a groupby on two
arrays we build ourselves.  This recovers the original behavior, and is
about 2x faster as a bonus.
2016-09-20 17:12:07 -04:00
Scott Sanderson becf897da9 MAINT: Fix failures/warnings in test_api_shim.py
- Fixes a warning on indexing with a float that ultimately came from
  pd.Timedelta.total_seconds().  Adds ``timedelta_to_integral_seconds``
  and ``timedelta_to_integral_minutes()`` functions and replaces various
  usages of ``int(delta.total_seconds())`` with them.

- Fixes a warnings triggered in ``_create_daily_stats`` from
  passing tz-aware datetimes to np.datetime64.
2016-09-20 17:12:07 -04:00
Scott Sanderson 930f32f6a1 ENH: Make INT_DTYPES_BY_SIZE_BYTES ordered. 2016-09-20 16:24:55 -04:00
Jean Bredeche 87eb87525f PERF: Be smarter about counting the number of minutes across a contiguous bunch of sessions. 2016-09-19 13:25:03 -04:00
Jean Bredeche 1d2e1015c7 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
Richard Frank 3bdba2ec50 BUG: run_algorithm with no data source should default
to 'quantopian-quandl' bundle
2016-09-12 12:17:17 -04:00
Scott Sanderson 40fa6aeea4 STY: Fix flake8. 2016-09-07 21:58:15 -04:00
Scott Sanderson d6ad73e064 MAINT: Updates from Joe's PR feedback. 2016-09-07 20:42:19 -04:00
Scott Sanderson 977d1fa0b9 MAINT/TEST: Update default calendar smoketest. 2016-09-06 14:13:32 -04:00
Scott Sanderson 1ca23f2583 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
Scott Sanderson 2e50a092b1 DOC: Clarify expect_bounded docstring. 2016-09-02 13:33:55 -04:00
Scott Sanderson dee715cff2 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
Jean Bredeche 749c2eea33 ENH: Let event offsets be up to 12 hours. 2016-08-29 09:33:40 -04:00
Jean Bredeche 7b83cbe820 ENH: Add new parameter to schedule_function that accepts a trading
calendar.
2016-08-28 21:33:42 -04:00
Richard Frank 3493723e7b DEV: zipline ingest can downgrade the assets db
This lets us publish an "old" db version for the most recent release
of zipline, using the latest code base.
2016-08-24 15:32:30 -04:00
Richard Frank 89132a6925 MAINT: Consolidate coercion to sqlite conn/eng 2016-08-24 13:24:07 -04:00
Scott Sanderson 7f575c5b0c Merge pull request #1423 from quantopian/fix-sharedoc
Fix sharedoc
2016-08-22 14:51:05 -04:00
Scott Sanderson 346a58604e MAINT: Simpler impl of pad_lines_after_first. 2016-08-22 13:14:31 -04:00
Scott Sanderson 45302e140e DOC: Fix docs formatting for sharedoc.
The first line of indentation was incorrect.
2016-08-22 13:01:32 -04:00
Jean Bredeche ddb1009c25 Merge pull request #1407 from quantopian/minute_panel_daily_history
ENH: Add fast "vectorized" `minute_to_session_label` for DatetimeIndex
2016-08-22 10:27:40 -04:00
Richard Frank 7fbdf0672f DOC: Added licenses to calendar modules 2016-08-21 17:19:59 -04:00
Richard Frank dcedd7adf5 MAINT: Removed unused holiday definitions 2016-08-21 17:19:59 -04:00