MCPcopy Create free account
hub / github.com/PyTables/PyTables / newdst_group

Function newdst_group

tables/scripts/ptrepack.py:30–46  ·  view source on GitHub ↗

Return a new destination group.

(dstfileh, dstgroup, title, filters)

Source from the content-addressed store, hash-verified

28
29
30def newdst_group(dstfileh, dstgroup, title, filters):
31 """Return a new destination group."""
32 group = dstfileh.root
33 # Now, create the new group. This works even if dstgroup == '/'
34 for nodename in dstgroup.split("/"):
35 if nodename == "":
36 continue
37 # First try if possible intermediate groups does already exist.
38 try:
39 group2 = dstfileh.get_node(group, nodename)
40 except tb.exceptions.NoSuchNodeError:
41 # The group does not exist. Create it.
42 group2 = dstfileh.create_group(
43 group, nodename, title=title, filters=filters
44 )
45 group = group2
46 return group
47
48
49def recreate_indexes(table, dstfileh, dsttable):

Callers 2

copy_leafFunction · 0.85
copy_childrenFunction · 0.85

Calls 2

create_groupMethod · 0.80
get_nodeMethod · 0.45

Tested by

no test coverage detected