class documentation

class TestTypes: (source)

View In Hierarchy

Undocumented

Method check_promotion_cases Undocumented
Method test_can_cast Undocumented
Method test_can_cast_and_promote_usertypes Undocumented
Method test_can_cast_simple_to_structured Undocumented
Method test_can_cast_structured_to_simple Undocumented
Method test_can_cast_values Undocumented
Method test_coercion Undocumented
Method test_invalid_void_promotion Undocumented
Method test_promote_identical_types_metadata Undocumented
Method test_promote_types_endian Undocumented
Method test_promote_types_metadata Metadata handling in promotion does not appear formalized right now in NumPy. This test should thus be considered to document behaviour, rather than test the correct definition of it.
Method test_promote_types_strings Undocumented
Method test_result_type Undocumented
Method test_valid_void_promotion Undocumented
def check_promotion_cases(self, promote_func): (source)

Undocumented

def test_can_cast(self): (source)

Undocumented

def test_can_cast_and_promote_usertypes(self): (source)

Undocumented

def test_can_cast_simple_to_structured(self): (source)

Undocumented

def test_can_cast_structured_to_simple(self): (source)

Undocumented

def test_can_cast_values(self): (source)

Undocumented

def test_coercion(self): (source)

Undocumented

@pytest.mark.parametrize(['dtype1', 'dtype2'], [[np.dtype('V6'), np.dtype('V10')], [np.dtype([('name1', 'i8')]), np.dtype([('name2', 'i8')])]])
def test_invalid_void_promotion(self, dtype1, dtype2): (source)

Undocumented

@pytest.mark.parametrize('dtype', list(np.typecodes['All'])+['i,i', '10i', 'S3', 'S100', 'U3', 'U100', rational])
def test_promote_identical_types_metadata(self, dtype): (source)

Undocumented

def test_promote_types_endian(self): (source)

Undocumented

@pytest.mark.slow
@pytest.mark.filterwarnings('ignore:Promotion of numbers:FutureWarning')
@pytest.mark.parametrize(['dtype1', 'dtype2'], itertools.product(list(np.typecodes['All'])+['i,i', 'S3', 'S100', 'U3', 'U100', rational], repeat=2))
def test_promote_types_metadata(self, dtype1, dtype2): (source)

Metadata handling in promotion does not appear formalized right now in NumPy. This test should thus be considered to document behaviour, rather than test the correct definition of it.

This test is very ugly, it was useful for rewriting part of the promotion, but probably should eventually be replaced/deleted (i.e. when metadata handling in promotion is better defined).

@pytest.mark.parametrize('swap', ['', 'swap'])
@pytest.mark.parametrize('string_dtype', ['U', 'S'])
def test_promote_types_strings(self, swap, string_dtype): (source)

Undocumented

def test_result_type(self): (source)

Undocumented

@pytest.mark.parametrize(['dtype1', 'dtype2'], [[np.dtype('V10'), np.dtype('V10')], [np.dtype([('name1', 'i8')]), np.dtype([('name1', np.dtype('i8').newbyteorder())])], [np.dtype('i8,i8'), np.dtype('i8,>i8')], [np.dtype('i8,i8'), np.dtype('i4,i4')]])
def test_valid_void_promotion(self, dtype1, dtype2): (source)

Undocumented