From 5c495a4ea50d4421d191c60fb3e1a971b59f93d4 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Mon, 1 Apr 2019 09:37:22 +0900 Subject: [PATCH 1/2] Upgrade dependency for travis to h5py 2.9.0 and update code to avoid DeprecationWarning --- .travis.yml | 2 +- h5py_wrapper/wrapper.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0226ba4..30469e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ before_install: - source activate myenv - pip install --upgrade pip install: - - conda install --yes numpy h5py==2.7.0 + - conda install --yes numpy h5py==2.9.0 - pip install --upgrade quantities future requests - pip install pytest pytest-cov coveralls - pip install --upgrade docopt diff --git a/h5py_wrapper/wrapper.py b/h5py_wrapper/wrapper.py index 09a568e..c6422fe 100644 --- a/h5py_wrapper/wrapper.py +++ b/h5py_wrapper/wrapper.py @@ -278,10 +278,10 @@ def _load_dataset(f, lazy=False): 'custom_shape' in f.attrs): return _load_custom_shape(f) elif '_unit' in f.attrs: - return _cast_value_type(f.value, value_type, + return _cast_value_type(f[()], value_type, unit=f.attrs['_unit']) else: - return _cast_value_type(f.value, value_type) + return _cast_value_type(f[()], value_type) def _evaluate_key(f): @@ -303,7 +303,7 @@ def _load_custom_shape(f): Reshape array with unequal dimensions into original shape. """ data_reshaped = [] - value = f.value + value = f[()] custom_value_types = f.attrs['custom_value_types'].astype(np.unicode_) for (j, i), value_type in zip(lib.accumulate(f.attrs['oldshape']), custom_value_types): From ea4fa431ad13eb6d2df6e80710e03f203939bba9 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Mon, 1 Apr 2019 09:47:22 +0900 Subject: [PATCH 2/2] Switch travis file to install h5py from pip instead of conda --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 30469e1..e5f0635 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ before_install: - source activate myenv - pip install --upgrade pip install: - - conda install --yes numpy h5py==2.9.0 + - pip install numpy h5py==2.9.0 - pip install --upgrade quantities future requests - pip install pytest pytest-cov coveralls - pip install --upgrade docopt