Skip to content

Commit

Permalink
fix object_helper bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MRossol committed Jun 16, 2020
1 parent a2ce8f5 commit c05af35
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions h5pyd/_apps/utillib.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,8 @@ def create_dataset(dobj, ctx):
except (IOError, TypeError, KeyError) as e:
msg = "ERROR: failed to create dataset: {}".format(str(e))
logging.error(msg)
print(msg)
return

return dset
# create_dataset

#----------------------------------------------------------------------------------
Expand Down Expand Up @@ -583,6 +582,8 @@ def create_group(gobj, ctx):
logging.debug("adding group id {} to {} in srcid_desobj_map".format(gobj.id.id, grp))
srcid_desobj_map[gobj.id.__hash__()] = grp

return grp

# create_group

#----------------------------------------------------------------------------------
Expand Down Expand Up @@ -642,11 +643,11 @@ def object_helper(name, obj):
else:
class_name = obj.__class__.__name__
if class_name in ("Dataset", "Table"):
dset = self.create_dataset(name, obj)
dset = create_dataset(obj, ctx)

if dset is not None:
for da in obj.attrs:
self.copy_attribute(dset, da, obj)
copy_attribute(dset, da, obj, ctx)

if dataload == "ingest":
logging.debug("object_copy_helper for object: {}".format(obj.name))
Expand All @@ -658,19 +659,19 @@ def object_helper(name, obj):
write_dataset(obj, tgt, ctx)

elif class_name == "Group":
grp = self.create_group(name, obj)
grp = create_group(obj, ctx)

if grp is not None:
for ga in obj.attrs:
self.copy_attribute(grp, ga, obj)
copy_attribute(grp, ga, obj, ctx)

# create any soft/external links
logging.debug("object_link_helper for object: {}".format(obj.name))
fout = ctx["fout"]
grp = fout[name]
create_links(obj, grp, ctx)
elif class_name == "Datatype":
self.create_datatype(obj)
create_datatype(obj, ctx)
else:
logger.error("no handler for object class: {}"
.format(type(obj)))
Expand Down

0 comments on commit c05af35

Please sign in to comment.