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

Method iter_nodes

tables/file.py:2205–2229  ·  view source on GitHub ↗

Iterate over children nodes hanging from where. Parameters ---------- where This argument works as in :meth:`File.get_node`, referencing the node to be acted upon. classname If the name of a class derived from Node (see

(
        self, where: Node | str, classname: str | None = None
    )

Source from the content-addressed store, hash-verified

2203 return group._f_list_nodes(classname)
2204
2205 def iter_nodes(
2206 self, where: Node | str, classname: str | None = None
2207 ) -> Generator[Node]:
2208 """Iterate over children nodes hanging from where.
2209
2210 Parameters
2211 ----------
2212 where
2213 This argument works as in :meth:`File.get_node`, referencing the
2214 node to be acted upon.
2215 classname
2216 If the name of a class derived from
2217 Node (see :ref:`NodeClassDescr`) is supplied, only instances of
2218 that class (or subclasses of it) will be returned.
2219
2220 Notes
2221 -----
2222 The returned nodes are alphanumerically sorted by their name.
2223 This is an iterator version of :meth:`File.list_nodes`.
2224
2225 """
2226 group = self.get_node(where) # Does the parent exist?
2227 self._check_group(group) # Is it a group?
2228
2229 return group._f_iter_nodes(classname)
2230
2231 def __contains__(self, path: str) -> bool:
2232 """Return True if there is a node with the specified path.

Callers 4

walk_nodesMethod · 0.95
test02b_iterNodesMethod · 0.80

Calls 3

get_nodeMethod · 0.95
_check_groupMethod · 0.95
_f_iter_nodesMethod · 0.80

Tested by 3

test02b_iterNodesMethod · 0.64