[h5py] 257/455: Fix filter tests & restore behavior for scalar datasets
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit 48d0b5ac37e060df9907a17597163ed985a8ba06
Author: andrewcollette <andrew.collette at gmail.com>
Date: Mon Jun 1 18:02:44 2009 +0000
Fix filter tests & restore behavior for scalar datasets
---
h5py/filters.py | 5 +++--
h5py/tests/test_filters.py | 12 +++---------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/h5py/filters.py b/h5py/filters.py
index 5c56ac2..693d0cf 100644
--- a/h5py/filters.py
+++ b/h5py/filters.py
@@ -65,9 +65,10 @@ def generate_dcpl(shape, dtype, chunks, compression, compression_opts,
"""
# Scalar datasets don't support any fancy features
+ # However, the currently defined behavior is simply to ignore these options
if shape == ():
- if any((chunks, compression, compression_opts, shuffle, fletcher32)):
- raise TypeError("Scalar datasets don't support chunk/filter options")
+ #if any((chunks, compression, compression_opts, shuffle, fletcher32)):
+ # raise TypeError("Scalar datasets don't support chunk/filter options")
if maxshape and maxshape != ():
raise TypeError("Scalar datasets cannot be extended")
return h5p.create(h5p.DATASET_CREATE)
diff --git a/h5py/tests/test_filters.py b/h5py/tests/test_filters.py
index 351214b..a3f529d 100644
--- a/h5py/tests/test_filters.py
+++ b/h5py/tests/test_filters.py
@@ -2,7 +2,7 @@ import numpy as np
import h5py
from h5py import filters
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_raises
from common import makehdf, delhdf
@@ -88,7 +88,7 @@ class TestFilters(object):
assert_equal(dset.compression_opts, o)
def test_fletcher32_shuffle(self):
- # Check fletcher32 and shuffle, including auto-shuffle
+ # Check fletcher32 and shuffle
settings = (None, False, True)
results = (False, False, True)
@@ -100,13 +100,6 @@ class TestFilters(object):
dset = self.make_dset(shuffle=s)
assert_equal(dset.shuffle, r)
- # Make sure shuffle is automatically activated for compression
-
- dset = self.make_dset(compression='gzip')
- assert_equal(dset.shuffle, True)
- dset = self.make_dset(compression='gzip', shuffle=False)
- assert_equal(dset.shuffle, False)
-
def test_data(self):
# Ensure data can be read/written with filters
@@ -118,6 +111,7 @@ class TestFilters(object):
def test_dset(shape, dtype, **kwds):
print "test %s %s %s" % (shape, dtype, kwds)
+
dset = self.make_dset(s, dtype, **kwds)
arr = (np.random.random(s)*100).astype(dtype)
dset[...] = arr
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list