diff --git a/elasticai/creator/ir/__init__.py b/elasticai/creator/ir/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/elasticai/creator/ir/humble_base_graph.py b/elasticai/creator/ir/graph_delegate.py similarity index 96% rename from elasticai/creator/ir/humble_base_graph.py rename to elasticai/creator/ir/graph_delegate.py index 63751bbe..88a3b849 100644 --- a/elasticai/creator/ir/humble_base_graph.py +++ b/elasticai/creator/ir/graph_delegate.py @@ -4,7 +4,7 @@ HashableT = TypeVar("HashableT", bound=Hashable) -class HumbleBaseGraph(Generic[HashableT]): +class GraphDelegate(Generic[HashableT]): def __init__(self) -> None: """We keep successor and predecessor nodes just to allow for easier implementation. Currently, this implementation is not optimized for performance. @@ -14,7 +14,7 @@ def __init__(self) -> None: @staticmethod def from_dict(d: dict[HashableT, Iterable[HashableT]]): - g = HumbleBaseGraph() + g = GraphDelegate() for node, successors in d.items(): for s in successors: g.add_edge(node, s) diff --git a/elasticai/creator/ir/humble_base_graph_test.py b/elasticai/creator/ir/graph_delegate_test.py similarity index 88% rename from elasticai/creator/ir/humble_base_graph_test.py rename to elasticai/creator/ir/graph_delegate_test.py index 7e0a35de..4541bfe2 100644 --- a/elasticai/creator/ir/humble_base_graph_test.py +++ b/elasticai/creator/ir/graph_delegate_test.py @@ -1,9 +1,9 @@ +from .graph_delegate import GraphDelegate from .graph_iterators import bfs_iter_up, dfs_pre_order -from .humble_base_graph import HumbleBaseGraph def test_iterating_breadth_first_upwards(): - g = HumbleBaseGraph() + g = GraphDelegate() """ 0 | @@ -18,7 +18,7 @@ def test_iterating_breadth_first_upwards(): |/----+ 5 """ - g = HumbleBaseGraph.from_dict( + g = GraphDelegate.from_dict( { "0": ["1", "2"], "1": ["3"], @@ -37,7 +37,7 @@ def test_iterating_breadth_first_upwards(): def test_iterating_depth_first_preorder(): - g = HumbleBaseGraph() + g = GraphDelegate() """ 0 | @@ -52,7 +52,7 @@ def test_iterating_depth_first_preorder(): |/----+ 5 """ - g = HumbleBaseGraph.from_dict( + g = GraphDelegate.from_dict( { "0": ["1", "2"], "1": ["3"],