Rename get_seasonality to get_seasonality_for_frequency - #3305
Open
kashif wants to merge 6 commits into
Open
Conversation
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
previously approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_seasonalityis kept as a deprecated alias that emits aDeprecationWarningand delegates to the new function. Existing code continues to work unchanged.Fixes #3278