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

Method __init__

tables/group.py:1139–1181  ·  view source on GitHub ↗
(
        self, ptfile: File, name: str, title: str, new: bool, filters: Filters
    )

Source from the content-addressed store, hash-verified

1137 """Root Group."""
1138
1139 def __init__(
1140 self, ptfile: File, name: str, title: str, new: bool, filters: Filters
1141 ) -> None:
1142 mydict = self.__dict__
1143
1144 # Set group attributes.
1145 self._v_version = obversion
1146 self._v_new = new
1147 if new:
1148 self._v_new_title = title
1149 self._v_new_filters = filters
1150 else:
1151 self._v_new_title = None
1152 self._v_new_filters = None
1153
1154 # Set node attributes.
1155 self._v_file = ptfile
1156 self._v_isopen = True # root is always open
1157 self._v_pathname = "/"
1158 self._v_name = "/"
1159 self._v_depth = 0
1160 self._v_max_group_width = ptfile.params["MAX_GROUP_WIDTH"]
1161 self._v__deleting = False
1162 self._v_objectid: int | None = None # later
1163
1164 # Only the root node has the file as a parent.
1165 # Bypass __setattr__ to avoid the ``Node._v_parent`` property.
1166 mydict["_v_parent"] = ptfile
1167 ptfile._node_manager.register_node(self, "/")
1168
1169 # hdf5extension operations (do before setting an AttributeSet):
1170 # Update node attributes.
1171 self._g_new(ptfile, name, init=True)
1172 # Open the node and get its object ID.
1173 self._v_objectid = self._g_open()
1174
1175 # Set disk attributes and read children names.
1176 #
1177 # This *must* be postponed because this method needs the root node
1178 # to be created and bound to ``File.root``.
1179 # This is an exception to the rule, handled by ``File.__init()__``.
1180 #
1181 # self._g_post_init_hook()
1182
1183 def _g_load_child(
1184 self,

Callers

nothing calls this directly

Calls 3

register_nodeMethod · 0.80
_g_newMethod · 0.80
_g_openMethod · 0.45

Tested by

no test coverage detected