From fd71f956c762819157ed33bdd4e50abd5d1822e0 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Fri, 19 Sep 2014 23:48:55 -0400 Subject: [PATCH] DOC: Add more information to IncompatibleHistoryFrequency message. --- zipline/errors.py | 5 +++-- zipline/history/history.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/zipline/errors.py b/zipline/errors.py index cb44c059..6843de60 100644 --- a/zipline/errors.py +++ b/zipline/errors.py @@ -167,5 +167,6 @@ class IncompatibleHistoryFrequency(ZiplineError): At least, not yet. """ msg = """ -Minute history requires minute frequency input data. -Either use daily history or provide minute frequency data.""".strip() +Requested history at frequency '{frequency}' cannot be created with data +at frequency '{data_frequency}'. +""".strip() diff --git a/zipline/history/history.py b/zipline/history/history.py index d2b2ef7f..2e589819 100644 --- a/zipline/history/history.py +++ b/zipline/history/history.py @@ -249,7 +249,10 @@ class HistorySpec(object): if isinstance(frequency, str): frequency = Frequency(frequency, daily_at_midnight) if frequency.unit_str == 'm' and data_frequency == 'daily': - raise IncompatibleHistoryFrequency() + raise IncompatibleHistoryFrequency( + frequency=frequency.unit_str, + data_frequency=data_frequency, + ) # The frequency at which the data is sampled. self.frequency = frequency