예제 #1
0
	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
예제 #2
0
 def test_numpy_numeric_type_uint16(self):
     self.assertTrue(isnumeric(np.uint16(1)),
                     "Unsigned integer (0 to 65535)")
예제 #3
0
 def test_numpy_numeric_type_int64(self):
     self.assertTrue(
         isnumeric(np.int64(1)),
         "Integer (9223372036854775808 to 9223372036854775807)")
예제 #4
0
 def test_numpy_numeric_type_int32(self):
     self.assertTrue(isnumeric(np.int32(1)),
                     "Integer (-2147483648 to 2147483647)")
예제 #5
0
 def test_numpy_numeric_type_int16(self):
     self.assertTrue(isnumeric(np.int16(1)), "Integer (-32768 to 32767)")
예제 #6
0
 def test_numpy_numeric_type_int8(self):
     self.assertTrue(isnumeric(np.int8(1)), "Byte (-128 to 127)")
예제 #7
0
 def test_numpy_numeric_type_int(self):
     self.assertTrue(isnumeric(np.int(1)),
                     "Platform integer (normally either int32 or int64)")
예제 #8
0
 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)",
     )
예제 #9
0
 def test_numpy_numeric_type_complex(self):
     self.assertTrue(isnumeric(np.complex(1)), "Shorthand for complex128.")
예제 #10
0
 def test_numpy_numeric_type_float64(self):
     self.assertTrue(
         isnumeric(np.float64(1)),
         "Double precision float: sign bit, 11 bits exponent, 52 bits mantissa",
     )
예제 #11
0
 def test_numpy_numeric_type_float32(self):
     self.assertTrue(
         isnumeric(np.float32(1)),
         "Single precision float: sign bit, 8 bits exponent, 23 bits mantissa",
     )
예제 #12
0
 def test_numpy_numeric_type_float16(self):
     self.assertTrue(
         isnumeric(np.float16(1)),
         "Half precision float: sign bit, 5 bits exponent, 10 bits mantissa",
     )
예제 #13
0
 def test_numpy_numeric_type_float(self):
     self.assertTrue(isnumeric(np.float(1)), "Shorthand for float64.")
예제 #14
0
 def test_numpy_numeric_type_uint64(self):
     self.assertTrue(isnumeric(np.uint64(1)),
                     "Unsigned integer (0 to 18446744073709551615)")
예제 #15
0
 def test_numpy_numeric_type_uint32(self):
     self.assertTrue(isnumeric(np.uint32(1)),
                     "Unsigned integer (0 to 4294967295)")