mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-12 12:12:04 +08:00
MAINT: Use Python 3 compatible metaclass.
Use six's with_metaclass to have objects that use metaclasses, in both Python 2 and 3. Otherwise, in Python 3 the objects were being treated as if they did not have a metaclass, when the Python 2 syntax is used, leading to errors because of missing attributes, etc.
This commit is contained in:
@@ -16,19 +16,20 @@
|
||||
from collections import defaultdict
|
||||
from math import sqrt
|
||||
|
||||
from six import with_metaclass
|
||||
|
||||
from zipline.errors import WrongDataForTransform
|
||||
from zipline.transforms.utils import EventWindow, TransformMeta
|
||||
import zipline.utils.math_utils as zp_math
|
||||
|
||||
|
||||
class MovingStandardDev(object):
|
||||
class MovingStandardDev(with_metaclass(TransformMeta)):
|
||||
"""
|
||||
Class that maintains a dictionary from sids to
|
||||
MovingStandardDevWindows. For each sid, we maintain a the
|
||||
standard deviation of all events falling within the specified
|
||||
window.
|
||||
"""
|
||||
__metaclass__ = TransformMeta
|
||||
|
||||
def __init__(self, market_aware=True, window_length=None, delta=None):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user