Commit Graph

11 Commits

Author SHA1 Message Date
Eddie Hebert 36f8b77290 MAINT: Support both Python 2 and 3 next interfaces.
Python 3 uses the `__next__` method instead of `next`,
and uses the syntax of `next(foo)` accordingly.

Add `__next__` and `next` side-by-side so both Python 2 and 3 have
a method that can be used during iteration.
2014-01-07 11:46:57 -05:00
Eddie Hebert b4959e46cf MAINT: Use six for Python 3 compatible names and behavior.
Use the six module to import functions and types that are
consistent between Python 2 and 3, so that one code base can
support both versions.

- Use integer types instead of int and long.
- Use string_types instead of basestring.
- Account for iteritems, itervalues, iterkeys.
- Use six.moves for filter and zip, reduce
- Use compatible bytes for md5 hasher.
- xrange and range
2014-01-07 11:33:50 -05:00
Eddie Hebert a04ece1840 MAINT: Use up-to-date field names in test_source
TRANSACTION member of Event had been removed.
close_price and open_price, are preferred to to close and open
2013-05-05 11:09:59 -04:00
Eddie Hebert fed0a9a998 TST: Ensure that test bars and events use midnight for daily data.
Daily data should be using midnight as the timestamp,
ensure that test data created by data_gen use midnight, so that
upcoming implementations that rely on the timestamp will be compatible.
2013-04-25 11:30:57 -04:00
Richard Frank 2dbafd5162 BUG: Zero out the microsecond attribute of datetimes
wherever we zero out the second attribute.  Otherwise, we can be
off by some microseconds from midnight, etc.
2013-04-15 10:44:44 -04:00
Eddie Hebert 58af62f18d REL: Update copyright on all files touched since end of 2012.
s/Copyright 2012/Copyright 2013/
2013-04-05 14:28:15 -04:00
Eddie Hebert f2d618b466 MAINT: Moves create_trade out of gens.utils
Slight refactoring of moving create_trade so that it's alongside
other testing/mock data utilities, instead of part of the gens module.
2013-03-25 23:51:25 -04:00
Eddie Hebert 69b87b859b Fixes trading day generation logic in test source.
This uses more of @fawce's original logic from record_var branch.

TODO: Add unit test to ensure that this function generates only
market days.
2013-01-31 13:06:15 -05:00
Eddie Hebert dfd9f2105d Changes test_source date_gen to only emit trading days.
Based on @fawce's work on record_vars branch.
2013-01-31 07:13:53 -05:00
Eddie Hebert b3e8d56c02 Removes unused parameters in test trade info creation.
This code hasn't used `random` in a while, removing the parameter
left as an artifact.
2013-01-26 09:44:43 -05:00
Eddie Hebert f85ad50e60 Breaks the sources module into pieces.
Clearing the way for adding in a DataSource class within the
sources module.
2012-11-19 17:30:16 -05:00