How to use the nptyping.Int function in nptyping

To help you get started, we’ve selected a few nptyping examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ramonhagenaars / nptyping / tests / test_types / test_number.py View on Github external
def test_int_of(self):
        self.assertEqual(Int[DEFAULT_INT_BITS], Int.type_of(1))
        self.assertEqual(Int[DEFAULT_INT_BITS], Int.type_of(1000000000))
        self.assertEqual(Int[DEFAULT_INT_BITS], Int.type_of(-1000000000))

        self.assertEqual(Int8, Int.type_of(numpy.int8))
        self.assertEqual(Int16, Int.type_of(numpy.int16))
        self.assertEqual(Int32, Int.type_of(numpy.int32))
        self.assertEqual(Int64, Int.type_of(numpy.int64))
github ramonhagenaars / nptyping / tests / test_types / test_number.py View on Github external
def test_raise_when_invalid_bits(self):
        with self.assertRaises(TypeError):
            Float[8]

        with self.assertRaises(TypeError):
            Int[128]
github ramonhagenaars / nptyping / tests / test_types / test_ndarray.py View on Github external
def test_initialize_with_type(self):
        self.assertEqual((Any, ...), NDArray[int].shape)
        self.assertEqual(Int[DEFAULT_INT_BITS], NDArray[int]._type)
github ramonhagenaars / nptyping / tests / test_functions / test_get_type.py View on Github external
def test_get_type_int(self):
        self.assertEqual(Int[DEFAULT_INT_BITS], get_type(42))