shnitsel.data.tree.child_support_functions#
Functions#
|
Helper function to find a new collision free key for a new child node |
|
Helper function to extract name candidates from arbitrary data |
Module Contents#
- find_child_key(existing_child_keys, new_child, default_prefix='child')#
Helper function to find a new collision free key for a new child node given the existing set of keys and the new node
Will first attempt to extract a name candidate from the node and then try to resolve potential name collisions by appending suffixes.
- Parameters:
- Returns:
A derived key that does not have any collisions in existing_child_keys and incorporates information from new_child if possible.
- Return type:
- Raises:
OverflowError – If no unused child name has been found after 1000 attempts.
- get_data_name_candidate(data, name_candidate=None)#
Helper function to extract name candidates from arbitrary data that could be stored in a Tree leave.