@@ -1829,7 +1829,8 @@ def chunked_eval( # noqa: C901
18291829 operands: dict
18301830 A dictionary containing the operands for the expression.
18311831 item: int, slice or sequence of slices, optional
1832- The slice(s) to be retrieved. Note that step parameter is not honored yet.
1832+ The slice(s) of the operands to be used in computation. Note that step parameter is not honored yet.
1833+ Item is used to slice the operands PRIOR to computation.
18331834 kwargs: Any, optional
18341835 Additional keyword arguments supported by the :func:`empty` constructor. In addition,
18351836 the following keyword arguments are supported:
@@ -2688,6 +2689,21 @@ def sort(self, order: str | list[str] | None = None) -> blosc2.LazyArray:
26882689 return lazy_expr
26892690
26902691 def compute (self , item = None , ** kwargs ) -> blosc2 .NDArray :
2692+ """
2693+ Compute the expression with the given item and kwargs.
2694+ Parameters
2695+ ----------
2696+ item: int, slice or sequence of slices, optional
2697+ The slice(s) of the operands to be used in computation. Note that step parameter is not honored yet.
2698+ Item is used to slice the operands PRIOR to computation.
2699+ kwargs
2700+
2701+ Returns:
2702+ blosc2.NDArray or numpy.ndarray
2703+ -------
2704+
2705+ """
2706+
26912707 # When NumPy ufuncs are called, the user may add an `out` parameter to kwargs
26922708 if "out" in kwargs :
26932709 kwargs ["_output" ] = kwargs .pop ("out" )
@@ -2722,6 +2738,17 @@ def compute(self, item=None, **kwargs) -> blosc2.NDArray:
27222738 return result
27232739
27242740 def __getitem__ (self , item ):
2741+ """
2742+ Apply LazyExpr on a slice of the oeprands.
2743+ Parameters
2744+ ----------
2745+ item: int, slice or sequence of slices, optional
2746+ The slice(s) of the operands to be used in computation. Note that step parameter is not honored yet.
2747+ Item is used to slice the operands PRIOR to computation.
2748+ Returns:
2749+ numpy.ndarray
2750+ """
2751+
27252752 kwargs = {"_getitem" : True }
27262753 return self .compute (item , ** kwargs )
27272754
0 commit comments