From 95db25be3eec9bbc04e37c2c18d746d12065b158 Mon Sep 17 00:00:00 2001 From: Yichen Zhou Date: Fri, 10 Jan 2025 15:26:01 -0800 Subject: [PATCH] Update timesfm_base.py Fixing MS checked after S --- src/timesfm/timesfm_base.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/timesfm/timesfm_base.py b/src/timesfm/timesfm_base.py index 9e2c0ec..088cfab 100644 --- a/src/timesfm/timesfm_base.py +++ b/src/timesfm/timesfm_base.py @@ -50,13 +50,13 @@ def moving_average(arr, window_size): def freq_map(freq: str): """Returns the frequency map for the given frequency string.""" freq = str.upper(freq) - if (freq.endswith("H") or freq.endswith("T") or freq.endswith("MIN") or - freq.endswith("D") or freq.endswith("B") or freq.endswith("U") or - freq.endswith("S")): - return 0 - elif freq.endswith(("W", "M", "MS")): + if freq.endswith("MS"): return 1 - elif freq.endswith("Y") or freq.endswith("Q") or freq.endswith("A"): + elif freq.endswith(("H", "T", "MIN", "D", "B", "U", "S")): + return 0 + elif freq.endswith(("W", "M")): + return 1 + elif freq.endswith(("Y", "Q", "A")): return 2 else: raise ValueError(f"Invalid frequency: {freq}")