Skip to content

Commit

Permalink
added pandas day alias to fix problem when using hercules with resolu…
Browse files Browse the repository at this point in the history
…tions < 1 month

Signed-off-by: Jeffrey McAteer <jeffrey.p.mcateer@gmail.com>
  • Loading branch information
Jeffrey McAteer committed Nov 23, 2019
1 parent 5263b0a commit 5ff6aa1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/labours/modes/burndown.py
Expand Up @@ -328,7 +328,7 @@ def load_burndown(
)
daily[(last - start).days :] = 0
# Resample the bands
aliases = {"year": "A", "month": "M"}
aliases = {"year": "A", "month": "M", "day": "D"}
resample = aliases.get(resample, resample)
periods = 0
date_granularity_sampling = [start]
Expand All @@ -343,6 +343,11 @@ def load_burndown(
return load_burndown(
header, name, matrix, "month", report_survival=False
)
elif resample == "M":
print("too loose resampling - by month, trying by day")
return load_burndown(
header, name, matrix, "day", report_survival=False
)
else:
raise ValueError("Too loose resampling: %s. Try finer." % resample)
date_range_sampling = pandas.date_range(
Expand Down

0 comments on commit 5ff6aa1

Please sign in to comment.