Skip to content

Commit

Permalink
fixup! Issue #150 WIP more advanced pg splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Sep 13, 2024
1 parent 9746ffc commit e59043c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/openeo_aggregator/partitionedjobs/crossbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down
16 changes: 8 additions & 8 deletions tests/partitionedjobs/test_crossbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,22 +436,22 @@ 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

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(
Expand Down

0 comments on commit e59043c

Please sign in to comment.