Commit Graph

4578 Commits

Author SHA1 Message Date
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
Scott Sanderson d47144dfb8 DOC: Rename NoopRestrictions to NoRestrictions. 2016-09-30 16:35:23 -04:00
Scott Sanderson cfce14ed9b DOC: Update docstring for set_restrictions. 2016-09-30 16:35:23 -04:00
Scott Sanderson 523b05ef3f TEST: Clarify test_restrictions a bit.
- Use parameter_space instead of `parameterized.expand`.
- Use a timedelta instead of concatenating strings.
- Use a (possibly no-op) scramble function instead of reordering list
  literals.
- Use `freeze_dt, unfreeze_dt, re_freeze_dt` instead of `dts[n]`.
- Rename `assert_vectorized_results` to `assert_all_restrictions`.
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 5e276d0e72 TEST: Modify tests for extra BarData parameter
Introducing a WithCreateBarData fixture which allows for the
creation of a BarData using only the `simulation_dt_func` and
`restrictions` params. Assumes that each suite uses the same
`data_portal`, `data_frequency` and `trading_calendar`
2016-09-29 10:11:15 -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
Andrew Liang b70084c6bf ENH: can_trade should take restricted list into account
Additionally, create an option for a violation of a 'do not order'
trading control to log an error instead of failing
2016-09-29 10:11:14 -04:00
Andrew Liang 0119aba410 ENH: A point-in-time restricted list with restrictions stored in memory
An ABC Restrictions defines a group of restrictions responsible
for returning restriction information for sids on certain dts. An
InMemoryRestrictions is a point-in-time group of such restrictions,
with all restrictions and their dates passed in upon instantiation.
A StaticRestrictedList takes a list of sids, restricting them at all
dates
2016-09-27 18:19:51 -04:00
Maya Tydykov 12357a8082 Merge pull request #1396 from quantopian/add_estimates_quarter_loader_to_pipeline
Add estimates quarter loader to pipeline
2016-09-27 17:18:16 -04:00
Maya Tydykov f528c01ca9 TST: add test for changing event dates and adjustments
BUG: get column names from column dict

BUG: fix name map
2016-09-27 16:53:36 -04:00
Scott Sanderson 4a22afd29a Merge pull request #1514 from fzagarzazu/fix-dockerfile
Docker build failure - Add Tini and set version range for numpy
2016-09-27 12:18:17 -04:00
Joe Jevnik 8d2e6446ee PERF: only query for the columns requested + metadata
BUG: choose last event date for quarter shift
2016-09-27 09:54:46 -04:00
Joe Jevnik bdce6ae493 PERF: vectorize earnings estimates 2016-09-27 09:54:46 -04:00
Maya Tydykov 65d15d3960 TST: add test for sid with no data
MAINT: optimization - only look at assets appearing in data

TST: simplify test

DOC: add documentation for checkpoints

MAINT: explicitly cast event date field to datetime

MAINT: add back import

TST: fix indexing to remove setting wtih copy warning
2016-09-27 09:54:44 -04:00
Maya Tydykov f140cdb8d6 MAINT: add checkpointing
BUG: add cols for sids with no data and get adjustments outside column loop
2016-09-27 09:54:43 -04:00
Maya Tydykov 90984be20c TST: add test for missing num_quarters and clean up tests 2016-09-27 09:54:43 -04:00
Maya Tydykov 2a09160ca8 TST: add test to check previous columns w/ multiple qtrs
MAINT: pass column to name dict

MAINT: make check for invalid num columns py3-compatible
2016-09-27 09:54:41 -04:00
Maya Tydykov cc07a00d16 TST: add test for requesting multiple datasets with multiple quarters 2016-09-27 09:54:41 -04:00
Maya Tydykov ebbe85b79a TST: add test for datetime array and update test
TST: fix quarter normalization test

TST: change test name

BUG: remove arg

BUG: look at dict keys

TST: add test for windowing

MAINT: raise ValueError instead of asserting

TST: add assertion to check windowing

TST: parametrize test over number of quarters forward/back.

BUG: fix adjustment calculation logic for quarter crossovers.

TST: add test for previous quarter windows

BUG: fix bugs in calculating previous windows

BUG: fix missing value for datetime

TST: add test case for missing quarter
2016-09-27 09:54:41 -04:00
Maya Tydykov 199c775fbf ENH: add adjustment for datetime64 arrays
BUG: fix adjustment start index
2016-09-27 09:54:40 -04:00
Maya Tydykov 2975f9b2fd TST: add test for 1d array overwrite 2016-09-27 09:54:40 -04:00
Maya Tydykov e53d7fc9b2 ENH: add an adjustment for float64 2d arrays.
BUG: fix syntax error

MAINT: optimize code for cython
2016-09-27 09:54:39 -04:00
Maya Tydykov d578463dcf TST: add cases for shifting release dates
BUG: fix bugs in blaze loader

BUG: call correct method

MAINT: explicitly cast dates column

MAINT: modify code to comply with pandas 0.16.1
2016-09-27 09:54:38 -04:00
Maya Tydykov 863da5932c TST: add tests for quarter rotation logic 2016-09-27 09:54:37 -04:00
Maya Tydykov 6454fca6dc TST: add tests for quarter estimates
MAINT: modify algorithm for calculating previous releases

BUG: fix quarter calculation logic
2016-09-27 09:54:36 -04:00
Maya Tydykov 6c6a33c73b ENH: add loader for estimates 2016-09-27 09:45:12 -04:00
Federico M. Zagarzazu 4ae493444a Set scipy and pandas version range in Dockerfile 2016-09-26 21:13:35 -05:00
Scott Sanderson 1942029dbb Merge pull request #1513 from jkleint/patch-1
Propagate exceptions in loader to prevent variable reference before use
2016-09-26 10:36:03 -04:00
Federico M. Zagarzazu 68f6e6e64c Add Tini and set version range for numpy in Dockerfile 2016-09-25 00:27:55 -05:00
jkleint cf546c7e40 Propagate exceptions in loader to prevent variable reference before use
`data.loader.ensure_benchmark_data()` was trying to use data after an exception was raised loading it.  The code was logging and swallowing exceptions; this re-raises.
2016-09-23 15:55:55 -07:00
Andrew Daniels be0ecb61be PERF: Replace get_loc calls in calc_dividend_ratios with get_indexer (#1510)
We can make a single vectorized call outside of the loop, instead of
repeatedly calling get_loc inside it.
2016-09-22 19:05:43 -04:00
Scott Sanderson ac9d8418b1 Merge pull request #1508 from quantopian/forward-window-safety-in-demean
BUG: F.window_safe implies f.demean().window_safe.
2016-09-22 13:50:30 -04:00
Scott Sanderson 49cd8e138b BUG: F.window_safe implies f.demean().window_safe. 2016-09-22 12:41:50 -04:00
Andrew Daniels ca5f98be8c BUG: Makes NoData{Before, After}Date subclass NoDataOnDate (#1507)
This allows us to catch and handle all three of these exceptions in
`calc_dividend_ratios`.
2016-09-22 11:43:43 -04:00
Andrew Daniels 9d7049a872 Merge pull request #1500 from quantopian/make-metadata-optional
MAINT: Adds option for minute bar writer to not write metadata
2016-09-21 12:40:19 -04:00
Eddie Hebert 9f77473ae6 Merge pull request #1502 from quantopian/remove-future-chain
MAINT: Remove `future_chain` API method.
2016-09-21 11:44:57 -04:00
Andrew Daniels 518b1d78ac MAINT: Adds option for minute bar writer to not write metadata
With the addition of the truncate function, there are cases where we'll
want to construct a BcolzMinuteBarWriter to call truncate, without
gathering all the metadata. This commit adds a write_metadata arg to its
init, which is True by default. If False is specified, no metadata is
written.

Requires adding logic to truncate to update end_session in metadata to
the truncate date.
2016-09-21 11:31:54 -04:00
Scott Sanderson 098758b3ce Merge pull request #1505 from quantopian/blaze-it
MAINT: Put us back on blaze master.
2016-09-21 11:18:27 -04:00
Eddie Hebert f4daf10e2f MAINT: Remove future_chain API method.
`future_chain` will be replaced by the as yet to be implemented method,
`data.current_chain`

Also removing `FutureChain` which will be replaced by another version
which only supports indexing and iteration.
2016-09-21 11:08:34 -04:00
Scott Sanderson 700260cc71 MAINT: Put us back on blaze master. 2016-09-21 10:46:57 -04:00
Eddie Hebert f3c4381b24 Merge pull request #1477 from quantopian/init-1.0.3-release-notes
DOC: Add skeleton for 1.0.3 release notes.
2016-09-21 10:36:31 -04:00
Eddie Hebert 5c77b36ce9 Merge pull request #1494 from quantopian/remove-unused-update-dividends
MAINT: Remove unused method.
2016-09-21 10:36:12 -04:00
Scott Sanderson 50457e27af Merge pull request #1504 from quantopian/pandas18-memory-stopgaps
PERF: Remove or defer calls to get_loc on large indices.
2016-09-21 10:18:57 -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 74413695f3 Merge pull request #1339 from quantopian/latest-numpy-pandas
Latest numpy and pandas
2016-09-20 22:03:49 -04:00
Scott Sanderson c23dd5beaa BUG: Remove set_trace and add test coverage. 2016-09-20 17:46:27 -04:00