def __init__(self, vector, delta): if not isinstance(vector, Vector): raise TypeError('VectorCloseTo vector must be a ' + str(Vector)) if not isnumeric(delta): raise TypeError('VectorCloseTo delta must be a number') self.vector = vector self.delta = delta
def test_numpy_numeric_type_uint16(self): self.assertTrue(isnumeric(np.uint16(1)), "Unsigned integer (0 to 65535)")
def test_numpy_numeric_type_int64(self): self.assertTrue( isnumeric(np.int64(1)), "Integer (9223372036854775808 to 9223372036854775807)")
def test_numpy_numeric_type_int32(self): self.assertTrue(isnumeric(np.int32(1)), "Integer (-2147483648 to 2147483647)")
def test_numpy_numeric_type_int16(self): self.assertTrue(isnumeric(np.int16(1)), "Integer (-32768 to 32767)")
def test_numpy_numeric_type_int8(self): self.assertTrue(isnumeric(np.int8(1)), "Byte (-128 to 127)")
def test_numpy_numeric_type_int(self): self.assertTrue(isnumeric(np.int(1)), "Platform integer (normally either int32 or int64)")
def test_numpy_numeric_type_complex128(self): self.assertTrue( isnumeric(np.complex128(1)), "Complex number, represented by two 64-bit floats (real and imaginary components)", )
def test_numpy_numeric_type_complex(self): self.assertTrue(isnumeric(np.complex(1)), "Shorthand for complex128.")
def test_numpy_numeric_type_float64(self): self.assertTrue( isnumeric(np.float64(1)), "Double precision float: sign bit, 11 bits exponent, 52 bits mantissa", )
def test_numpy_numeric_type_float32(self): self.assertTrue( isnumeric(np.float32(1)), "Single precision float: sign bit, 8 bits exponent, 23 bits mantissa", )
def test_numpy_numeric_type_float16(self): self.assertTrue( isnumeric(np.float16(1)), "Half precision float: sign bit, 5 bits exponent, 10 bits mantissa", )
def test_numpy_numeric_type_float(self): self.assertTrue(isnumeric(np.float(1)), "Shorthand for float64.")
def test_numpy_numeric_type_uint64(self): self.assertTrue(isnumeric(np.uint64(1)), "Unsigned integer (0 to 18446744073709551615)")
def test_numpy_numeric_type_uint32(self): self.assertTrue(isnumeric(np.uint32(1)), "Unsigned integer (0 to 4294967295)")