-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate generalized process filtering in workflow tests
- integrate generalized process selection in Skipper - port workflow tests - eliminate deprecated `process_levels` fixture
- Loading branch information
Showing
20 changed files
with
156 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import openeo | ||
import pytest | ||
from openeo import DataCube | ||
|
||
from openeo_test_suite.lib.skipping import extract_processes_from_process_graph | ||
|
||
|
||
def test_extract_processes_from_process_graph_basic(): | ||
pg = {"add35": {"process_id": "add", "arguments": {"x": 3, "y": 5}, "result": True}} | ||
assert extract_processes_from_process_graph(pg) == {"add"} | ||
|
||
|
||
@pytest.fixture | ||
def s2_cube() -> openeo.DataCube: | ||
return openeo.DataCube.load_collection( | ||
collection_id="S2", bands=["B02", "B03"], connection=None, fetch_metadata=False | ||
) | ||
|
||
|
||
def test_extract_processes_from_process_graph_cube_simple(s2_cube): | ||
assert extract_processes_from_process_graph(s2_cube) == {"load_collection"} | ||
|
||
|
||
def test_extract_processes_from_process_graph_cube_reduce_temporal(s2_cube): | ||
cube = s2_cube.reduce_temporal("mean") | ||
assert extract_processes_from_process_graph(cube) == { | ||
"load_collection", | ||
"reduce_dimension", | ||
"mean", | ||
} | ||
|
||
|
||
def test_extract_processes_from_process_graph_cube_reduce_bands(s2_cube): | ||
b2 = s2_cube.band("B02") | ||
b3 = s2_cube.band("B03") | ||
cube = (b3 - b2) / (b3 + b2) | ||
assert extract_processes_from_process_graph(cube) == { | ||
"load_collection", | ||
"reduce_dimension", | ||
"array_element", | ||
"subtract", | ||
"add", | ||
"divide", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.