Skip to content

Tree layout root_vertex=None check never reached #3420

Closed
@Nikhil-42

Description

@Nikhil-42

Description of bug / unexpected behavior

In graph.py::_tree_layout root_vertex is used before the corresponding check for None meaning the intended error message is never printed.

Expected behavior

When a Graph with layout="tree" is used without specifying a root node, the appropriate ValueError should be thrown.

How to reproduce the issue

Create a Graph object with the "tree" layout and do not specify a root node.

Code for reproducing the problem
from manim import *

class ChangeGraphLayout(Scene):
                def construct(self):
                    G = Graph([1, 2, 3, 4, 5], [(1, 2), (1, 3), (2, 4), (2, 5)], layout="tree")
                    self.wait()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions