diff --git a/h5py/_hl/dataset.py b/h5py/_hl/dataset.py index 981cbcba..55f08f11 100644 --- a/h5py/_hl/dataset.py +++ b/h5py/_hl/dataset.py @@ -789,6 +789,17 @@ class Dataset(HLObject): return r.encode('utf8') return r + def __dir__(self): + if six.PY3: + names = set(super(Dataset, self).__dir__()) + else: + names = set(dir(type(self))) + # ds.value is deprecated, and we want to ensure that Jedi doesn't try + # to call the property (https://github.com/h5py/h5py/issues/1312), so + # this hides it from tab completions. + names.discard('value') + return sorted(names) + if hasattr(h5d.DatasetID, "refresh"): @with_phil def refresh(self): diff --git a/h5py/h5t.pyx b/h5py/h5t.pyx index 8ddd424b..ba2d5a1b 100644 --- a/h5py/h5t.pyx +++ b/h5py/h5t.pyx @@ -1369,27 +1369,25 @@ cdef class TypeEnumID(TypeCompositeID): def _get_float_dtype_to_hdf5(): float_le = {} float_be = {} - h5_be_list = [IEEE_F16BE, IEEE_F32BE, IEEE_F64BE, IEEE_F128BE, - LDOUBLE_BE] - h5_le_list = [IEEE_F16LE, IEEE_F32LE, IEEE_F64LE, IEEE_F128LE] - if MACHINE != 'ppc64le': - h5_le_list.append(LDOUBLE_LE) + h5_be_list = [IEEE_F16BE, IEEE_F32BE, IEEE_F64BE, IEEE_F128BE, LDOUBLE_BE] + h5_le_list = [IEEE_F16LE, IEEE_F32LE, IEEE_F64LE, IEEE_F128LE, LDOUBLE_LE] + for ftype_, finfo, size in _available_ftypes: nmant, maxexp, minexp = _correct_float_info(ftype_, finfo) for h5type in h5_be_list: spos, epos, esize, mpos, msize = h5type.get_fields() ebias = h5type.get_ebias() if (finfo.iexp == esize and nmant == msize and - (maxexp - 1) == ebias - ): + (maxexp - 1) == ebias): float_be[ftype_] = h5type + break # first found matches, related to #1244 for h5type in h5_le_list: spos, epos, esize, mpos, msize = h5type.get_fields() ebias = h5type.get_ebias() if (finfo.iexp == esize and nmant == msize and - (maxexp - 1) == ebias - ): + (maxexp - 1) == ebias): float_le[ftype_] = h5type + break # first found matches, related to #1244 if ORDER_NATIVE == H5T_ORDER_LE: float_nt = dict(float_le) else: diff --git a/h5py/tests/test_dataset.py b/h5py/tests/test_dataset.py index b5ba988c..e047b06d 100644 --- a/h5py/tests/test_dataset.py +++ b/h5py/tests/test_dataset.py @@ -1186,3 +1186,13 @@ class TestLowOpen(BaseDataset): del dset dsid = h5py.h5d.open(self.f.id, b'x', dapl) self.assertIsInstance(dsid, h5py.h5d.DatasetID) + + +def test_hide_value_from_jedi(): + from io import BytesIO + buf = BytesIO() + with h5py.File(buf, 'w') as fout: + fout['test'] = [1, 2, 3] + with pytest.warns(UserWarning): + assert hasattr(fout['test'], 'value') + assert 'value' not in dir(fout['test'])