Commit Graph

1292 Commits

Author SHA1 Message Date
Eddie Hebert fea7d899cd Merge pull request #1529 from quantopian/current-contract
ENH: Add continuous future current contract.
2016-10-07 23:39:01 -04:00
Eddie Hebert fcf3e50cde ENH: Add continuous future current contract.
Add the ability for an algorithm to request the current contract for a
future chain via `data.current`.

e.g.:
```
data.current(ContinuousFuture('CL', offset=0, roll='calendar'),
'contract')
```
2016-10-07 18:26:23 -04:00
Andrew Daniels 2f097ead76 ENH: Adds last_available_{session, minute} args to DataPortal (#1528)
This allows optionally setting the last available dts in the DataPortal
explicitly. If these args aren't provided, we fall back to inferring
these from the underlying readers, which was the previous behavior.
2016-10-06 20:46:54 -04:00
Scott Sanderson f3f138c450 TEST: Simplify testing of restriction orderings. 2016-10-05 14:42:17 -04:00
Andrew Liang e421a811e7 BUG: Restrictions passed into HistoricalRestrictions not sorted correctly 2016-10-05 14:09:26 -04:00
Andrew Liang 25ba4369c3 ENH: _UnionRestrictions for combining multiple Restrictions 2016-09-30 16:35:24 -04:00
Andrew Liang 148d2a5273 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 117450a489 DOC: Rename NoopRestrictions to NoRestrictions. 2016-09-30 16:35:23 -04:00
Scott Sanderson 8f150eb6ce 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 99f6ecab3f 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 a30f48e218 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 af85b22313 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 b504d29a78 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 0f47cf313d 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 6cb06ffcdf 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
Joe Jevnik 5d7100542c PERF: only query for the columns requested + metadata
BUG: choose last event date for quarter shift
2016-09-27 09:54:46 -04:00
Maya Tydykov cbd9bd068c 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 7d75615fd2 TST: add test for missing num_quarters and clean up tests 2016-09-27 09:54:43 -04:00
Maya Tydykov 5e1a8224cd 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 ebcc5f714a TST: add test for requesting multiple datasets with multiple quarters 2016-09-27 09:54:41 -04:00
Maya Tydykov eb22f2ab6b 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 2fb7ec7612 TST: add test for 1d array overwrite 2016-09-27 09:54:40 -04:00
Maya Tydykov ef350f3889 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 f1c07708cd TST: add tests for quarter rotation logic 2016-09-27 09:54:37 -04:00
Maya Tydykov afc5297fe3 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 1c375806e7 ENH: add loader for estimates 2016-09-27 09:45:12 -04:00
Scott Sanderson bddb453272 BUG: F.window_safe implies f.demean().window_safe. 2016-09-22 12:41:50 -04:00
Andrew Daniels a5c7e93540 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 25517e2b15 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 96cc6b6588 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
Eddie Hebert 9fd8ddda53 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 9cc2ecf8d5 BUG: Remove set_trace and add test coverage. 2016-09-20 17:46:27 -04:00
Scott Sanderson 6e3bfe2d78 MAINT: Rebuild example data. 2016-09-20 17:12:09 -04:00
Scott Sanderson 2522ca28ae BUG: Don't fail on integral floats in event rules.
Coerce and warn instead.
2016-09-20 17:12:08 -04:00
Scott Sanderson ec89402a3e MAINT: Fix PerformanceWarning import. 2016-09-20 17:12:08 -04:00
Scott Sanderson 918de6ad26 MAINT: Use explicit floats in np.full. 2016-09-20 17:12:08 -04:00
Scott Sanderson 46cf54b180 MAINT: Remove outdated compat code. 2016-09-20 17:12:07 -04:00
Scott Sanderson 6aeba11176 STY: Fix flake8 failures. 2016-09-20 17:12:07 -04:00
Scott Sanderson 48a44f321a DOC: Note where cleanup happens. 2016-09-20 17:12:07 -04:00
Scott Sanderson 493e18252d 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 a9c02935c6 Revert "MAINT: Remove support for custom string Column missing values."
This reverts commit 1b1e842e2339d6d0ee40cdfe34dcd27b4e4a7c0c.
2016-09-20 17:12:07 -04:00
Scott Sanderson ed365dc5fe MAINT: Remove support for custom string Column missing values.
Pandas 0.18 deprecated passing "null-ish" values to pd.categorical.  The
expectation, instead, is that you use categorical's native support for
missing data, which means the user will always get NaN's for missing
entries of the categorical.

A follow-up to this change should probably drop support for custom
missing values entirely and to use LabelArray/categorical for integer
data.
2016-09-20 17:12:07 -04:00
Scott Sanderson da8ed8919e MAINT: Pandas compat for rolling_*. 2016-09-20 17:12:07 -04:00
Scott Sanderson 52166e9958 MAINT: Pass float to np.full explicitly. 2016-09-20 17:12:07 -04:00
Scott Sanderson a1273cd669 MAINT: Fix warnings from numpy labelarray methods. 2016-09-20 17:12:07 -04:00
Scott Sanderson 9bd6cab115 MAINT: Pass float explicitly. 2016-09-20 17:12:07 -04:00
Scott Sanderson 9aa866e434 MAINT: Use sort_values() instead of sort().
pd.DataFrame.sort() is deprecated.
2016-09-20 17:12:07 -04:00
Scott Sanderson ef88dfdad2 MAINT: Use dataframe.iteritems instead of iterkv.
iterkv is deprecated.
2016-09-20 17:12:07 -04:00
Scott Sanderson f8734e8721 MAINT/TEST: Clarify test_events.
- Refer to ``sessions`` instead of periods.
- Use ``toolz.concat`` instead of an O(N ** 2) sequence of appends.
2016-09-20 17:12:07 -04:00
Scott Sanderson 259f10a2d9 MAINT: Pass float to np.full explicitly. 2016-09-20 17:12:07 -04:00