class documentation
class TestPromotion: (source)
Test cases related to more complex DType promotions. Further promotion
tests are defined in test_numeric.py
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
Method | test |
Undocumented |
@np._no_nep50_warning()
@pytest.mark.parametrize( [ 'other', 'expected', 'expected_weak'], [ ( 2**16-1, np.complex64, None), ( 2**32-1, np.complex128, np.complex64), ( np.float16( 2), np.complex64, None), ( np.float32( 2), np.complex64, None), ( np.longdouble( 2), np.complex64, np.clongdouble), ( np.longdouble( np.nextafter( 1.7e+308, 0.0)), np.complex128, np.clongdouble), ( np.longdouble( np.nextafter( 1.7e+308, np.inf)), np.clongdouble, None), ( np.complex64( 2), np.complex64, None), ( np.clongdouble( 2), np.complex64, np.clongdouble), ( np.clongdouble( np.nextafter( 1.7e+308, 0.0)*1j), np.complex128, np.clongdouble), ( np.clongdouble( np.nextafter( 1.7e+308, np.inf)), np.clongdouble, None)])
def test_complex_other_value_based(self, weak_promotion, other, expected, expected_weak): (source) ¶
@pytest.mark.parametrize(
def test_complex_other_value_based(self, weak_promotion, other, expected, expected_weak): (source) ¶
Undocumented
@pytest.mark.parametrize( [ 'other', 'expected'], [ ( np.bool_, np.complex128), ( np.int64, np.complex128), ( np.float16, np.complex64), ( np.float32, np.complex64), ( np.float64, np.complex128), ( np.longdouble, np.clongdouble), ( np.complex64, np.complex64), ( np.complex128, np.complex128), ( np.clongdouble, np.clongdouble)])
def test_complex_scalar_value_based(self, other, expected): (source) ¶
def test_complex_scalar_value_based(self, other, expected): (source) ¶
Undocumented
@pytest.mark.parametrize( [ 'other', 'expected'], [ ( 1, rational), ( 1.0, np.float64)])
@np._no_nep50_warning()
def test_float_int_pyscalar_promote_rational(self, weak_promotion, other, expected): (source) ¶
@np._no_nep50_warning()
def test_float_int_pyscalar_promote_rational(self, weak_promotion, other, expected): (source) ¶
Undocumented
@pytest.mark.parametrize( [ 'dtypes', 'expected'], [ ( [ np.uint16, np.int16, np.float16], np.float32), ( [ np.uint16, np.int8, np.float16], np.float32), ( [ np.uint8, np.int16, np.float16], np.float32), ( [ 1, 1, np.float64], np.float64), ( [ 1, 1.0, np.complex128], np.complex128), ( [ 1, 1j, np.float64], np.complex128), ( [ 1.0, 1.0, np.int64], np.float64), ( [ 1.0, 1j, np.float64], np.complex128), ( [ 1j, 1j, np.float64], np.complex128), ( [ 1, True, np.bool_], np.int_)])
def test_permutations_do_not_influence_result(self, dtypes, expected): (source) ¶
def test_permutations_do_not_influence_result(self, dtypes, expected): (source) ¶
Undocumented