Fix incorrect return type annotations in darts.utils.statistics - #3185
Open
AlejandroCoronadoN wants to merge 2 commits into
Open
Fix incorrect return type annotations in darts.utils.statistics#3185AlejandroCoronadoN wants to merge 2 commits into
AlejandroCoronadoN wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3185 +/- ##
==========================================
- Coverage 97.04% 96.98% -0.07%
==========================================
Files 165 165
Lines 17976 17976
==========================================
- Hits 17445 17434 -11
- Misses 531 542 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AlejandroCoronadoN
force-pushed
the
fix-statistics-return-annotations
branch
from
August 21, 2026 12:40
c77c729 to
6c1b008
Compare
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.
Three functions in
darts/utils/statistics.pyhave return type annotations that do not match what they actually return:stationarity_test_kpssis annotated-> setbut returns atuple(it wrapsstatsmodels.tsa.stattools.kpss).stationarity_test_adfis annotated-> setbut returns atuple(it wrapsadfuller).granger_causality_testsis annotated-> Nonebut returns adict(it wrapsgrangercausalitytests); its own docstring already says it returns aDict.The docstrings and the existing tests already treat these as tuples/dict (for example
stationarity_test_kpss(series)[1]), so the annotations are just wrong and mislead type checkers and IDEs. This fixes the annotations to match the real return values and adds a small regression test.