class documentation

class TestPromotion:

View In Hierarchy

Test cases related to more complex DType promotions. Further promotion tests are defined in test_numeric.py
Method test​_complex​_other​_value​_based Undocumented
Method test​_complex​_pyscalar​_promote​_rational Undocumented
Method test​_complex​_scalar​_value​_based Undocumented
Method test​_float​_int​_pyscalar​_promote​_rational Undocumented
Method test​_permutations​_do​_not​_influence​_result Undocumented
@pytest.mark.parametrize(['other', 'expected'], [(2**16-1, np.complex64), (2**32-1, np.complex128), (np.float16(2), np.complex64), (np.float32(2), np.complex64), (np.longdouble(2), np.complex64), (np.longdouble(np.nextafter(1.7e+308, 0.0)), np.complex128), (np.longdouble(np.nextafter(1.7e+308, np.inf)), np.clongdouble), (np.complex64(2), np.complex64), (np.clongdouble(2), np.complex64), (np.clongdouble(np.nextafter(1.7e+308, 0.0)*1j), np.complex128), (np.clongdouble(np.nextafter(1.7e+308, np.inf)), np.clongdouble)])
def test_complex_other_value_based(self, other, expected):

Undocumented

def test_complex_pyscalar_promote_rational(self):

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):

Undocumented

@pytest.mark.parametrize(['other', 'expected'], [(1, rational), (1.0, np.float64)])
def test_float_int_pyscalar_promote_rational(self, other, expected):

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):

Undocumented