Ejemplo n.º 1
0
def deflate_filter():
    """ create deflate filter

    :returns: deflate filter object
    :rtype: :class:`PNIDeflate`
    """
    return PNIDeflate(nx.deflate_filter())
Ejemplo n.º 2
0
    def test_issue(self):
        deflate = nx.deflate_filter()
        deflate.rate = 5
        deflate.shuffle = True
        root = self.nxfile.root()

        self.assertRaises(SizeMismatchError,
                          root.create_field,"test","string",[],[],deflate)
Ejemplo n.º 3
0
 def test_multidim_creation_without_chunk_and_filter(self):
     comp = deflate_filter()
     comp.rate = 2
     f = self.root.create_field("multidim_without_chunk_with_filter",
                                self._typecode,
                                shape=(0,1024,1024),
                                filter=comp)
     self.assertTrue(f.is_valid)
     self.assertEqual(f.dtype,self._typecode)
     self.assertEqual(f.shape,(0,1024,1024))
     self.assertEqual(f.size, 0)
     self.assertEqual(f.filename,self.full_path)
     self.assertEqual(f.parent.name,"/")
     self.assertEqual(f.path,"/multidim_without_chunk_with_filter")
     self.assertEqual(f.name,"multidim_without_chunk_with_filter")