@@ -1794,6 +1794,8 @@ def _check_binary_with_scalars(func_data, x1x2):
1794
1794
# xp_func, name, refimpl, kwargs
1795
1795
[
1796
1796
(xp .atan2 , "atan2" , math .atan2 , {}),
1797
+ (xp .copysign , "copysign" , math .copysign , {}),
1798
+ (xp .divide , "divide" , operator .truediv , {"filter_" : lambda s : s != 0 }),
1797
1799
(xp .hypot , "hypot" , math .hypot , {}),
1798
1800
(xp .logaddexp , "logaddexp" , logaddexp_refimpl , {}),
1799
1801
(xp .maximum , "maximum" , max , {'strict_check' : True }),
@@ -1813,9 +1815,33 @@ def test_binary_with_scalars_real(func_data, x1x2):
1813
1815
(xp .logical_and , "logical_and" , operator .and_ , {"expr_template" : "({} or {})={}" }),
1814
1816
(xp .logical_or , "logical_or" , operator .or_ , {"expr_template" : "({} or {})={}" }),
1815
1817
(xp .logical_xor , "logical_xor" , operator .xor , {"expr_template" : "({} or {})={}" }),
1818
+ (xp .equal , "equal" , operator .eq , {}),
1819
+ (xp .not_equal , "neq" , operator .ne , {}),
1820
+ (xp .less , "less" , operator .lt , {}),
1821
+ (xp .less_equal , "les_equal" , operator .le , {}),
1822
+ (xp .greater , "greater" , operator .gt , {}),
1823
+ (xp .greater_equal , "greater_equal" , operator .ge , {}),
1816
1824
],
1817
1825
ids = lambda func_data : func_data [1 ] # use names for test IDs
1818
1826
)
1819
1827
@given (x1x2 = hh .array_and_py_scalar ([xp .bool ]))
1820
1828
def test_binary_with_scalars_bool (func_data , x1x2 ):
1821
1829
_check_binary_with_scalars (func_data , x1x2 )
1830
+
1831
+
1832
+
1833
+ @pytest .mark .min_version ("2024.12" )
1834
+ @pytest .mark .parametrize ('func_data' ,
1835
+ # xp_func, name, refimpl, kwargs
1836
+ [
1837
+ (xp .add , "add" , operator .add , {}),
1838
+ (xp .subtract , "sub" , operator .sub , {}),
1839
+ (xp .multiply , "mul" , operator .mul , {}),
1840
+ # divide is in the "real" listing to avoid int/int -> float
1841
+ ],
1842
+ ids = lambda func_data : func_data [1 ] # use names for test IDs
1843
+ )
1844
+ @given (x1x2 = hh .array_and_py_scalar (dh .numeric_dtypes ))
1845
+ def test_binary_with_scalars_numeric (func_data , x1x2 ):
1846
+ _check_binary_with_scalars (func_data , x1x2 )
1847
+
0 commit comments