Commit Graph

19 Commits

Author SHA1 Message Date
Eddie Hebert b3efb5eb69 MAINT: Remove ndict class.
Now that ndict is no longer used in any part of the system during
a backtest, remove all remaining references in tests, etc.
2013-04-26 16:03:01 -04:00
Eddie Hebert bf1fc42acc BUG: Fix time spent checking equality of floating point numbers.
The use of np.allclose introduced a severe performance penalty,
caused by the creation of two `np.array`s for each check.

Instead create and use a similar check which maintains tolerance
to floating point rounding, but operates only on scalars.
2013-04-16 13:09:26 -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
fawce 890762bde7 MAINT: added typed errors module
- added exceptions in place of asserts for expected fields for rolling
transforms.
- removed assertions with Messages in favor of typed exceptions.
2013-03-19 11:39:23 -04:00
Eddie Hebert 414e12ecc9 BUG: Fixes error due to floating point rounding in stddev calc.
Adds a check to see if the s_squared value is near 0.

When the number was very near 0, a very small negative floating
point, the sqrt throws a 'math domain error', this prevents that
case.
2013-02-28 22:20:45 -05:00
Eddie Hebert 8c04621f57 Changes stddev and vwap transforms to accept parameters as kwargs.
So that algorithms that specifiy market_aware, days and delta
as args can be transitioned to just specifying a window_length kwarg.

Moving towards removing market_aware and delta completely.
2013-02-02 13:22:37 -05:00
Paolo Bernardi a11a57cec8 Update zipline/transforms/stddev.py
Fixed typo.
2013-02-01 17:47:31 +01:00
Eddie Hebert 39f44a44f8 Reverting changes MovingStandardDevWindow.
Though the addition of tracking mulitple values in the window
is powerful, the changes broke behavior of existing algorithms
by changing method signatures and names.

So temporarily reverting these changes, to be pulled back in when
a way to have the multiple fields tracked with the existing API
is written, or a cutover of the API is figured out and determined.
2013-01-21 00:12:33 -05:00
Eddie Hebert 9e31d83084 Fixes check of ticks in stddev, now that __len__ has been removed. 2013-01-17 18:11:27 -05:00
Eddie Hebert dbcfc0a2a5 Restores previous get_stddev method and uses the price value.
To maintain compatibility with existing algorithms.
2013-01-17 17:44:21 -05:00
Thomas Wiecki 685b2ed6fd REF: Fields is kwarg is MovingStandardDevWindow. 2013-01-17 12:10:09 -05:00
Thomas Wiecki eb1cb27a07 REF: fields now defaults to price for mavg and stddev transform. Also allows string specification. 2013-01-17 11:46:17 -05:00
Thomas Wiecki fd9bbbebfa Fix for stddev during merging. 2013-01-16 11:53:35 -05:00
Elektra58 d0640d56c8 Refactored stdev transform to be applied to multiple fields, not just price
UnitTest for transforms refactored to account for changed stdev transform, introduced AssertAlmostEqual
2013-01-16 10:33:38 -05:00
Eddie Hebert f54881cd08 Changes tests from using an ndict for trades to an Event object.
When run over large amounts of data the use of ndict's gets and sets
become a large bottleneck, around 1/5th of the CPU time is spent
in ndict's __setattr__, __getattr__, etc.

By switching to an object for an event,
we reduce the penalty significantly.

Removes asserts that check for event being an ndict, as well as those
that assume a certain behavior of the __contains__ method for events.
2012-12-21 14:31:40 -05:00
Eddie Hebert ab6b754922 Changes EventWindow parameter of days to window length.
The days parameter was causing confusion when explaining the
usage of the batch_transform decorator.
2012-11-20 11:52:27 -05:00
Thomas Wiecki 7a34e37b1e Transforms now default market_aware=True. 2012-10-23 09:14:05 -04:00
Eddie Hebert 7904773d00 Updates flake8 to latest.
The latest flake8 release in now 1.5, which pulls in pep8: 1.3.4a0

The upgrade pep8 has changes to what it picks up as lint.
Making code base compatible, so that new devs can install pep8
from PyPI and not have friction over the version difference.

Currently using these ignores in the config file:

```
[pep8]
ignore = E124,E125,E126
```

Ignoring these since they are difficult to squash while maintaining
an 80 char line length, and appear spurious.
Should address later.

Updates Travis config, README, and pip requirements to reflect change.
2012-10-22 11:57:16 -04:00
Thomas Wiecki 15ac658024 Restructured file hierarchy. Transforms now live in transforms (transform.py is now transforms/utils.py). Sources are in sources.py. VWAP is now MovingVWAP. 2012-10-19 18:10:51 -04:00