diff --git a/fact/VERSION b/fact/VERSION index 4e8f395..30f6cf8 100644 --- a/fact/VERSION +++ b/fact/VERSION @@ -1 +1 @@ -0.26.0 +0.26.1 diff --git a/fact/io.py b/fact/io.py index 49d91ea..fadd2e5 100644 --- a/fact/io.py +++ b/fact/io.py @@ -37,7 +37,11 @@ def create_blosc_compression_options(complevel=5, complib='blosc:zstd', shuffle= ''' shuffle = 2 if shuffle == 'bit' else 1 if shuffle else 0 compressors = tables.filters.blosc_compressor_list() - complib = ['blosc:' + c for c in compressors].index(complib) + try: + complib = ['blosc:' + c for c in compressors].index(complib) + except ValueError: + raise ValueError('Unsupported compression "{}"'.format(complib)) + args = { 'compression': 32001, 'compression_opts': (0, 0, 0, 0, complevel, shuffle, complib) @@ -49,9 +53,8 @@ def create_blosc_compression_options(complevel=5, complib='blosc:zstd', shuffle= DEFAULT_COMPRESSION = {} with tempfile.NamedTemporaryFile(suffix='.hdf5') as f: - zstd_opts = create_blosc_compression_options() - try: + zstd_opts = create_blosc_compression_options() with h5py.File(f.name, 'w') as of: of.create_dataset('test', dtype='float64', shape=(1, ), **zstd_opts) @@ -63,6 +66,7 @@ def create_blosc_compression_options(complevel=5, complib='blosc:zstd', shuffle= ' make sure tables and h5py are linked against the same hdf5 library' ' e.g. by installing hdf5 in your system and doing ' ' `pip install --no-binary=tables --no-binary=h5py tables h5py`' + ' or using conda' ) diff --git a/setup.py b/setup.py index bff3e7e..03fb363 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ setup_requires=['pytest-runner'], install_requires=[ 'astropy', + 'click', 'h5py', 'matplotlib>=1.4', 'numpy', @@ -45,7 +46,7 @@ 'setuptools', 'simple-crypt', 'sqlalchemy', - 'tables', # pytables in anaconda + 'tables>=3.3', # pytables in anaconda 'wrapt', ], zip_safe=False,