Commit Graph

14 Commits

Author SHA1 Message Date
twiecki 4bdecd6402 STY: PEP8 fixes. 2014-03-26 20:46:20 +09:00
Eddie Hebert a203f69635 PERF: Remove alias_dt transform in favor of property on SIDData.
Adding a copy of the Event's dt field as datetime via the
`alias_dt` generator, so that the API was forgiving and allowed
both datetime and dt on a SIDData object, was creating noticeable
overhead, even on an noop algorithms.

Instead of incurring the cost of copying the datetime value and
assigning it to the Event object on every event that is passed
through the system, add a property to SIDData which acts as an
alias `datetime` to `dt`.

Eventually support for `data['foo'].datetime` may be removed,
and could be considered deprecated.
2014-03-07 10:55:59 -05:00
Eddie Hebert 9feed61748 MAINT: Use more exact boolean checks for pandas structures.
To prepare for being compatible with pandas==0.13.0, which is stricter
on boolean checks.
2014-01-29 17:13:13 -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 f2dc979fbc BUG: Make all iteration related methods fo BarData match __iter__
`for s in data` and methods like `for s in data.keys` were not producing
the same list of active sids

Make the other iteration methods match __iter__ by using the contains
method to check whether or not the sid is active.

For use of data outside of the algoscript context, which needs access
to all data fields use data._data
2013-12-20 00:05:53 -05:00
Jonathan Kamens 73faf9133e MAINT: Clean up imports of zipline.finance.trading
Use "from zipline.finance import trading" instead of "import
zipline.finance.trading as trading".
2013-10-29 13:50:14 -04:00
fawce 279605dfb5 BUG: Fix excessive recalcuations in batch.
Downsampled batch transforms should only recalcuate on close
2013-10-20 08:06:39 -04:00
fawce 76887e2855 BUG: Fix non-trading advancement of trading day count and downsample.
Add a guard so that we do not advance trading day count or downsample
on non-trading days.
2013-10-18 14:07:49 -04:00
fawce 0ceabb590b BUG: Group and aggregate downsampling by trading day.
Otherwise, out of market events would result in a mishaped
panel.
2013-10-17 22:41:20 -04:00
fawce 3a1ca1ddb2 BUG: Mask of batch_transform columns to match keys in data parameter.
The underlying RollingPanel in batch_transform was always accumulating
all values to ever appear in data.

However, at any given algo time the desired return value is what the
current active sids are.

Instead, mask down to the sids that are passed in as the data parameter.
2013-10-16 15:16:03 -04:00
Eddie Hebert 0224aeb552 MAINT: Use enviroment normalize_date instead of dt.replace
Continue path of removing scattered calls to dt.replace.
2013-10-16 15:14:24 -04:00
fawce f8ce7d944b ENH: Add downsampling to BatchTransform.
So that with minute data, 2.5 orders of magnitude of data can
be cut, allowing for longer window_lenghts, when the daily
values are what are desired for a signal.
2013-10-11 16:48:08 -04:00
Eddie Hebert ddb541b9b3 MAINT: Change shape of supplemental data to match batch data.
Expect the same shape of data for the supplemental data, to make
working and preparing with the supplemental data consistent with
what is passed to the algorithm.
2013-09-16 11:51:22 -04:00
Eddie Hebert fa845cbf03 MAINT: Move batch transform into a dedicated module.
Break the BatchTransform class and decorator function into a
separate module, with hope that it makes it easier to zero in on
batch transform logic.
2013-07-10 17:56:32 -04:00