Пример #1
0
    def setUp(self):
        colon = slice(None)
        masked = True

        self.a = biggus.zeros((3, 2))
        self.b = self.a + self.a

        self.a_nodes = {
            'chunk shape: (3, 2)\nsource key: [:, :]\n'
            '\nuuid_0':
            ('a LazyChunk function', (colon, colon), self.a, masked)
        }
        self.b_nodes = {
            'array ()\n\n(id: uuid_1)': (
                'a LazyChunk function',
                'uuid_0',
                self.b,
                masked,
            )
        }

        self.grp = DaskGroup(None)
Пример #2
0
 def test_value(self):
     array = zeros(())
     self.assertEqual(array.value, 0)
Пример #3
0
 def test_shape(self):
     shape = (70, 768, 1024)
     array = zeros(shape)
     self.assertEqual(array.shape, shape)
Пример #4
0
 def test_dtype_default(self):
     array = zeros(())
     self.assertEqual(array.dtype, np.dtype('f8'))
Пример #5
0
 def test_dtype(self):
     dtype = 'i2'
     array = zeros((), dtype)
     self.assertIs(array.dtype, np.dtype(dtype))