modify_dependencies
#
- gufe.tokenization.modify_dependencies(obj: dict | list, modifier, is_mine, mode, top=True)#
- Parameters:
obj (Dict or List) – Dictionary or list to traverse. Assumes that only mappings are dict and only iterables are list, and that no gufe objects are in the keys of dicts
modifier (Callable[[GufeTokenizable], Any]) – Function that modifies any GufeTokenizable found
is_mine (Callable[Any, bool]) – Function that determines whether the given object should be subjected to the modifier
mode ({'encode', 'decode'}) – Whether this function is being used to encode a set of GufeTokenizable s or decode them from dict or key-encoded forms. Required to determine when to modify objects found in nested dict/list.
top (bool) – If True, skip modifying obj itself; needed for recursive use to avoid early stopping on obj.