Skip to content

Conversation

@jreadey
Copy link
Member

@jreadey jreadey commented Mar 25, 2025

hdf5db now supports interaces for reader and/or writer objects.
Currently json and hdf5 (using h5py) are supported.

stop = start + sel_inter.count[dim]
slices.append(slice(start, stop, 1))
slices = tuple(slices)
# TBD: needs updating to work in the general case!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this TBD been addressed?

raise IOError(errno.EINVAL, msg)
return link_json

def _addLink(self, grp_id, name, link_json):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If _addLink is meant to be an internal function, should it be moved to utils?


for obj_id in self.db:
# skip deleted objects
if self.db[obj_id] is not None:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it will still count objects that have been marked as deleted with "DELETED" and marked dirty, since e.g. deleteLink doesn't appear to remove the link from the database.

try:
linkObj = parent.get(link_name, None, False, True)
linkClass = linkObj.__class__.__name__
except TypeError:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to distinguish a UD link from other potential causes of TypeError here and in _getLink?

self._flush_time = 0.0
self._f = None # h5py file handle

def _copy_element(self, val, src_dt, tgt_dt, fout=None):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the _copy_* routines here and in h5py_reader should be renamed to indicate that they're also performing a conversion, and the direction of that conversion. Something like _element_json_to_h5py_rep()/_element_h5py_to_json_rep() would prevent confusion between the two identically named functions that perform opposite operations.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same goes for _copy_array.

for title in titles:
link_json = links_json[title]
link_class = link_json["class"]
if "DELETED" in link_json:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this also handles deletion, would it be more accurate to call _createObjects() something like _syncObjects()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants