Skip to content

Commit 5ff6aa1

Browse files
author
Jeffrey McAteer
committed
added pandas day alias to fix problem when using hercules with resolutions < 1 month
Signed-off-by: Jeffrey McAteer <jeffrey.p.mcateer@gmail.com>
1 parent 5263b0a commit 5ff6aa1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/labours/modes/burndown.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def load_burndown(
328328
)
329329
daily[(last - start).days :] = 0
330330
# Resample the bands
331-
aliases = {"year": "A", "month": "M"}
331+
aliases = {"year": "A", "month": "M", "day": "D"}
332332
resample = aliases.get(resample, resample)
333333
periods = 0
334334
date_granularity_sampling = [start]
@@ -343,6 +343,11 @@ def load_burndown(
343343
return load_burndown(
344344
header, name, matrix, "month", report_survival=False
345345
)
346+
elif resample == "M":
347+
print("too loose resampling - by month, trying by day")
348+
return load_burndown(
349+
header, name, matrix, "day", report_survival=False
350+
)
346351
else:
347352
raise ValueError("Too loose resampling: %s. Try finer." % resample)
348353
date_range_sampling = pandas.date_range(

0 commit comments

Comments
 (0)