@@ -887,7 +887,7 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
887887 np .conj : "conj" ,
888888 np .real : "real" ,
889889 np .imag : "imag" ,
890- np .bitwise_not : "~" ,
890+ np .bitwise_invert : "~" ,
891891 np .isnan : "isnan" ,
892892 np .isfinite : "isfinite" ,
893893 np .isinf : "isinf" ,
@@ -2429,6 +2429,12 @@ def __matmul__(self, other):
24292429 def __xor__ (self , other ):
24302430 return bitwise_xor (self , other )
24312431
2432+ def __or__ (self , other ):
2433+ return bitwise_or (self , other )
2434+
2435+ def __invert__ (self ):
2436+ return bitwise_invert (self )
2437+
24322438
24332439def array_from_ffi_ptr (array_ptr ) -> NDArray :
24342440 """
@@ -3547,6 +3553,9 @@ def pow(
35473553 x1: NDArray | NDField | blosc2.C2Array | blosc2.LazyExpr
35483554 First input array. May have any data type.
35493555
3556+ x2:NDArray | NDField | blosc2.C2Array | blosc2.LazyExpr
3557+ Second input array. Must be compatible with x1. May have any data type.
3558+
35503559 Returns
35513560 -------
35523561 out LazyExpr
@@ -3572,6 +3581,9 @@ def bitwise_xor(
35723581 x1: NDArray | NDField | blosc2.C2Array | blosc2.LazyExpr
35733582 First input array. May have any data type.
35743583
3584+ x2:NDArray | NDField | blosc2.C2Array | blosc2.LazyExpr
3585+ Second input array. Must be compatible with x1. May have any data type.
3586+
35753587 Returns
35763588 -------
35773589 out LazyExpr
@@ -3584,6 +3596,57 @@ def bitwise_xor(
35843596 return x1 ^ x2
35853597
35863598
3599+ def bitwise_or (
3600+ x1 : NDArray | NDField | blosc2 .C2Array | blosc2 .LazyExpr | int | float | complex ,
3601+ x2 : NDArray | NDField | blosc2 .C2Array | blosc2 .LazyExpr | int | float | complex ,
3602+ ) -> blosc2 .LazyExpr :
3603+ """
3604+ Computes the value of x1_i | x2_i for each element x1_i of the input array x1 and x2_i
3605+ of x2.
3606+
3607+ Parameters
3608+ -----------
3609+ x1: NDArray | NDField | blosc2.C2Array | blosc2.LazyExpr
3610+ First input array. May have any data type.
3611+
3612+ x2: NDArray | NDField | blosc2.C2Array | blosc2.LazyExpr
3613+ Second input array. Must be compatible with x1. May have any data type.
3614+
3615+ Returns
3616+ -------
3617+ out LazyExpr
3618+ A LazyArray containing the element-wise results.
3619+
3620+ References
3621+ ----------
3622+ `np.bitwise_or <https://numpy.org/doc/stable/reference/generated/numpy.bitwise_or.html#numpy.bitwise_or>`_
3623+ """
3624+ return x1 | x2
3625+
3626+
3627+ def bitwise_invert (
3628+ x1 : NDArray | NDField | blosc2 .C2Array | blosc2 .LazyExpr | int | float | complex ,
3629+ ) -> blosc2 .LazyExpr :
3630+ """
3631+ Computes the value of ~x1_i for each element x1_i of the input array x1.
3632+
3633+ Parameters
3634+ -----------
3635+ x1: NDArray | NDField | blosc2.C2Array | blosc2.LazyExpr
3636+ First input array. May have any data type.
3637+
3638+ Returns
3639+ -------
3640+ out LazyExpr
3641+ A LazyArray containing the element-wise results.
3642+
3643+ References
3644+ ----------
3645+ `np.bitwise_invert <https://numpy.org/doc/stable/reference/generated/numpy.bitwise_invert.html#numpy.bitwise_invert>`_
3646+ """
3647+ return ~ x1
3648+
3649+
35873650def where (
35883651 condition : blosc2 .LazyExpr | NDArray ,
35893652 x : NDArray | NDField | np .ndarray | int | float | complex | bool | str | bytes | None = None ,
0 commit comments