From e59043cc08b1fe7fa8fc6768e8471979f400ff30 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Fri, 13 Sep 2024 22:04:18 +0200 Subject: [PATCH] fixup! Issue #150 WIP more advanced pg splitting --- .../partitionedjobs/crossbackend.py | 1 - tests/partitionedjobs/test_crossbackend.py | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/openeo_aggregator/partitionedjobs/crossbackend.py b/src/openeo_aggregator/partitionedjobs/crossbackend.py index 83dd2e0..cddba4f 100644 --- a/src/openeo_aggregator/partitionedjobs/crossbackend.py +++ b/src/openeo_aggregator/partitionedjobs/crossbackend.py @@ -490,7 +490,6 @@ def from_edges( graph = { node_id: _FrozenNode( # Note that we just use node id as process id. Do we have better options here? - process_id=node_id, depends_on=frozenset(depends_on.get(node_id, [])), flows_to=frozenset(flows_to.get(node_id, [])), backend_candidates=( diff --git a/tests/partitionedjobs/test_crossbackend.py b/tests/partitionedjobs/test_crossbackend.py index 316c43c..6c647b5 100644 --- a/tests/partitionedjobs/test_crossbackend.py +++ b/tests/partitionedjobs/test_crossbackend.py @@ -436,9 +436,9 @@ def test_from_flat_graph_basic(self): assert sorted(graph.iter_nodes()) == [ ( "lc1", - _FrozenNode("load_collection", frozenset(), frozenset(["ndvi1"]), backend_candidates=frozenset(["b1"])), + _FrozenNode(frozenset(), frozenset(["ndvi1"]), backend_candidates=frozenset(["b1"])), ), - ("ndvi1", _FrozenNode("ndvi", frozenset(["lc1"]), frozenset([]), backend_candidates=None)), + ("ndvi1", _FrozenNode(frozenset(["lc1"]), frozenset([]), backend_candidates=None)), ] # TODO: test from_flat_graph with more complex graphs @@ -446,12 +446,12 @@ def test_from_flat_graph_basic(self): def test_from_edges(self): graph = _FrozenGraph.from_edges([("a", "c"), ("b", "d"), ("c", "e"), ("d", "e"), ("e", "f")]) assert sorted(graph.iter_nodes()) == [ - ("a", _FrozenNode("a", frozenset(), frozenset(["c"]), backend_candidates=None)), - ("b", _FrozenNode("b", frozenset(), frozenset(["d"]), backend_candidates=None)), - ("c", _FrozenNode("c", frozenset(["a"]), frozenset(["e"]), backend_candidates=None)), - ("d", _FrozenNode("d", frozenset(["b"]), frozenset(["e"]), backend_candidates=None)), - ("e", _FrozenNode("e", frozenset(["c", "d"]), frozenset("f"), backend_candidates=None)), - ("f", _FrozenNode("f", frozenset(["e"]), frozenset(), backend_candidates=None)), + ("a", _FrozenNode(frozenset(), frozenset(["c"]), backend_candidates=None)), + ("b", _FrozenNode(frozenset(), frozenset(["d"]), backend_candidates=None)), + ("c", _FrozenNode(frozenset(["a"]), frozenset(["e"]), backend_candidates=None)), + ("d", _FrozenNode(frozenset(["b"]), frozenset(["e"]), backend_candidates=None)), + ("e", _FrozenNode(frozenset(["c", "d"]), frozenset("f"), backend_candidates=None)), + ("f", _FrozenNode(frozenset(["e"]), frozenset(), backend_candidates=None)), ] @pytest.mark.parametrize(