Skip to content

Rename get_seasonality to get_seasonality_for_frequency - #3305

Open
kashif wants to merge 6 commits into
awslabs:devfrom
kashif:fix-issue-3278
Open

Rename get_seasonality to get_seasonality_for_frequency#3305
kashif wants to merge 6 commits into
awslabs:devfrom
kashif:fix-issue-3278

Conversation

@kashif

@kashif kashif commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What changed

Renamed get_seasonality(freq)get_seasonality_for_frequency(freq) to match what the function actually does.

The old name made it sound like the function detects or estimates seasonality from data — it doesn't. It just looks up a hard-coded calendar convention from a dict based on the pandas frequency string (e.g. "H" → 24, "M" → 12).

Why it matters

The returned value flows into seasonal naïve baselines, MASE scaling, and evaluation pipelines. When the function is called get_seasonality, it's easy to assume some form of data-driven inference is happening under the hood, which can lead to silent misuse.

Backward compat

get_seasonality is kept as a deprecated alias that emits a DeprecationWarning and delegates to the new function. Existing code continues to work unchanged.

Fixes #3278

kashif added 2 commits June 18, 2026 19:03
The old name implied that the function detects or estimates seasonality
from data. In reality it returns a hard-coded calendar convention based
on the pandas frequency string.

- Add get_seasonality_for_frequency as the new canonical function with
  an explicit docstring clarifying it does not inspect any data
- Keep get_seasonality as a deprecated alias emitting DeprecationWarning
- Update __init__.py to export the new function
- Add tests for the new function and the deprecation warning
lostella
lostella previously approved these changes Jul 21, 2026
@lostella lostella added the enhancement New feature or request label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading function name: get_seasonality(freq) does not estimate or detect seasonality

2 participants