Skip to content

Commit

Permalink
chore: move frequency_mapping to settings & add mapping for period pe…
Browse files Browse the repository at this point in the history
…r year
  • Loading branch information
chilango74 committed Jul 30, 2024
1 parent 918d0ca commit 6a16e38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions okama/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@

_MONTHS_PER_YEAR = 12
PeriodLength = namedtuple("PeriodLength", "years months")

# From Pandas resamples alias: https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
frequency_mapping = {"none": "none", "year": "Y", "half-year": "2Q", "quarter": "Q", "month": "M"}
frequency_periods_per_year = {"none": 0, "year": 1, "half-year": 2, "quarter": 4, "month": 12}

0 comments on commit 6a16e38

Please sign in to comment.