diff --git a/functions/classes.py b/functions/classes.py index c13ad5bc9760ccf15b876563f6a04e9c5b8e1966..3b67ddc1deb6645527c6e8dae23f42f040ec21dc 100644 --- a/functions/classes.py +++ b/functions/classes.py @@ -435,8 +435,8 @@ def print_assembly_tree(root, levels=None): Args: root (LegoAssembly): The root of the assembly tree to print. - levels (List[bool]): Internally used by recursion to know where to print vertical connection. - Defaults to an empty list. + levels (List[bool]): Internally used by recursion to know where + to print vertical connection. Defaults to an empty list. """ if not isinstance(root, LegoAssembly): raise TypeError( @@ -459,6 +459,7 @@ def print_assembly_tree(root, levels=None): component_padding = "├── " if i < len(root.components) - 1 else "└── " print(f"{connection_padding}{component_padding}{component}") + def correct_aggregation_hierarchy(root: LegoAssembly, strict: bool = False): """ Recursively checks whether the aggregation hierarchy from `root` is correct.