Пример #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)")