3
3
from textwrap import dedent
4
4
from typing import (
5
5
Any , Callable , Hashable , Iterable , Iterator , List , Mapping , MutableMapping ,
6
- Optional , Tuple , TypeVar , Union )
6
+ Tuple , TypeVar , Union )
7
7
8
8
import numpy as np
9
9
import pandas as pd
@@ -101,7 +101,7 @@ def __int__(self: Any) -> int:
101
101
def __complex__ (self : Any ) -> complex :
102
102
return complex (self .values )
103
103
104
- def __array__ (self : Any , dtype : Optional [ DTypeLike ] = None ) -> np .ndarray :
104
+ def __array__ (self : Any , dtype : DTypeLike = None ) -> np .ndarray :
105
105
return np .asarray (self .values , dtype = dtype )
106
106
107
107
def __repr__ (self ) -> str :
@@ -448,7 +448,7 @@ def pipe(self, func: Union[Callable[..., T], Tuple[Callable[..., T], str]],
448
448
return func (self , * args , ** kwargs )
449
449
450
450
def groupby (self , group , squeeze : bool = True ,
451
- restore_coord_dims : Optional [ bool ] = None ):
451
+ restore_coord_dims : bool = None ):
452
452
"""Returns a GroupBy object for performing grouped operations.
453
453
454
454
Parameters
@@ -501,7 +501,7 @@ def groupby(self, group, squeeze: bool = True,
501
501
def groupby_bins (self , group , bins , right : bool = True , labels = None ,
502
502
precision : int = 3 , include_lowest : bool = False ,
503
503
squeeze : bool = True ,
504
- restore_coord_dims : Optional [ bool ] = None ):
504
+ restore_coord_dims : bool = None ):
505
505
"""Returns a GroupBy object for performing grouped operations.
506
506
507
507
Rather than using all unique values of `group`, the values are discretized
@@ -557,8 +557,8 @@ def groupby_bins(self, group, bins, right: bool = True, labels=None,
557
557
'include_lowest' :
558
558
include_lowest })
559
559
560
- def rolling (self , dim : Optional [ Mapping [Hashable , int ] ] = None ,
561
- min_periods : Optional [ int ] = None , center : bool = False ,
560
+ def rolling (self , dim : Mapping [Hashable , int ] = None ,
561
+ min_periods : int = None , center : bool = False ,
562
562
** window_kwargs : int ):
563
563
"""
564
564
Rolling window object.
@@ -621,7 +621,7 @@ def rolling(self, dim: Optional[Mapping[Hashable, int]] = None,
621
621
622
622
def rolling_exp (
623
623
self ,
624
- window : Optional [ Mapping [Hashable , int ] ] = None ,
624
+ window : Mapping [Hashable , int ] = None ,
625
625
window_type : str = 'span' ,
626
626
** window_kwargs
627
627
):
@@ -658,7 +658,7 @@ def rolling_exp(
658
658
659
659
return self ._rolling_exp_cls (self , window , window_type )
660
660
661
- def coarsen (self , dim : Optional [ Mapping [Hashable , int ] ] = None ,
661
+ def coarsen (self , dim : Mapping [Hashable , int ] = None ,
662
662
boundary : str = 'exact' ,
663
663
side : Union [str , Mapping [Hashable , str ]] = 'left' ,
664
664
coord_func : str = 'mean' ,
@@ -721,11 +721,11 @@ def coarsen(self, dim: Optional[Mapping[Hashable, int]] = None,
721
721
self , dim , boundary = boundary , side = side ,
722
722
coord_func = coord_func )
723
723
724
- def resample (self , indexer : Optional [ Mapping [Hashable , str ] ] = None ,
725
- skipna = None , closed : Optional [ str ] = None ,
726
- label : Optional [ str ] = None ,
727
- base : int = 0 , keep_attrs : Optional [ bool ] = None ,
728
- loffset = None , restore_coord_dims : Optional [ bool ] = None ,
724
+ def resample (self , indexer : Mapping [Hashable , str ] = None ,
725
+ skipna = None , closed : str = None ,
726
+ label : str = None ,
727
+ base : int = 0 , keep_attrs : bool = None ,
728
+ loffset = None , restore_coord_dims : bool = None ,
729
729
** indexer_kwargs : str ):
730
730
"""Returns a Resample object for performing resampling operations.
731
731
@@ -1003,7 +1003,7 @@ def __getitem__(self, value):
1003
1003
raise NotImplementedError
1004
1004
1005
1005
1006
- def full_like (other , fill_value , dtype : Optional [ DTypeLike ] = None ):
1006
+ def full_like (other , fill_value , dtype : DTypeLike = None ):
1007
1007
"""Return a new object with the same shape and type as a given object.
1008
1008
1009
1009
Parameters
@@ -1044,7 +1044,7 @@ def full_like(other, fill_value, dtype: Optional[DTypeLike] = None):
1044
1044
1045
1045
1046
1046
def _full_like_variable (other , fill_value ,
1047
- dtype : Optional [ DTypeLike ] = None ):
1047
+ dtype : DTypeLike = None ):
1048
1048
"""Inner function of full_like, where other must be a variable
1049
1049
"""
1050
1050
from .variable import Variable
@@ -1061,13 +1061,13 @@ def _full_like_variable(other, fill_value,
1061
1061
return Variable (dims = other .dims , data = data , attrs = other .attrs )
1062
1062
1063
1063
1064
- def zeros_like (other , dtype : Optional [ DTypeLike ] = None ):
1064
+ def zeros_like (other , dtype : DTypeLike = None ):
1065
1065
"""Shorthand for full_like(other, 0, dtype)
1066
1066
"""
1067
1067
return full_like (other , 0 , dtype )
1068
1068
1069
1069
1070
- def ones_like (other , dtype : Optional [ DTypeLike ] = None ):
1070
+ def ones_like (other , dtype : DTypeLike = None ):
1071
1071
"""Shorthand for full_like(other, 1, dtype)
1072
1072
"""
1073
1073
return full_like (other , 1 , dtype )
0 commit comments