Skip to content
Open
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1298a9d
first pass at h5json integration
jreadey Jul 31, 2025
9abd1c5
updates for attribute support
jreadey Sep 3, 2025
3a7b1d0
track_order support
jreadey Sep 9, 2025
dd4895a
fix test to run in use_h5py mode
jreadey Sep 10, 2025
8c21ef9
fix flake8 errors
jreadey Sep 10, 2025
982b40e
fix for comitted type support
jreadey Sep 10, 2025
1834a7d
updates for scalar datasets
jreadey Sep 11, 2025
dd5daa6
fix selection import for Table
jreadey Sep 12, 2025
54f84d3
added hdf5b reader and writer for hsds
jreadey Sep 12, 2025
4f8e817
remove dup files
jreadey Sep 12, 2025
862affa
updates for folder class
jreadey Sep 15, 2025
d3a71d3
added getFilters func
jreadey Dec 16, 2025
a31e1f0
hsinfo fix
joshStillerman Dec 17, 2025
9e1692b
fix for hyperslab read, writes
jreadey Jan 2, 2026
0ae11d1
fix for extending dset
jreadey Jan 6, 2026
7454aab
revert test config
jreadey Jan 6, 2026
73108fd
added support for consolidated metadata
jreadey Jan 8, 2026
bebae88
add support for track_order
jreadey Jan 11, 2026
339ce6f
fix for track_info and getserverinfo
jreadey Jan 11, 2026
37e9ea7
fix for visit
jreadey Jan 14, 2026
278c708
fix for dataset_like
jreadey Jan 28, 2026
ca05bdb
updates for vlen types
jreadey Feb 3, 2026
a486c47
fix for hsload
jreadey Feb 9, 2026
d3292a4
read datset values from consolidated metadata if available
jreadey Feb 11, 2026
86de749
fix for hsload with scalar datasets
jreadey Feb 11, 2026
e4ca5e6
update for multi test
jreadey Mar 12, 2026
9a0b3b0
fixes for vlen types
jreadey Mar 25, 2026
311a87c
updated dims to use h5json
jreadey Apr 7, 2026
fb8ff3f
fix compat issue with h5py dimscales
jreadey Apr 8, 2026
e497f41
fix for hsstat
jreadey Apr 8, 2026
6df6567
fix for obj refs
jreadey Apr 13, 2026
d212c10
suppot boolean mask sel
jreadey Jun 8, 2026
e981505
fix for write point selections
jreadey Jun 15, 2026
404edaf
code cleanup on table class
jreadey Aug 12, 2026
d00301b
fix for selection.query_string
jreadey Aug 13, 2026
5440273
added dataset query option for getitem
jreadey Aug 16, 2026
c5ad46a
various attribute fixes, additional test cases
jreadey Aug 22, 2026
3507e4b
support region ref datsaets
jreadey Aug 23, 2026
640c499
fixes for complex type
jreadey Aug 25, 2026
99d663c
fix hsinfo so testall.py can invoke it
jreadey Aug 25, 2026
053a84e
add query method to regionref proxy
jreadey Aug 25, 2026
e2fd509
remove codespace link from readme
jreadey Aug 25, 2026
59e11fb
removed todo block since regionref is handled below
jreadey Aug 25, 2026
5aa0e20
fix for mixed slices and swmr
jreadey Aug 26, 2026
6479f5c
added compound type dataset query test
jreadey Aug 26, 2026
ab118da
review updates and array type fixes
jreadey Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/hdfgroup/h5pyd)

h5pyd
=====

Expand Down
10 changes: 6 additions & 4 deletions examples/swmr_multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self, event, fname, dsetname, block_size, loop_count, sleep_time=0.
self._event = event
self._fname = fname
self._dsetname = dsetname
self._block_size = block_size
self._total_rows = block_size * loop_count
self._sleep_time = sleep_time
self._timeout = 5
Expand All @@ -45,6 +46,7 @@ def run(self):
self.log.info("Waiting for initial event")
assert self._event.wait(self._timeout)
self._event.clear()
# time.sleep(5) works ok with the sleep

self.log.info(f"Opening file {self._fname}")
if self._fname.startswith("hdf5://"):
Expand All @@ -63,9 +65,9 @@ def run(self):
row_count = dset.shape[0]
if row_count > last_count:
self.log.info(f"Read {row_count - last_count} rows added")
if row_count > last_count + block_size:
if row_count > last_count + self._block_size:
# This selection should have data updated after a resize
arr = dset[last_count:(last_count + block_size)]
arr = dset[last_count:(last_count + self._block_size)]
self.log.info(f"Read data read, min: {arr.min()} max: {arr.max()}")
last_count = row_count
else:
Expand Down Expand Up @@ -99,8 +101,8 @@ def run(self):

try:
kwargs = {"dtype": np.dtype("int64"), "chunks": (1024 * 256,), "maxshape": (None,)}
if compression:
kwargs["compression"] = compression
if self._compression:
kwargs["compression"] = self._compression
dset = f.create_dataset(self._dsetname, (0,), **kwargs)
assert not f.swmr_mode

Expand Down
6 changes: 3 additions & 3 deletions h5pyd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
##############################################################################

from __future__ import absolute_import

from h5json.hdf5dtype import Reference, RegionReference
from . import version
from ._hl.base import Empty
from ._hl.h5type import special_dtype, Reference, RegionReference
from ._hl.h5type import special_dtype
from ._hl.h5type import vlen_dtype, string_dtype, enum_dtype
from ._hl.h5type import check_vlen_dtype, check_string_dtype, check_enum_dtype
from ._hl.h5type import check_opaque_dtype, check_ref_dtype, check_dtype
Expand All @@ -25,7 +25,7 @@
from ._hl.table import Table
from ._hl.datatype import Datatype
from ._hl.attrs import AttributeManager
from ._hl.serverinfo import getServerInfo
from .serverinfo import getServerInfo
from . import h5ds


Expand Down
56 changes: 37 additions & 19 deletions h5pyd/_apps/hsinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
import sys
import logging
import time
import h5pyd

from h5pyd.httpconn import HttpConn
from h5pyd import Folder
from h5pyd.version import version as h5pyd_version

if __name__ == "__main__":
from config import Config
Expand Down Expand Up @@ -47,8 +50,8 @@ def usage():
print(f" {help_msg}")
print("")
print("examples:")
print(f" {cmd} -e http://hsdshdflab.hdfgroup.org")
print(f" {cmd} -e http://hsdshdflab.hdfgroup.org /shared/tall.h5")
print(f" {cmd} -e http://hsds.hdf.test")
print(f" {cmd} -e http://hsds.hdf.test /shared/tall.h5")
print(cfg.get_see_also(cmd))
print("")
sys.exit()
Expand Down Expand Up @@ -83,10 +86,19 @@ def getServerInfo(cfg):
username = cfg["hs_username"]
password = cfg["hs_password"]
endpoint = cfg["hs_endpoint"]
http_conn = None

try:
info = h5pyd.getServerInfo(
username=username, password=password, endpoint=endpoint
)
kwargs = {}
kwargs["username"] = username
kwargs["password"] = password
kwargs["endpoint"] = endpoint
http_conn = HttpConn(None, **kwargs)

http_conn.open()

info = http_conn.serverInfo()

info_name = info["name"]
print(f"server name: {info_name}")
if "state" in info:
Expand All @@ -97,11 +109,9 @@ def getServerInfo(cfg):
admin_tag = "(admin)"
else:
admin_tag = ""

info_username = info["username"]
print(f"username: {info_username} {admin_tag}")
info_password = info["password"]
print(f"password: {info_password}")

if info["state"] == "READY":
try:
home_folder = getHomeFolder()
Expand All @@ -119,7 +129,7 @@ def getServerInfo(cfg):
if "start_time" in info:
uptime = getUpTime(info["start_time"])
print(f"up: {uptime}")
print(f"h5pyd version: {h5pyd.version.version}")
print(f"h5pyd version: {h5pyd_version}")

except IOError as ioe:
if ioe.errno == 401:
Expand All @@ -130,6 +140,9 @@ def getServerInfo(cfg):
print("authentication failure")
else:
print(f"Error: {ioe}")
finally:
if http_conn:
http_conn.close()


#
Expand All @@ -141,9 +154,14 @@ def getHomeFolder():
endpoint = cfg["hs_endpoint"]
if not username:
return None
dir = h5pyd.Folder(
"/home/", username=username, password=password, endpoint=endpoint
) # get folder object for root

kwargs = {}
kwargs["username"] = username
kwargs["password"] = password
kwargs["endpoint"] = endpoint
dir = Folder("/home/", **kwargs) # get folder object for root

# get folder object for root
homefolder = None
for name in dir:
# we should come across the given domain
Expand All @@ -152,18 +170,18 @@ def getHomeFolder():
# e.g. folder: "/home/bob/" for username "bob@acme.com"
path = "/home/" + name + "/"
try:
f = h5pyd.Folder(
path, username=username, password=password, endpoint=endpoint
)
f = Folder(path, **kwargs)
if f.owner == username:
homefolder = path
except IOError as ioe:
logging.info(f"find home folder - got ioe: {ioe}")
continue
except Exception as e:
logging.warning(f"find home folder - got exception: {e}")
continue
if f.owner == username:
homefolder = path
f.close()
finally:
if f:
f.close()
if homefolder:
break

Expand Down
14 changes: 12 additions & 2 deletions h5pyd/_apps/utillib.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def get_chunk_layout(dset):
msg = "get_chunk_layout called on hdf5 dataset"
logging.error(msg)
raise IOError(msg)
dset_json = dset.id.dcpl_json
dset_json = dset.id.cpl_json
if "layout" not in dset_json:
msg = f"expect to find layout key in dset_json: {dset_json}"
logging.error(msg)
Expand Down Expand Up @@ -1244,8 +1244,12 @@ def create_dataset(dobj, ctx):
rank = 0
else:
tgt_shape.extend(dobj.shape)
tgt_maxshape.extend(dobj.maxshape)
rank = len(tgt_shape)
if rank > 0:
tgt_maxshape.extend(dobj.maxshape)
else:
tgt_maxshape = None

if rank > 0 and ctx["extend_dim"]:
# set maxshape to unlimited for any dimension that is the extend_dim
if dobj.name.split("/")[-1] == ctx["extend_dim"]:
Expand Down Expand Up @@ -1712,6 +1716,7 @@ def create_group(gobj, ctx):
print(f"{gobj.name} not found")

grp = fout.create_group(gobj.name)

srcid_desobj_map = ctx["srcid_desobj_map"]
msg = f"adding group id {gobj.id.id} to {grp} in srcid_desobj_map"
logging.debug(msg)
Expand Down Expand Up @@ -1837,7 +1842,10 @@ def load_file(

def copy_attribute_helper(name, obj):
logging.info(f"copy attribute - name: {name} obj: {obj.name}")
fout = ctx["fout"]

tgt = fout[name]

for a in obj.attrs:
copy_attribute(tgt, a, obj, ctx)

Expand Down Expand Up @@ -1883,10 +1891,12 @@ def object_copy_helper(name, obj):
# build a rough map of the file using the internal function above
logging.info("creating target objects")
fin.visititems(object_create_helper)
fout.flush()

# copy over any attributes
logging.info("creating target attributes")
fin.visititems(copy_attribute_helper)
fout.flush()

# create soft/external links (and hardlinks not already created)
create_links(fin, fout, ctx) # create root soft/external links
Expand Down
Loading
Loading