From ad25f29b7b5011cfb411880f1412e332e7911d6d Mon Sep 17 00:00:00 2001 From: Joe Jevnik Date: Mon, 13 Oct 2014 16:14:56 -0400 Subject: [PATCH] ENH: Provides aliases for the (Date|Time)RuleFactory classes for better Quantopian/Zipline interoperability --- zipline/utils/events.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zipline/utils/events.py b/zipline/utils/events.py index 9c1848a1..1bd42a2b 100644 --- a/zipline/utils/events.py +++ b/zipline/utils/events.py @@ -44,6 +44,8 @@ __all__ = [ # Factory API 'DateRuleFactory', 'TimeRuleFactory', + 'date_rules', + 'time_rules', 'make_eventrule', ] @@ -494,6 +496,11 @@ class TimeRuleFactory(object): market_close = BeforeClose +# Convenience aliases. +date_rules = DateRuleFactory +time_rules = TimeRuleFactory + + def make_eventrule(date_rule, time_rule, half_days=True): """ Constructs an event rule from the factory api.