class documentation

class TestUfunc:

View In Hierarchy

Undocumented

Method check​_identityless​_reduction Undocumented
Method compare​_matrix​_multiply​_results Undocumented
Method test​_all​_ufunc Try to check presence and results of all ufuncs.
Method test​_axes​_argument Undocumented
Method test​_axis​_argument Undocumented
Method test​_axis​_out​_of​_bounds Undocumented
Method test​_broadcast Undocumented
Method test​_can​_ignore​_signature Undocumented
Method test​_cast​_safety Basic test for the safest casts, because ufuncs inner loops can indicate a cast-safety as well (which is normally always "no").
Method test​_casting​_out​_param Undocumented
Method test​_cross1d Test with fixed-sized signature.
Method test​_cumsum Undocumented
Method test​_custom​_array​_like Undocumented
Method test​_custom​_ufunc Undocumented
Method test​_custom​_ufunc​_forced​_sig Undocumented
Method test​_endian Undocumented
Method test​_euclidean​_pdist Undocumented
Method test​_forced​_dtype​_times Undocumented
Method test​_forced​_sig Undocumented
Method test​_get​_signature Undocumented
Method test​_identityless​_reduction​_corder Undocumented
Method test​_identityless​_reduction​_forder Undocumented
Method test​_identityless​_reduction​_huge​_array Undocumented
Method test​_identityless​_reduction​_noncontig Undocumented
Method test​_identityless​_reduction​_noncontig​_unaligned Undocumented
Method test​_identityless​_reduction​_nonreorderable Undocumented
Method test​_identityless​_reduction​_otherorder Undocumented
Method test​_incontiguous​_array Undocumented
Method test​_initial​_reduction Undocumented
Method test​_inner1d Undocumented
Method test​_innerwt Undocumented
Method test​_innerwt​_empty Test generalized ufunc with zero-sized operands
Method test​_inplace​_fancy​_indexing Undocumented
Method test​_invalid​_args Undocumented
Method test​_keepdims​_argument Undocumented
Method test​_logical​_ufuncs​_mixed​_object​_signatures Undocumented
Method test​_logical​_ufuncs​_object​_signatures Undocumented
Method test​_logical​_ufuncs​_out​_cast​_check Undocumented
Method test​_logical​_ufuncs​_support​_anything Undocumented
Method test​_matrix​_multiply Undocumented
Method test​_matrix​_multiply​_umath​_empty Undocumented
Method test​_nat​_is​_nan Undocumented
Method test​_nat​_is​_not​_finite Undocumented
Method test​_nat​_is​_not​_inf Undocumented
Method test​_no​_doc​_string Undocumented
Method test_​Not​Implemented_not_returned Undocumented
Method test​_object​_array​_accumulate​_failure Undocumented
Method test​_object​_array​_accumulate​_inplace Undocumented
Method test​_object​_array​_reduceat​_failure Undocumented
Method test​_object​_array​_reduceat​_inplace Undocumented
Method test​_object​_array​_reduction Undocumented
Method test​_object​_comparison Undocumented
Method test​_object​_logical Undocumented
Method test​_operand​_flags Undocumented
Method test​_out​_broadcasts Undocumented
Method test​_output​_argument Undocumented
Method test​_partial​_signature​_mismatch Undocumented
Method test​_pickle Undocumented
Method test​_pickle​_name​_is​_qualname Undocumented
Method test​_pickle​_withstring Undocumented
Method test​_reduce​_arguments Undocumented
Method test​_reduce​_noncontig​_output Undocumented
Method test​_reduce​_output​_does​_not​_broadcast​_input Undocumented
Method test​_reduce​_output​_subclass​_ok Undocumented
Method test​_reduce​_wrong​_dimension​_output Undocumented
Method test​_reduce​_zero​_axis Undocumented
Method test​_reduceat​_and​_accumulate​_out​_shape​_mismatch Undocumented
Method test​_reduceat​_shifting​_sum Undocumented
Method test​_reducelike​_byteorder​_resolution Undocumented
Method test​_reducelike​_out​_promotes Undocumented
Method test​_reducelike​_output​_needs​_identical​_cast Undocumented
Method test​_reduction​_where​_initial​_needed Undocumented
Method test​_reduction​_with​_where Undocumented
Method test​_reduction​_with​_where​_and​_initial Undocumented
Method test​_safe​_casting Undocumented
Method test​_scalar​_equal Undocumented
Method test​_scalar​_reduction Undocumented
Method test​_signature0 Undocumented
Method test​_signature1 Undocumented
Method test​_signature10 Undocumented
Method test​_signature2 Undocumented
Method test​_signature3 Undocumented
Method test​_signature4 Undocumented
Method test​_signature5 Undocumented
Method test​_signature6 Undocumented
Method test​_signature7 Undocumented
Method test​_signature8 Undocumented
Method test​_signature9 Undocumented
Method test_signature_all_​None Undocumented
Method test​_signature​_dtype​_type Undocumented
Method test​_signature​_errors Undocumented
Method test​_signature​_failure​_extra​_parenthesis Undocumented
Method test​_signature​_failure​_mismatching​_parenthesis Undocumented
Method test​_signature​_failure​_signature​_missing​_input​_arg Undocumented
Method test​_signature​_failure​_signature​_missing​_output​_arg Undocumented
Method test​_struct​_ufunc Undocumented
Method test​_structured​_equal Undocumented
Method test​_sum Undocumented
Method test​_sum​_complex Undocumented
Method test​_sum​_initial Undocumented
Method test​_sum​_stability Undocumented
Method test​_sum​_where Undocumented
Method test​_true​_divide Undocumented
Method test​_type​_cast Undocumented
Method test​_ufunc​_custom​_out Undocumented
Method test​_use​_output​_signature​_for​_all​_arguments Undocumented
Method test​_where​_param Undocumented
Method test​_where​_param​_alloc Undocumented
Method test​_where​_param​_buffer​_output Undocumented
Method test​_where​_with​_broadcasting Undocumented
Method test​_zerosize​_reduction Undocumented
Class Variable can​_ignore Undocumented
Class Variable size​_inferred Undocumented
def check_identityless_reduction(self, a):

Undocumented

def compare_matrix_multiply_results(self, tp):

Undocumented

def test_all_ufunc(self):

Try to check presence and results of all ufuncs. The list of ufuncs comes from generate_umath.py and is as follows: ===== ==== ============= =============== ======================== done args function types notes ===== ==== ============= =============== ======================== n 1 conjugate nums + O n 1 absolute nums + O complex -> real n 1 negative nums + O n 1 sign nums + O -> int n 1 invert bool + ints + O flts raise an error n 1 degrees real + M cmplx raise an error n 1 radians real + M cmplx raise an error n 1 arccos flts + M n 1 arccosh flts + M n 1 arcsin flts + M n 1 arcsinh flts + M n 1 arctan flts + M n 1 arctanh flts + M n 1 cos flts + M n 1 sin flts + M n 1 tan flts + M n 1 cosh flts + M n 1 sinh flts + M n 1 tanh flts + M n 1 exp flts + M n 1 expm1 flts + M n 1 log flts + M n 1 log10 flts + M n 1 log1p flts + M n 1 sqrt flts + M real x < 0 raises error n 1 ceil real + M n 1 trunc real + M n 1 floor real + M n 1 fabs real + M n 1 rint flts + M n 1 isnan flts -> bool n 1 isinf flts -> bool n 1 isfinite flts -> bool n 1 signbit real -> bool n 1 modf real -> (frac, int) n 1 logical_not bool + nums + M -> bool n 2 left_shift ints + O flts raise an error n 2 right_shift ints + O flts raise an error n 2 add bool + nums + O boolean + is || n 2 subtract bool + nums + O boolean - is ^ n 2 multiply bool + nums + O boolean * is & n 2 divide nums + O n 2 floor_divide nums + O n 2 true_divide nums + O bBhH -> f, iIlLqQ -> d n 2 fmod nums + M n 2 power nums + O n 2 greater bool + nums + O -> bool n 2 greater_equal bool + nums + O -> bool n 2 less bool + nums + O -> bool n 2 less_equal bool + nums + O -> bool n 2 equal bool + nums + O -> bool n 2 not_equal bool + nums + O -> bool n 2 logical_and bool + nums + M -> bool n 2 logical_or bool + nums + M -> bool n 2 logical_xor bool + nums + M -> bool n 2 maximum bool + nums + O n 2 minimum bool + nums + O n 2 bitwise_and bool + ints + O flts raise an error n 2 bitwise_or bool + ints + O flts raise an error n 2 bitwise_xor bool + ints + O flts raise an error n 2 arctan2 real + M n 2 remainder ints + real + O n 2 hypot real + M ===== ==== ============= =============== ======================== Types other than those listed will be accepted, but they are cast to the smallest compatible type for which the function is defined. The casting rules are: bool -> int8 -> float32 ints -> double

def test_axes_argument(self):

Undocumented

def test_axis_argument(self):

Undocumented

def test_axis_out_of_bounds(self):

Undocumented

def test_broadcast(self):

Undocumented

def test_can_ignore_signature(self):

Undocumented

@pytest.mark.parametrize('ufunc', [np.add, np.sqrt])
def test_cast_safety(self, ufunc):
Basic test for the safest casts, because ufuncs inner loops can indicate a cast-safety as well (which is normally always "no").
def test_casting_out_param(self):

Undocumented

def test_cross1d(self):
Test with fixed-sized signature.
def test_cumsum(self):

Undocumented

def test_custom_array_like(self):

Undocumented

def test_custom_ufunc(self):

Undocumented

def test_custom_ufunc_forced_sig(self):

Undocumented

def test_endian(self):

Undocumented

def test_euclidean_pdist(self):

Undocumented

def test_forced_dtype_times(self):

Undocumented

def test_forced_sig(self):

Undocumented

def test_get_signature(self):

Undocumented

def test_identityless_reduction_corder(self):

Undocumented

def test_identityless_reduction_forder(self):

Undocumented

@requires_memory(6*1024**3)
def test_identityless_reduction_huge_array(self):

Undocumented

def test_identityless_reduction_noncontig(self):

Undocumented

def test_identityless_reduction_noncontig_unaligned(self):

Undocumented

def test_identityless_reduction_nonreorderable(self):

Undocumented

def test_identityless_reduction_otherorder(self):

Undocumented

def test_incontiguous_array(self):

Undocumented

def test_initial_reduction(self):

Undocumented

def test_inner1d(self):

Undocumented

def test_innerwt(self):

Undocumented

def test_innerwt_empty(self):
Test generalized ufunc with zero-sized operands
def test_inplace_fancy_indexing(self):

Undocumented

def test_invalid_args(self):

Undocumented

def test_keepdims_argument(self):

Undocumented

@pytest.mark.parametrize('ufunc', [np.logical_and, np.logical_or, np.logical_xor])
@pytest.mark.parametrize('signature', [(bool, None, object), (object, None, bool), (None, object, bool)])
def test_logical_ufuncs_mixed_object_signatures(self, ufunc, signature):

Undocumented

@pytest.mark.parametrize('ufunc', [np.logical_and, np.logical_or])
@pytest.mark.parametrize('signature', [(None, None, object), (object, None, None), (None, object, None)])
def test_logical_ufuncs_object_signatures(self, ufunc, signature):

Undocumented

@pytest.mark.parametrize('ufunc', [np.logical_and, np.logical_or, np.logical_xor])
def test_logical_ufuncs_out_cast_check(self, ufunc):

Undocumented

@pytest.mark.parametrize('ufunc', [np.logical_and, np.logical_or, np.logical_xor])
def test_logical_ufuncs_support_anything(self, ufunc):

Undocumented

def test_matrix_multiply(self):

Undocumented

def test_matrix_multiply_umath_empty(self):

Undocumented

@pytest.mark.parametrize('nat', [np.datetime64('nat'), np.timedelta64('nat')])
def test_nat_is_nan(self, nat):

Undocumented

@pytest.mark.parametrize('nat', [np.datetime64('nat'), np.timedelta64('nat')])
def test_nat_is_not_finite(self, nat):

Undocumented

@pytest.mark.parametrize('nat', [np.datetime64('nat'), np.timedelta64('nat')])
def test_nat_is_not_inf(self, nat):

Undocumented

def test_no_doc_string(self):

Undocumented

def test_NotImplemented_not_returned(self):

Undocumented

def test_object_array_accumulate_failure(self):

Undocumented

def test_object_array_accumulate_inplace(self):

Undocumented

def test_object_array_reduceat_failure(self):

Undocumented

def test_object_array_reduceat_inplace(self):

Undocumented

def test_object_array_reduction(self):

Undocumented

def test_object_comparison(self):

Undocumented

def test_object_logical(self):

Undocumented

def test_operand_flags(self):

Undocumented

def test_out_broadcasts(self):

Undocumented

def test_output_argument(self):

Undocumented

@pytest.mark.parametrize('casting', ['unsafe', 'same_kind', 'safe'])
def test_partial_signature_mismatch(self, casting):

Undocumented

def test_pickle(self):

Undocumented

def test_pickle_name_is_qualname(self):

Undocumented

def test_pickle_withstring(self):

Undocumented

def test_reduce_arguments(self):

Undocumented

def test_reduce_noncontig_output(self):

Undocumented

def test_reduce_output_does_not_broadcast_input(self):

Undocumented

def test_reduce_output_subclass_ok(self):

Undocumented

@pytest.mark.parametrize('out_shape', [(), (1), (3), (1, 1), (1, 3), (4, 3)])
@pytest.mark.parametrize('keepdims', [True, False])
@pytest.mark.parametrize('f_reduce', [np.add.reduce, np.minimum.reduce])
def test_reduce_wrong_dimension_output(self, f_reduce, keepdims, out_shape):

Undocumented

def test_reduce_zero_axis(self):

Undocumented

@pytest.mark.parametrize('with_cast', [True, False])
def test_reduceat_and_accumulate_out_shape_mismatch(self, with_cast):

Undocumented

def test_reduceat_shifting_sum(self):

Undocumented

def test_reducelike_byteorder_resolution(self):

Undocumented

def test_reducelike_out_promotes(self):

Undocumented

def test_reducelike_output_needs_identical_cast(self):

Undocumented

def test_reduction_where_initial_needed(self):

Undocumented

@pytest.mark.parametrize('axis', (0, 1, None))
@pytest.mark.parametrize('where', (np.array([False, True, True]), np.array([[True], [False], [True]]), np.array([[True, False, False], [False, True, False], [False, True, True]])))
def test_reduction_with_where(self, axis, where):

Undocumented

@pytest.mark.parametrize(('axis', 'where'), ((0, np.array([True, False, True])), (1, [True, True, False]), (None, True)))
@pytest.mark.parametrize('initial', (-np.inf, 5.0))
def test_reduction_with_where_and_initial(self, axis, where, initial):

Undocumented

def test_safe_casting(self):

Undocumented

def test_scalar_equal(self):

Undocumented

def test_scalar_reduction(self):

Undocumented

def test_signature0(self):

Undocumented

def test_signature1(self):

Undocumented

def test_signature10(self):

Undocumented

def test_signature2(self):

Undocumented

def test_signature3(self):

Undocumented

def test_signature4(self):

Undocumented

def test_signature5(self):

Undocumented

def test_signature6(self):

Undocumented

def test_signature7(self):

Undocumented

def test_signature8(self):

Undocumented

def test_signature9(self):

Undocumented

def test_signature_all_None(self):

Undocumented

def test_signature_dtype_type(self):

Undocumented

def test_signature_errors(self):

Undocumented

def test_signature_failure_extra_parenthesis(self):

Undocumented

def test_signature_failure_mismatching_parenthesis(self):

Undocumented

def test_signature_failure_signature_missing_input_arg(self):

Undocumented

def test_signature_failure_signature_missing_output_arg(self):

Undocumented

def test_struct_ufunc(self):

Undocumented

def test_structured_equal(self):

Undocumented

def test_sum(self):

Undocumented

def test_sum_complex(self):

Undocumented

def test_sum_initial(self):

Undocumented

def test_sum_stability(self):

Undocumented

def test_sum_where(self):

Undocumented

def test_true_divide(self):

Undocumented

def test_type_cast(self):

Undocumented

def test_ufunc_custom_out(self):

Undocumented

def test_use_output_signature_for_all_arguments(self):

Undocumented

def test_where_param(self):

Undocumented

def test_where_param_alloc(self):

Undocumented

def test_where_param_buffer_output(self):

Undocumented

def test_where_with_broadcasting(self):

Undocumented

def test_zerosize_reduction(self):

Undocumented

can_ignore: int =

Undocumented

size_inferred: int =

Undocumented