소스 검색

added pandas day alias to fix problem when using hercules with resolutions < 1 month

Signed-off-by: Jeffrey McAteer <jeffrey.p.mcateer@gmail.com>
Jeffrey McAteer 5 년 전
부모
커밋
5ff6aa1d73
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      python/labours/modes/burndown.py

+ 6 - 1
python/labours/modes/burndown.py

@@ -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]
@@ -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(