25 Commits

Author SHA1 Message Date
Conner Fromknecht 99efa7a9f3 Fixed catalyst tests except example tests 2017-06-19 14:43:10 -07:00
Maya Tydykov 497708d86e BUG: address pandas normalization bug on non-sorted DT index 2017-04-04 17:00:32 -04:00
Maya Tydykov 51eb11fbc9 BUG: make the events loader handle empty raw data
TST: add test case for empty raw events data

BUG: update for python compatibility

MAINT: Simplify assertion for empty events case.

DOC: Add comments on indexer unpacking.

MAINT: move some config to test method
2017-01-19 12:00:49 -05:00
Joe Jevnik abcb6276ff BUG: fix blaze query in ffill_query_in_range to correct issue in events loader 2016-10-13 15:27:44 -04:00
Scott Sanderson 0ff13e7fdc Revert "MAINT: Remove support for custom string Column missing values."
This reverts commit 1b1e842e2339d6d0ee40cdfe34dcd27b4e4a7c0c.
2016-09-20 17:12:07 -04:00
Scott Sanderson 16f4944232 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 b5fd0cdbfa MAINT: Use sort_values() instead of sort().
pd.DataFrame.sort() is deprecated.
2016-09-20 17:12:07 -04:00
Scott Sanderson d265abbbf1 MAINT: Use dataframe.iteritems instead of iterkv.
iterkv is deprecated.
2016-09-20 17:12:07 -04:00
Eddie Hebert e934c6aeaf TST: Make room for multiple calendars in tests.
When adding fixtures for futures data, there will be a need for multiple
calendars in the fixture ecosystem. e.g. a test that includes both
equities and futures would need an overall calendar which encompasses
both equities and futures; however, the test data for equities should
still still be limited to the bounds set by the NYSE calendar.

Make the fixtures that setup trading calendars and values dervied from
the trading calendar (e.g. trading sessions) accept an iterable of
calendars which need to be created, then populate those values into a
dict keyed by the calendar name.

Change `WithNYSETradingDays` to include sessions in the name,
since we are moving to session as the name for the 'day' unit.

Provide `trading_days` which is really "NYSE trading sessions` on
`WithTradingSessions` for backwards compatibility.
2016-08-05 12:17:27 -04:00
Scott Sanderson 67f76e4d67 PERF: Speed up event utils test case.
Just take a sample of all 5000 permutations of 7 dates.
2016-07-14 17:38:58 -04:00
Scott Sanderson 07b84f87fb PERF: Speed up test_events.
Use arrays in more places, and use permutations of indexers instead of
permutations of the values.

MAINT: add testing of boundary conditions

MAINT: use check_arrays to work with both pandas versions
2016-06-23 13:54:37 -04:00
Maya Tydykov 321e6f719f TST: expand tests
DOC: add comment to workaround line
2016-06-23 12:14:24 -04:00
Maya Tydykov 9395a469f0 BUG: change timestamp normalization to account for pandas bug
BUG: revert to old normalization algo with extra normalization
2016-06-23 12:14:22 -04:00
Scott Sanderson bc302beec9 MAINT: Rework event datasets.
- Refactored EventsLoader and BlazeEventsLoader to not require a
  subclass per dataset.  Instead, you now pass a map from columns to
  event fields directly to the EventsLoader constructor.

- Removed a large number of Quantopian-specific datasets and associated
  tests.

- Rewrote the core logic of EventsLoader and BlazeEventsLoader to share
  index calculations across multiple requested columns.

- Fixed a bug where event fields were incorrectly forward-filled when
  null values were present in an event.
2016-06-10 19:22:27 -04:00
Maya Tydykov 0191d9d903 MAINT: move filtering for null date rows back to dataframe
TST: test both next and prev event frame loading and use EventsLoader.

BUG: remove extra arg

MAINT: call list on zip for compatibility with python 3
2016-04-25 16:11:12 -04:00
Maya Tydykov 390295481c TST: add test for blaze loader with null data in date col
MAINT: fix blaze query
2016-04-25 11:42:10 -04:00
Maya Tydykov e41c99d077 MAINT: add an event date col field to each loader
MAINT: add event date col field and filter rows where this field is null

TST: modify tests to filter nulls in event date col

MAINT: calculate value repeats by vectorized computation on separate start and end dates.

MAINT: pass DatetimeIndex instead of list of strings
2016-04-25 11:42:08 -04:00
Maya Tydykov f8aa7c2ef4 TST: add test for case when null in expected column 2016-04-25 11:42:06 -04:00
Joe Jevnik 792860b4cb MAINT: rename bz.Data -> bz.data 2016-03-15 14:29:48 -04:00
Joe Jevnik 79e7c84a40 TST: use rel imports from tests 2016-02-26 20:22:02 -05:00
Maya Tydykov 18d838be87 MAINT: modify coersion logic.
MAINT: make expected_cols class attributes.

MAINT: make concrete_loader a class attribute.

MAINT: drop sid column before creating loader.

TST: add method to fill df with event cases.

TST: move common case df into test_events.py.

TST: improve tests and fix error message assertions.

STY: fix whitespace.

DOC: update docs.

STY: fix style.

MAINT: clean up

STY: fix indentation.

MAINT: use different assertion method to check error message for python3.4 compatibility.
2016-02-26 09:51:58 -05:00
Maya Tydykov 5b37af6e04 TST: enhance test; add more common data.
STY: fixes for PEP8.
2016-02-25 17:33:46 -05:00
Maya Tydykov e257dc1da9 MAINT: refactor constants to common file.
TST: refactor constants and clarify comments.

TST: clean up/extract constants in tests.

MAINT: add/modify constants.

MAINT: remove obsolete and alphabetize.

MAINT: clean up.

MAINT: modify constants to have named params.

MAINT: extract constants.

STY: fix indentation.

MAINT: refactor common part out of buyback_auth.

MAINT: refactor earnings test logic.
2016-02-25 17:33:45 -05:00
Maya Tydykov ae922bf3ee MAINT: modify next_date_frame and prev_date_frame to mirror previous_value.
MAINT: clean up and improve docs.

BUG: fix imports.

MAINT: refactor test.

MAINT: change class name.

MAINT: remove error since won't be reached.

TST: improve and expand tests.

MAINT: change class name.

MAINT: change class name.

MAINT: extract string constants and remove error that won't be reached.

STY: fix line length.

MAINT: undo name change.
2016-02-25 17:33:44 -05:00
Maya Tydykov 7100e60474 MAINT: accept more data structures, verify, and select loader dynamically.
MAINT: add fields based on changes to events loader.

MAINT: modify based on expectations of events loader.

MAINT: modify args.

TST: clean up and clarify df access.

TST: fix bugs in test that didn't properly split datasets' data.

MAINT: fix merge error.
2016-02-25 17:33:41 -05:00