module documentation

Undocumented

Class TestAbs Undocumented
Class TestBaseMath Undocumented
Class TestBitShifts No class docstring; 1/1 method documented
Class TestComplexDivision Undocumented
Class TestConversion Undocumented
Class TestHash Undocumented
Class TestModulus Undocumented
Class TestMultiply Undocumented
Class TestNegative Undocumented
Class TestPower Undocumented
Class TestRepr Undocumented
Class TestSizeOf Undocumented
Class TestSubtract Undocumented
Class TestTypes Undocumented
Function check_ufunc_scalar_equivalence Undocumented
Function floordiv_and_mod Undocumented
Function recursionlimit Undocumented
Function test_array_scalar_ufunc_dtypes Undocumented
Function test_array_scalar_ufunc_equivalence This is a thorough test attempting to cover important promotion paths and ensuring that arrays and scalars stay as aligned as possible. However, if it creates troubles, it should maybe just be removed.
Function test_clongdouble_inf_loop Undocumented
Function test_int_float_promotion_truediv Undocumented
Function test_longdouble_complex Undocumented
Function test_longdouble_inf_loop Undocumented
Function test_operator_object_left Undocumented
Function test_operator_object_right Undocumented
Function test_operator_scalars Undocumented
Function test_pyscalar_subclasses Undocumented
Function test_scalar_integer_operation_divbyzero Undocumented
Function test_scalar_integer_operation_overflow Undocumented
Function test_scalar_signed_integer_overflow Undocumented
Function test_scalar_unsigned_integer_overflow Undocumented
Function test_subclass_deferral This test covers scalar subclass deferral. Note that this is exceedingly complicated, especially since it tends to fall back to the array paths and these additionally add the "array priority" mechanism.
Variable complex_floating_types Undocumented
Variable floating_types Undocumented
Variable objecty_things Undocumented
Variable ops_with_names Undocumented
Variable reasonable_operators_for_scalars Undocumented
Variable types Undocumented
Function _signs Undocumented
def check_ufunc_scalar_equivalence(op, arr1, arr2): (source)

Undocumented

def floordiv_and_mod(x, y): (source)

Undocumented

Undocumented

@pytest.mark.slow
@given(sampled_from(reasonable_operators_for_scalars), hynp.scalar_dtypes(), hynp.scalar_dtypes())
def test_array_scalar_ufunc_dtypes(op, dt1, dt2): (source)

Undocumented

@pytest.mark.slow
@settings(max_examples=10000, deadline=2000)
@given(sampled_from(reasonable_operators_for_scalars), hynp.arrays(dtype=hynp.scalar_dtypes(), shape=()), hynp.arrays(dtype=hynp.scalar_dtypes(), shape=()))
def test_array_scalar_ufunc_equivalence(op, arr1, arr2): (source)

This is a thorough test attempting to cover important promotion paths and ensuring that arrays and scalars stay as aligned as possible. However, if it creates troubles, it should maybe just be removed.

@pytest.mark.parametrize('op', reasonable_operators_for_scalars)
@pytest.mark.parametrize('val', [None, 2**64])
def test_clongdouble_inf_loop(op, val): (source)

Undocumented

@pytest.mark.parametrize('fscalar', [np.float16, np.float32])
def test_int_float_promotion_truediv(fscalar): (source)

Undocumented

def test_longdouble_complex(): (source)

Undocumented

@pytest.mark.parametrize('op', reasonable_operators_for_scalars)
@pytest.mark.parametrize('val', [None, 2**64])
def test_longdouble_inf_loop(op, val): (source)

Undocumented

@given(sampled_from(objecty_things), sampled_from(reasonable_operators_for_scalars), sampled_from(types))
def test_operator_object_left(o, op, type_): (source)

Undocumented

@given(sampled_from(objecty_things), sampled_from(reasonable_operators_for_scalars), sampled_from(types))
def test_operator_object_right(o, op, type_): (source)

Undocumented

@given(sampled_from(reasonable_operators_for_scalars), sampled_from(types), sampled_from(types))
def test_operator_scalars(op, type1, type2): (source)

Undocumented

@pytest.mark.parametrize(['__op__', '__rop__', 'op', 'cmp'], ops_with_names)
@pytest.mark.parametrize('subtype', [float, int, complex, np.float16])
@np._no_nep50_warning()
def test_pyscalar_subclasses(subtype, __op__, __rop__, op, cmp): (source)

Undocumented

@pytest.mark.parametrize('dtype', np.typecodes['AllInteger'])
@pytest.mark.parametrize('operation', [(lambda val, zero: val // zero), (lambda val, zero: val % zero)], ids=['//', '%'])
def test_scalar_integer_operation_divbyzero(dtype, operation): (source)

Undocumented

@pytest.mark.parametrize('dtype', np.typecodes['AllInteger'])
@pytest.mark.parametrize('operation', [(lambda min, max: max + max), (lambda min, max: min - max), (lambda min, max: max * max)], ids=['+', '-', '*'])
def test_scalar_integer_operation_overflow(dtype, operation): (source)

Undocumented

@pytest.mark.parametrize('dtype', np.typecodes['Integer'])
@pytest.mark.parametrize('operation', [(lambda min, neg_1: -min), (lambda min, neg_1: abs(min)), (lambda min, neg_1: min * neg_1), pytest.param((lambda min, neg_1: min // neg_1), marks=pytest.mark.skip(reason='broken on some platforms'))], ids=['neg', 'abs', '*', '//'])
def test_scalar_signed_integer_overflow(dtype, operation): (source)

Undocumented

@pytest.mark.parametrize('dtype', np.typecodes['UnsignedInteger'])
def test_scalar_unsigned_integer_overflow(dtype): (source)

Undocumented

@pytest.mark.parametrize(['__op__', '__rop__', 'op', 'cmp'], ops_with_names)
@pytest.mark.parametrize('sctype', [np.float32, np.float64, np.longdouble])
def test_subclass_deferral(sctype, __op__, __rop__, op, cmp): (source)

This test covers scalar subclass deferral. Note that this is exceedingly complicated, especially since it tends to fall back to the array paths and these additionally add the "array priority" mechanism.

The behaviour was modified subtly in 1.22 (to make it closer to how Python scalars work). Due to its complexity and the fact that subclassing NumPy scalars is probably a bad idea to begin with. There is probably room for adjustments here.

complex_floating_types = (source)

Undocumented

floating_types = (source)

Undocumented

objecty_things = (source)

Undocumented

ops_with_names = (source)

Undocumented

reasonable_operators_for_scalars = (source)

Undocumented

Undocumented

def _signs(dt): (source)

Undocumented