DOC: Add more information to IncompatibleHistoryFrequency message.

This commit is contained in:
Scott Sanderson
2014-09-19 23:48:55 -04:00
parent 16827e1af4
commit fd71f956c7
2 changed files with 7 additions and 3 deletions
+3 -2
View File
@@ -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()
+4 -1
View File
@@ -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