@@ -822,7 +822,7 @@ def __getitem__(self, subset) -> Union["DelayedArray", ndarray]:
822822
823823
824824 # For python-level compute.
825- def sum (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : int = 1e8 ) -> numpy .ndarray :
825+ def sum (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : Optional [ int ] = None ) -> numpy .ndarray :
826826 """
827827 Take the sum of values across the ``DelayedArray``, possibly over a
828828 given axis or set of axes. If the seed has a ``sum()`` method, that
@@ -840,8 +840,9 @@ def sum(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optiona
840840 :py:func:`~numpy.sum` for details.
841841
842842 buffer_size:
843- Buffer size in bytes to use for block processing. Larger values
844- generally improve speed at the cost of memory.
843+ Buffer size in bytes to use for block processing.
844+ Larger values generally improve speed at the cost of memory.
845+ If ``None``, defaults to the value returned by :py:func:`~delayedarray.default_buffer_size.default_buffer_size`.
845846
846847 Returns:
847848 A NumPy array containing the sums. If ``axis = None``, this will be
@@ -859,7 +860,7 @@ def sum(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optiona
859860 )
860861
861862
862- def mean (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : int = 1e8 ) -> numpy .ndarray :
863+ def mean (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : Optional [ int ] = None ) -> numpy .ndarray :
863864 """
864865 Take the mean of values across the ``DelayedArray``, possibly over a
865866 given axis or set of axes. If the seed has a ``mean()`` method, that
@@ -877,8 +878,9 @@ def mean(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Option
877878 :py:func:`~numpy.mean` for details.
878879
879880 buffer_size:
880- Buffer size in bytes to use for block processing. Larger values
881- generally improve speed at the cost of memory.
881+ Buffer size in bytes to use for block processing.
882+ Larger values generally improve speed at the cost of memory.
883+ If ``None``, defaults to the value returned by :py:func:`~delayedarray.default_buffer_size.default_buffer_size`.
882884
883885 Returns:
884886 A NumPy array containing the means. If ``axis = None``, this will
@@ -896,7 +898,7 @@ def mean(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Option
896898 )
897899
898900
899- def var (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , ddof : int = 0 , buffer_size : int = 1e8 ) -> numpy .ndarray :
901+ def var (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , ddof : int = 0 , buffer_size : Optional [ int ] = None ) -> numpy .ndarray :
900902 """
901903 Take the variances of values across the ``DelayedArray``, possibly over
902904 a given axis or set of axes. If the seed has a ``var()`` method, that
@@ -918,8 +920,9 @@ def var(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optiona
918920 Typically set to 1 to obtain the sample variance.
919921
920922 buffer_size:
921- Buffer size in bytes to use for block processing. Larger values
922- generally improve speed at the cost of memory.
923+ Buffer size in bytes to use for block processing.
924+ Larger values generally improve speed at the cost of memory.
925+ If ``None``, defaults to the value returned by :py:func:`~delayedarray.default_buffer_size.default_buffer_size`.
923926
924927 Returns:
925928 A NumPy array containing the variances. If ``axis = None``,
@@ -937,7 +940,7 @@ def var(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optiona
937940 masked = is_masked (self ),
938941 )
939942
940- def any (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : int = 1e8 ) -> numpy .ndarray :
943+ def any (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : Optional [ int ] = None ) -> numpy .ndarray :
941944 """Test whether any array element along a given axis evaluates to True.
942945
943946 Compute this test across the ``DelayedArray``, possibly over a
@@ -956,8 +959,9 @@ def any(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optiona
956959 :py:func:`~numpy.any` for details.
957960
958961 buffer_size:
959- Buffer size in bytes to use for block processing. Larger values
960- generally improve speed at the cost of memory.
962+ Buffer size in bytes to use for block processing.
963+ Larger values generally improve speed at the cost of memory.
964+ If ``None``, defaults to the value returned by :py:func:`~delayedarray.default_buffer_size.default_buffer_size`.
961965
962966 Returns:
963967 A NumPy array containing the boolean values. If ``axis = None``, this will
@@ -974,7 +978,7 @@ def any(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optiona
974978 masked = is_masked (self ),
975979 )
976980
977- def all (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : int = 1e8 ) -> numpy .ndarray :
981+ def all (self , axis : Optional [Union [int , Tuple [int , ...]]] = None , dtype : Optional [numpy .dtype ] = None , buffer_size : Optional [ int ] = None ) -> numpy .ndarray :
978982 """Test whether all array elements along a given axis evaluate to True.
979983
980984 Compute this test across the ``DelayedArray``, possibly over a
@@ -993,8 +997,9 @@ def all(self, axis: Optional[Union[int, Tuple[int, ...]]] = None, dtype: Optiona
993997 :py:func:`~numpy.all` for details.
994998
995999 buffer_size:
996- Buffer size in bytes to use for block processing. Larger values
997- generally improve speed at the cost of memory.
1000+ Buffer size in bytes to use for block processing.
1001+ Larger values generally improve speed at the cost of memory.
1002+ If ``None``, defaults to the value returned by :py:func:`~delayedarray.default_buffer_size.default_buffer_size`.
9981003
9991004 Returns:
10001005 A NumPy array containing the boolean values. If ``axis = None``, this will
@@ -1115,7 +1120,7 @@ def _reduce_SparseNdarray(x: SparseNdarray, multipliers: List[int], axes: List[i
11151120 return
11161121
11171122
1118- def _reduce (x : DelayedArray , axes : List [int ], operation : Callable , buffer_size : int ):
1123+ def _reduce (x : DelayedArray , axes : List [int ], operation : Callable , buffer_size : Optional [ int ] ):
11191124 multipliers = _create_offset_multipliers (x .shape , axes )
11201125 if is_sparse (x ):
11211126 apply_over_blocks (
0 commit comments