Skip to content

Commit

Permalink
Issue #15/#17 Add TODO notes about code structure and schema validation
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Jul 1, 2024
1 parent 56ed471 commit a4db8cf
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion openeo_udp/examples/max_ndvi/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from openeo.api.process import Parameter
from openeo.rest.udp import build_process_dict

# TODO: where to put reusable helpers? e.g. load description from README.md, dummy openeo connection, properly write to JSON file, ...
# TODO #15 where to put reusable helpers? e.g. load description from README.md, dummy openeo connection, properly write to JSON file, ...


def generate() -> dict:
Expand Down
2 changes: 1 addition & 1 deletion qa/tools/apex_algorithm_qa_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TODO: Flatten apex_algorithm_qa_tools to a single module and push as much functionality to https://github.com/ESA-APEx/esa-apex-toolbox-python
# TODO #15 Flatten apex_algorithm_qa_tools to a single module and push as much functionality to https://github.com/ESA-APEx/esa-apex-toolbox-python


__version__ = "0.0.1"
2 changes: 1 addition & 1 deletion qa/tools/apex_algorithm_qa_tools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from typing import Iterator

# TODO: Flatten apex_algorithm_qa_tools to a single module and push as much functionality to https://github.com/ESA-APEx/esa-apex-toolbox-python
# TODO #15 Flatten apex_algorithm_qa_tools to a single module and push as much functionality to https://github.com/ESA-APEx/esa-apex-toolbox-python


_log = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions qa/tools/apex_algorithm_qa_tools/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
_log = logging.getLogger(__name__)


# TODO: Flatten apex_algorithm_qa_tools to a single module and push as much functionality to https://github.com/ESA-APEx/esa-apex-toolbox-python
# TODO #15 Flatten apex_algorithm_qa_tools to a single module and push as much functionality to https://github.com/ESA-APEx/esa-apex-toolbox-python


@dataclasses.dataclass(kw_only=True)
Expand Down Expand Up @@ -53,12 +53,12 @@ def lint_benchmark_scenario(scenario: BenchmarkScenario):
Various sanity checks for scenario data.
To be used in unit tests and pre-commit hooks.
"""
# TODO #17 use JSON Schema based validation instead of ad-hoc checks?
# TODO integrate this as a pre-commit hook
# TODO raise descriptive exceptions instead of asserts?
assert re.match(r"^[a-zA-Z0-9_-]+$", scenario.id)
# TODO: proper allow-list of backends?
assert scenario.backend in ["openeofed.dataspace.copernicus.eu"]
# TODO: refactor this out to a more generic process graph validator? Or use an existing tool?
# TODO: more advanced process graph validation?
assert isinstance(scenario.process_graph, dict)
for node_id, node in scenario.process_graph.items():
Expand Down
2 changes: 1 addition & 1 deletion qa/unittests/tests/test_algorithm_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def test_lint_algorithm_catalog_json_file(path):
assert data["properties"]["type"] == "apex_algorithm"

assert "openeo-process" in {k["rel"] for k in data["links"]}
# TODO more checks
# TODO #17 more checks
2 changes: 1 addition & 1 deletion qa/unittests/tests/test_openeo_udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def test_lint_openeo_udp_json_file(path):
assert "description" in data
assert "parameters" in data
assert "process_graph" in data
# TODO more checks
# TODO #17 more checks
# TODO require a standardized openEO "type"? https://github.com/Open-EO/openeo-api/issues/539

0 comments on commit a4db8cf

Please sign in to comment.