Skip to content

Commit

Permalink
Merge pull request #213 from google-research/siriuz42-patch-1
Browse files Browse the repository at this point in the history
Update timesfm_base.py
  • Loading branch information
rajatsen91 authored Jan 11, 2025
2 parents e628f0f + 95db25b commit a3ab787
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/timesfm/timesfm_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")):
if freq.endswith("MS"):
return 1
elif freq.endswith(("H", "T", "MIN", "D", "B", "U", "S")):
return 0
elif freq.endswith(("W", "M", "MS")):
elif freq.endswith(("W", "M")):
return 1
elif freq.endswith("Y") or freq.endswith("Q") or freq.endswith("A"):
elif freq.endswith(("Y", "Q", "A")):
return 2
else:
raise ValueError(f"Invalid frequency: {freq}")
Expand Down

0 comments on commit a3ab787

Please sign in to comment.