63
63
from larray .util .options import _OPTIONS , DISPLAY_MAXLINES , DISPLAY_EDGEITEMS , DISPLAY_WIDTH , DISPLAY_PRECISION
64
64
65
65
66
- def all (values , axis = None ):
66
+ def all (values , axis = None ) -> 'Array' :
67
67
r"""
68
68
Test whether all array elements along a given axis evaluate to True.
69
69
@@ -77,7 +77,7 @@ def all(values, axis=None):
77
77
return builtins .all (values )
78
78
79
79
80
- def any (values , axis = None ):
80
+ def any (values , axis = None ) -> 'Array' :
81
81
r"""
82
82
Test whether any array elements along a given axis evaluate to True.
83
83
@@ -92,7 +92,7 @@ def any(values, axis=None):
92
92
93
93
94
94
# commutative modulo float precision errors
95
- def sum (array , * args , ** kwargs ):
95
+ def sum (array , * args , ** kwargs ) -> 'Array' :
96
96
r"""
97
97
Sum of array elements.
98
98
@@ -110,7 +110,7 @@ def sum(array, *args, **kwargs):
110
110
return builtins .sum (array , * args , ** kwargs )
111
111
112
112
113
- def prod (array , * args , ** kwargs ):
113
+ def prod (array , * args , ** kwargs ) -> 'Array' :
114
114
r"""
115
115
Product of array elements.
116
116
@@ -121,7 +121,7 @@ def prod(array, *args, **kwargs):
121
121
return array .prod (* args , ** kwargs )
122
122
123
123
124
- def cumsum (array , * args , ** kwargs ):
124
+ def cumsum (array , * args , ** kwargs ) -> 'Array' :
125
125
r"""
126
126
Returns the cumulative sum of array elements.
127
127
@@ -132,7 +132,7 @@ def cumsum(array, *args, **kwargs):
132
132
return array .cumsum (* args , ** kwargs )
133
133
134
134
135
- def cumprod (array , * args , ** kwargs ):
135
+ def cumprod (array , * args , ** kwargs ) -> 'Array' :
136
136
r"""
137
137
Returns the cumulative product of array elements.
138
138
@@ -143,7 +143,7 @@ def cumprod(array, *args, **kwargs):
143
143
return array .cumprod (* args , ** kwargs )
144
144
145
145
146
- def min (array , * args , ** kwargs ):
146
+ def min (array , * args , ** kwargs ) -> 'Array' :
147
147
r"""
148
148
Minimum of array elements.
149
149
@@ -157,7 +157,7 @@ def min(array, *args, **kwargs):
157
157
return builtins .min (array , * args , ** kwargs )
158
158
159
159
160
- def max (array , * args , ** kwargs ):
160
+ def max (array , * args , ** kwargs ) -> 'Array' :
161
161
r"""
162
162
Maximum of array elements.
163
163
@@ -171,7 +171,7 @@ def max(array, *args, **kwargs):
171
171
return builtins .max (array , * args , ** kwargs )
172
172
173
173
174
- def mean (array , * args , ** kwargs ):
174
+ def mean (array , * args , ** kwargs ) -> 'Array' :
175
175
r"""
176
176
Computes the arithmetic mean.
177
177
@@ -182,7 +182,7 @@ def mean(array, *args, **kwargs):
182
182
return array .mean (* args , ** kwargs )
183
183
184
184
185
- def median (array , * args , ** kwargs ):
185
+ def median (array , * args , ** kwargs ) -> 'Array' :
186
186
r"""
187
187
Computes the median.
188
188
@@ -193,7 +193,7 @@ def median(array, *args, **kwargs):
193
193
return array .median (* args , ** kwargs )
194
194
195
195
196
- def percentile (array , * args , ** kwargs ):
196
+ def percentile (array , * args , ** kwargs ) -> 'Array' :
197
197
r"""
198
198
Computes the qth percentile of the data along the specified axis.
199
199
@@ -205,7 +205,7 @@ def percentile(array, *args, **kwargs):
205
205
206
206
207
207
# not commutative
208
- def ptp (array , * args , ** kwargs ):
208
+ def ptp (array , * args , ** kwargs ) -> 'Array' :
209
209
r"""
210
210
Returns the range of values (maximum - minimum).
211
211
@@ -216,7 +216,7 @@ def ptp(array, *args, **kwargs):
216
216
return array .ptp (* args , ** kwargs )
217
217
218
218
219
- def var (array , * args , ** kwargs ):
219
+ def var (array , * args , ** kwargs ) -> 'Array' :
220
220
r"""
221
221
Computes the variance.
222
222
@@ -227,7 +227,7 @@ def var(array, *args, **kwargs):
227
227
return array .var (* args , ** kwargs )
228
228
229
229
230
- def std (array , * args , ** kwargs ):
230
+ def std (array , * args , ** kwargs ) -> 'Array' :
231
231
r"""
232
232
Computes the standard deviation.
233
233
@@ -3978,7 +3978,7 @@ def wrapper(self, *args, **kwargs):
3978
3978
return decorated
3979
3979
3980
3980
@_decorate_agg_method (np .all , commutative = True , long_name = "AND reduction" )
3981
- def all (self , * args , ** kwargs ):
3981
+ def all (self , * args , ** kwargs ) -> 'Array' :
3982
3982
r"""{signature}
3983
3983
3984
3984
Test whether all selected elements evaluate to True.
@@ -4049,7 +4049,7 @@ def all(self, *args, **kwargs):
4049
4049
pass
4050
4050
4051
4051
@_decorate_agg_method (np .all , commutative = True , by_agg = True , long_name = "AND reduction" )
4052
- def all_by (self , * args , ** kwargs ):
4052
+ def all_by (self , * args , ** kwargs ) -> 'Array' :
4053
4053
r"""{signature}
4054
4054
4055
4055
Test whether all selected elements evaluate to True.
@@ -4117,7 +4117,7 @@ def all_by(self, *args, **kwargs):
4117
4117
pass
4118
4118
4119
4119
@_decorate_agg_method (np .any , commutative = True , long_name = "OR reduction" )
4120
- def any (self , * args , ** kwargs ):
4120
+ def any (self , * args , ** kwargs ) -> 'Array' :
4121
4121
r"""{signature}
4122
4122
4123
4123
Test whether any selected elements evaluate to True.
@@ -4188,7 +4188,7 @@ def any(self, *args, **kwargs):
4188
4188
pass
4189
4189
4190
4190
@_decorate_agg_method (np .any , commutative = True , by_agg = True , long_name = "OR reduction" )
4191
- def any_by (self , * args , ** kwargs ):
4191
+ def any_by (self , * args , ** kwargs ) -> 'Array' :
4192
4192
r"""{signature}
4193
4193
4194
4194
Test whether any selected elements evaluate to True.
@@ -4258,7 +4258,7 @@ def any_by(self, *args, **kwargs):
4258
4258
# commutative modulo float precision errors
4259
4259
4260
4260
@_decorate_agg_method (np .sum , np .nansum , commutative = True , extra_kwargs = ['dtype' ])
4261
- def sum (self , * args , ** kwargs ):
4261
+ def sum (self , * args , ** kwargs ) -> 'Array' :
4262
4262
r"""{signature}
4263
4263
4264
4264
Computes the sum of array elements along given axes/groups.
@@ -4323,7 +4323,7 @@ def sum(self, *args, **kwargs):
4323
4323
pass
4324
4324
4325
4325
@_decorate_agg_method (np .sum , np .nansum , commutative = True , by_agg = True , extra_kwargs = ['dtype' ], long_name = "sum" )
4326
- def sum_by (self , * args , ** kwargs ):
4326
+ def sum_by (self , * args , ** kwargs ) -> 'Array' :
4327
4327
r"""{signature}
4328
4328
4329
4329
Computes the sum of array elements for the given axes/groups.
@@ -4386,7 +4386,7 @@ def sum_by(self, *args, **kwargs):
4386
4386
4387
4387
# nanprod needs numpy 1.10
4388
4388
@_decorate_agg_method (np .prod , np_nanprod , commutative = True , extra_kwargs = ['dtype' ], long_name = "product" )
4389
- def prod (self , * args , ** kwargs ):
4389
+ def prod (self , * args , ** kwargs ) -> 'Array' :
4390
4390
r"""{signature}
4391
4391
4392
4392
Computes the product of array elements along given axes/groups.
@@ -4452,7 +4452,7 @@ def prod(self, *args, **kwargs):
4452
4452
4453
4453
@_decorate_agg_method (np .prod , np_nanprod , commutative = True , by_agg = True , extra_kwargs = ['dtype' ],
4454
4454
long_name = "product" )
4455
- def prod_by (self , * args , ** kwargs ):
4455
+ def prod_by (self , * args , ** kwargs ) -> 'Array' :
4456
4456
r"""{signature}
4457
4457
4458
4458
Computes the product of array elements for the given axes/groups.
@@ -4514,7 +4514,7 @@ def prod_by(self, *args, **kwargs):
4514
4514
pass
4515
4515
4516
4516
@_decorate_agg_method (np .min , np .nanmin , commutative = True , long_name = "minimum" , action_verb = "search" )
4517
- def min (self , * args , ** kwargs ):
4517
+ def min (self , * args , ** kwargs ) -> 'Array' :
4518
4518
r"""{signature}
4519
4519
4520
4520
Get minimum of array elements along given axes/groups.
@@ -4578,7 +4578,7 @@ def min(self, *args, **kwargs):
4578
4578
pass
4579
4579
4580
4580
@_decorate_agg_method (np .min , np .nanmin , commutative = True , by_agg = True , long_name = "minimum" , action_verb = "search" )
4581
- def min_by (self , * args , ** kwargs ):
4581
+ def min_by (self , * args , ** kwargs ) -> 'Array' :
4582
4582
r"""{signature}
4583
4583
4584
4584
Get minimum of array elements for the given axes/groups.
@@ -4639,7 +4639,7 @@ def min_by(self, *args, **kwargs):
4639
4639
pass
4640
4640
4641
4641
@_decorate_agg_method (np .max , np .nanmax , commutative = True , long_name = "maximum" , action_verb = "search" )
4642
- def max (self , * args , ** kwargs ):
4642
+ def max (self , * args , ** kwargs ) -> 'Array' :
4643
4643
r"""{signature}
4644
4644
4645
4645
Get maximum of array elements along given axes/groups.
@@ -4703,7 +4703,7 @@ def max(self, *args, **kwargs):
4703
4703
pass
4704
4704
4705
4705
@_decorate_agg_method (np .max , np .nanmax , commutative = True , by_agg = True , long_name = "maximum" , action_verb = "search" )
4706
- def max_by (self , * args , ** kwargs ):
4706
+ def max_by (self , * args , ** kwargs ) -> 'Array' :
4707
4707
r"""{signature}
4708
4708
4709
4709
Get maximum of array elements for the given axes/groups.
@@ -4764,7 +4764,7 @@ def max_by(self, *args, **kwargs):
4764
4764
pass
4765
4765
4766
4766
@_decorate_agg_method (np .mean , np .nanmean , commutative = True , extra_kwargs = ['dtype' ])
4767
- def mean (self , * args , ** kwargs ):
4767
+ def mean (self , * args , ** kwargs ) -> 'Array' :
4768
4768
r"""{signature}
4769
4769
4770
4770
Computes the arithmetic mean.
@@ -4830,7 +4830,7 @@ def mean(self, *args, **kwargs):
4830
4830
pass
4831
4831
4832
4832
@_decorate_agg_method (np .mean , np .nanmean , commutative = True , by_agg = True , extra_kwargs = ['dtype' ], long_name = "mean" )
4833
- def mean_by (self , * args , ** kwargs ):
4833
+ def mean_by (self , * args , ** kwargs ) -> 'Array' :
4834
4834
r"""{signature}
4835
4835
4836
4836
Computes the arithmetic mean.
@@ -4893,7 +4893,7 @@ def mean_by(self, *args, **kwargs):
4893
4893
pass
4894
4894
4895
4895
@_decorate_agg_method (np .median , np .nanmedian , commutative = True )
4896
- def median (self , * args , ** kwargs ):
4896
+ def median (self , * args , ** kwargs ) -> 'Array' :
4897
4897
r"""{signature}
4898
4898
4899
4899
Computes the arithmetic median.
@@ -4963,7 +4963,7 @@ def median(self, *args, **kwargs):
4963
4963
pass
4964
4964
4965
4965
@_decorate_agg_method (np .median , np .nanmedian , commutative = True , by_agg = True , long_name = "mediane" )
4966
- def median_by (self , * args , ** kwargs ):
4966
+ def median_by (self , * args , ** kwargs ) -> 'Array' :
4967
4967
r"""{signature}
4968
4968
4969
4969
Computes the arithmetic median.
@@ -5034,7 +5034,7 @@ def median_by(self, *args, **kwargs):
5034
5034
# since in this case np.percentile() may be called several times.
5035
5035
# percentile needs an explicit method because it has not the same
5036
5036
# signature as other aggregate functions (extra argument)
5037
- def percentile (self , q , * args , ** kwargs ):
5037
+ def percentile (self , q , * args , ** kwargs ) -> 'Array' :
5038
5038
r"""{signature}
5039
5039
5040
5040
Computes the qth percentile of the data along the specified axis.
@@ -5122,7 +5122,7 @@ def percentile(self, q, *args, **kwargs):
5122
5122
_doc_agg_method (percentile , False , "qth percentile" , extra_args = ['q' ],
5123
5123
kwargs = ['out' , 'interpolation' , 'skipna' , 'keepaxes' ])
5124
5124
5125
- def percentile_by (self , q , * args , ** kwargs ):
5125
+ def percentile_by (self , q , * args , ** kwargs ) -> 'Array' :
5126
5126
r"""{signature}
5127
5127
5128
5128
Computes the qth percentile of the data for the specified axis.
@@ -5208,7 +5208,7 @@ def percentile_by(self, q, *args, **kwargs):
5208
5208
5209
5209
# not commutative
5210
5210
5211
- def ptp (self , * args , ** kwargs ):
5211
+ def ptp (self , * args , ** kwargs ) -> 'Array' :
5212
5212
r"""{signature}
5213
5213
5214
5214
Returns the range of values (maximum - minimum).
@@ -5273,7 +5273,7 @@ def ptp(self, *args, **kwargs):
5273
5273
_doc_agg_method (ptp , False , kwargs = ['out' ])
5274
5274
5275
5275
@_decorate_agg_method (np .var , np .nanvar , extra_kwargs = ['dtype' , 'ddof' ], long_name = "variance" )
5276
- def var (self , * args , ** kwargs ):
5276
+ def var (self , * args , ** kwargs ) -> 'Array' :
5277
5277
r"""{signature}
5278
5278
5279
5279
Computes the unbiased variance.
@@ -5337,7 +5337,7 @@ def var(self, *args, **kwargs):
5337
5337
pass
5338
5338
5339
5339
@_decorate_agg_method (np .var , np .nanvar , by_agg = True , extra_kwargs = ['dtype' , 'ddof' ], long_name = "variance" )
5340
- def var_by (self , * args , ** kwargs ):
5340
+ def var_by (self , * args , ** kwargs ) -> 'Array' :
5341
5341
r"""{signature}
5342
5342
5343
5343
Computes the unbiased variance.
@@ -5401,7 +5401,7 @@ def var_by(self, *args, **kwargs):
5401
5401
pass
5402
5402
5403
5403
@_decorate_agg_method (np .std , np .nanstd , extra_kwargs = ['dtype' , 'ddof' ], long_name = "standard deviation" )
5404
- def std (self , * args , ** kwargs ):
5404
+ def std (self , * args , ** kwargs ) -> 'Array' :
5405
5405
r"""{signature}
5406
5406
5407
5407
Computes the sample standard deviation.
@@ -5466,7 +5466,7 @@ def std(self, *args, **kwargs):
5466
5466
5467
5467
@_decorate_agg_method (np .std , np .nanstd , by_agg = True , extra_kwargs = ['dtype' , 'ddof' ],
5468
5468
long_name = "standard deviation" )
5469
- def std_by (self , * args , ** kwargs ):
5469
+ def std_by (self , * args , ** kwargs ) -> 'Array' :
5470
5470
r"""{signature}
5471
5471
5472
5472
Computes the sample standard deviation.
@@ -5530,7 +5530,7 @@ def std_by(self, *args, **kwargs):
5530
5530
pass
5531
5531
5532
5532
# cumulative aggregates
5533
- def cumsum (self , axis = - 1 ):
5533
+ def cumsum (self , axis = - 1 ) -> 'Array' :
5534
5534
r"""
5535
5535
Returns the cumulative sum of array elements along an axis.
5536
5536
@@ -5578,7 +5578,7 @@ def cumsum(self, axis=-1):
5578
5578
"""
5579
5579
return self ._cum_aggregate (np .cumsum , axis )
5580
5580
5581
- def cumprod (self , axis = - 1 ):
5581
+ def cumprod (self , axis = - 1 ) -> 'Array' :
5582
5582
r"""
5583
5583
Returns the cumulative product of array elements.
5584
5584
0 commit comments