Пример #1
0
    def test_create_default_array_3D_int_fill_value(self):
        default_array = DatasetUtil.create_default_array([7, 8, 3], np.int8, fill_value=1)

        self.assertIsNotNone(default_array)
        self.assertEqual(DataArray, type(default_array))
        self.assertEqual((7, 8, 3), default_array.shape)
        self.assertEqual(np.int8, default_array.dtype)
        self.assertEqual(1, default_array[2, 4, 2])
Пример #2
0
    def test_create_default_array_3D_int_dims(self):
        default_array = DatasetUtil.create_default_array([7, 8, 3], np.int8, dim_names=["dim1", "dim2", "dim3"])

        self.assertIsNotNone(default_array)
        self.assertEqual(DataArray, type(default_array))
        self.assertEqual((7, 8, 3), default_array.shape)
        self.assertEqual(np.int8, default_array.dtype)
        self.assertEqual(-127, default_array[2, 4, 2])
        self.assertEqual(("dim1", "dim2", "dim3",), default_array.dims)
Пример #3
0
    def test_create_default_array_1D_int(self):

        default_array = DatasetUtil.create_default_array([5], np.int8)

        self.assertIsNotNone(default_array)
        self.assertEqual(DataArray, type(default_array))
        self.assertEqual((5,), default_array.shape)
        self.assertEqual(np.int8, default_array.dtype)
        self.assertEqual(-127, default_array[2])