Exemplo n.º 1
0
    def test_extract_nc4_encoding(self):
        var = xray.Variable(('x', ), [1, 2, 3], {}, {'foo': 'bar'})
        with self.assertRaisesRegexp(ValueError, 'unexpected encoding'):
            _extract_nc4_encoding(var, raise_on_invalid=True)

        var = xray.Variable(('x', ), [1, 2, 3], {}, {'chunking': (2, 1)})
        encoding = _extract_nc4_encoding(var)
        self.assertEqual({}, encoding)
Exemplo n.º 2
0
    def test_extract_nc4_encoding(self):
        var = xray.Variable(('x',), [1, 2, 3], {}, {'foo': 'bar'})
        with self.assertRaisesRegexp(ValueError, 'unexpected encoding'):
            _extract_nc4_encoding(var, raise_on_invalid=True)

        var = xray.Variable(('x',), [1, 2, 3], {}, {'chunking': (2, 1)})
        encoding = _extract_nc4_encoding(var)
        self.assertEqual({}, encoding)
Exemplo n.º 3
0
 def test_extract_h5nc_encoding(self):
     # not supported with h5netcdf (yet)
     var = xray.Variable(('x', ), [1, 2, 3], {},
                         {'least_sigificant_digit': 2})
     with self.assertRaisesRegexp(ValueError, 'unexpected encoding'):
         _extract_nc4_encoding(var, raise_on_invalid=True)
Exemplo n.º 4
0
 def test_extract_h5nc_encoding(self):
     # not supported with h5netcdf (yet)
     var = xray.Variable(('x',), [1, 2, 3], {},
                         {'least_sigificant_digit': 2})
     with self.assertRaisesRegexp(ValueError, 'unexpected encoding'):
         _extract_nc4_encoding(var, raise_on_invalid=True)