-
Notifications
You must be signed in to change notification settings - Fork 937
Fix 2 tuple type annotations in TimeSeries #2812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- `TimeSeries.shape` was incorrectly annotated `tuple[int]`; this is changed to `tuple[int, int, int]`. - The quantiles argument in `TimeSeries.quantiles_df` was incorrectly annotated `tuple[float]`; this is changed to `tuple[float, ...]`.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2812 +/- ##
==========================================
- Coverage 95.24% 95.16% -0.08%
==========================================
Files 145 145
Lines 15130 15130
==========================================
- Hits 14410 14398 -12
- Misses 720 732 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ajyoon and thanks for this this improvement 🚀 I had one small comment, after that we can merge :)
@@ -2019,7 +2019,9 @@ def quantile_timeseries(self, quantile=0.5, **kwargs) -> Self: | |||
|
|||
return self.__class__(new_xa) | |||
|
|||
def quantiles_df(self, quantiles: tuple[float] = (0.1, 0.5, 0.9)) -> pd.DataFrame: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here I think a Optional[list[float]]
would actually make more sense. Could you adapt it?
E.g.
def quantiles_df(self, quantiles: Optional[list[float]] = None) -> pd.DataFrame:
quantiles = quantiles or [0.1, 0.5, 0.9]
return pd.concat(
[
self.quantile_timeseries(quantile).to_dataframe()
for quantile in quantiles
],
axis=1,
)
Checklist before merging this PR:
Mentioned all issues that this PR fixes or addresses.(N/A)Summary
TimeSeries.shape
was incorrectly annotatedtuple[int]
; this is changed totuple[int, int, int]
.TimeSeries.quantiles_df
was incorrectly annotatedtuple[float]
; this is changed totuple[float, ...]
.