Skip to content

Commit

Permalink
EP-3509 insert DriverDataCube class in ImageCollection hierarchy
Browse files Browse the repository at this point in the history
preparation for larger process graph processing refactor
preparation for Open-EO/openeo-python-client#100
  • Loading branch information
soxofaan committed Oct 6, 2020
1 parent 08d3be6 commit c516278
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions openeo_driver/ProcessGraphDeserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from openeo.capabilities import ComparableVersion
from openeo.metadata import MetadataException
from openeo_driver.backend import get_backend_implementation, UserDefinedProcessMetadata
from openeo_driver.datacube import DriverDataCube
from openeo_driver.delayed_vector import DelayedVector
from openeo_driver.errors import ProcessParameterRequiredException, \
ProcessParameterInvalidException
Expand Down
6 changes: 3 additions & 3 deletions openeo_driver/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from pathlib import Path
from typing import List, Union, NamedTuple, Dict

from openeo import ImageCollection
from openeo.internal.process_graph_visitor import ProcessGraphVisitor
from openeo.util import rfc3339
from openeo_driver.datacube import DriverDataCube
from openeo_driver.errors import CollectionNotFoundException, ServiceUnsupportedException
from openeo_driver.utils import read_json, EvalEnv

Expand Down Expand Up @@ -154,7 +154,7 @@ def get_collection_metadata(self, collection_id: str) -> dict:
"""
return self._get(collection_id=collection_id)

def load_collection(self, collection_id: str, viewing_parameters: dict) -> ImageCollection:
def load_collection(self, collection_id: str, viewing_parameters: dict) -> DriverDataCube:
raise NotImplementedError


Expand Down Expand Up @@ -379,7 +379,7 @@ def file_formats(self) -> dict:
"""
return {"input": {}, "output": {}}

def load_disk_data(self, format: str, glob_pattern: str, options: dict, viewing_parameters: dict) -> object:
def load_disk_data(self, format: str, glob_pattern: str, options: dict, viewing_parameters: dict) -> DriverDataCube:
# TODO: move this to catalog "microservice"
raise NotImplementedError

Expand Down
8 changes: 8 additions & 0 deletions openeo_driver/datacube.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from openeo.metadata import CollectionMetadata


class DriverDataCube:
"""Base class for "driver" side data cubes."""

def __init__(self, metadata: CollectionMetadata = None):
self.metadata = metadata if isinstance(metadata, CollectionMetadata) else CollectionMetadata(metadata or {})

0 comments on commit c516278

Please sign in to comment.