def get_downstream_tree(x, strict, dir_layout=None, flat=0, verbose=0): dir_layout = rcParams[ 'dir_layout'] if dir_layout is None else dir_layout tree = _get_downstream_tree(x, strict, dir_layout, verbose) if flat: tree = list_flatten(tree) return tree
def get_downstream_nodes(x, strict, dir_layout=None, flat=0, verbose=0): dir_layout = rcParams[ 'dir_layout'] if dir_layout is None else dir_layout tree = _get_downstream_tree(x, strict, dir_layout, verbose) tree = tree_filter(tree, (Caller, )) tree = list_flatten(tree) if flat else tree return tree
def get_upstream_files(x, strict, dir_layout=None, flat=0): dir_layout = rcParams[ 'dir_layout'] if dir_layout is None else dir_layout tree = _get_upstream_tree(x, strict, dir_layout) tree = tree_filter(tree, (File, Prefix)) tree = list_flatten(tree) if flat else tree return tree
def _get_upstream_tree(lst, strict, dir_layout): verbose = 0 out = [] for x in list_flatten(lst): up_nodes = _get_upstream(x, strict, dir_layout) up_trees = _get_upstream_tree(up_nodes, strict, dir_layout) print('[11]', repr(x), up_nodes) if verbose else None out.append([x, up_trees]) return out
def get_upstream_tree(x, strict, dir_layout=None, flat=0): dir_layout = rcParams[ 'dir_layout'] if dir_layout is None else dir_layout tree = _get_upstream_tree(x, strict, dir_layout) tree = list_flatten(tree) if flat else tree return tree