Skip to content

Commit

Permalink
Merge pull request #2320 from takluyver/hdf5-v1.10-api
Browse files Browse the repository at this point in the history
Update to use HDF5 1.10 compatibility mode rather than 1.8
  • Loading branch information
takluyver committed Oct 5, 2023
2 parents bc68588 + f9fa05e commit 89e1e2e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion h5py/api_functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ hdf5:
# === H5R - Reference API ===================================================

herr_t H5Rcreate(void *ref, hid_t loc_id, char *name, H5R_type_t ref_type, hid_t space_id)
hid_t H5Rdereference(hid_t obj_id, H5R_type_t ref_type, void *ref)
hid_t H5Rdereference(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, void *ref)
hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, void *ref)
herr_t H5Rget_obj_type(hid_t id, H5R_type_t ref_type, void *ref, H5O_type_t *obj_type)
ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, void *ref, char *name, size_t size)
Expand Down
9 changes: 6 additions & 3 deletions h5py/h5r.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"""

# Cython C-level imports
from ._objects cimport ObjectID
from ._objects cimport ObjectID, pdefault
from .h5p cimport PropID

#Python level imports
from ._objects import phil, with_phil
Expand Down Expand Up @@ -66,7 +67,7 @@ def create(ObjectID loc not None, char* name, int ref_type, ObjectID space=None)


@with_phil
def dereference(Reference ref not None, ObjectID id not None):
def dereference(Reference ref not None, ObjectID id not None, PropID oapl=None):
"""(Reference ref, ObjectID id) => ObjectID or None
Open the object pointed to by the reference and return its
Expand All @@ -79,7 +80,9 @@ def dereference(Reference ref not None, ObjectID id not None):
from . import h5i
if not ref:
return None
return h5i.wrap_identifier(H5Rdereference(id.id, <H5R_type_t>ref.typecode, &ref.ref))
return h5i.wrap_identifier(H5Rdereference(
id.id, pdefault(oapl), <H5R_type_t>ref.typecode, &ref.ref
))


@with_phil
Expand Down
5 changes: 4 additions & 1 deletion setup_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def localpath(*args):
'libraries' : ['hdf5', 'hdf5_hl'],
'include_dirs' : [localpath('lzf')],
'library_dirs' : [],
'define_macros' : [('H5_USE_18_API', None),
'define_macros' : [('H5_USE_110_API', None),
# The definition should imply the one below, but CI on
# Ubuntu 20.04 still gets H5Rdereference1 for some reason
('H5Rdereference_vers', 2),
('NPY_NO_DEPRECATED_API', 0),
]
}
Expand Down

0 comments on commit 89e1e2e

Please sign in to comment.