diff --git a/conf/aggregator.dev.py b/conf/aggregator.dev.py index 89bd12e0..d6ea4602 100644 --- a/conf/aggregator.dev.py +++ b/conf/aggregator.dev.py @@ -13,7 +13,7 @@ "https://editor.openeo.cloud", "http://localhost:1410/", "https://editor.openeo.org", - ] + ], } _DEFAULT_EGI_SCOPES = [ @@ -64,18 +64,15 @@ "type": "chained", "config": { "parts": [ - { - "type": "dict", - "config": {"default_ttl": 5 * 60} - }, + {"type": "dict", "config": {"default_ttl": 5 * 60}}, { "type": "zookeeper", "config": { "zk_hosts": ZK_HOSTS, "default_ttl": 24 * 60 * 60, - } - } + }, + }, ] - } + }, }, ) diff --git a/conf/aggregator.prod.py b/conf/aggregator.prod.py index 73a2d0a3..1de2021c 100644 --- a/conf/aggregator.prod.py +++ b/conf/aggregator.prod.py @@ -13,7 +13,7 @@ "https://editor.openeo.cloud", "http://localhost:1410/", "https://editor.openeo.org", - ] + ], } _DEFAULT_EGI_SCOPES = [ @@ -56,18 +56,15 @@ "type": "chained", "config": { "parts": [ - { - "type": "dict", - "config": {"default_ttl": 5 * 60} - }, + {"type": "dict", "config": {"default_ttl": 5 * 60}}, { "type": "zookeeper", "config": { "zk_hosts": ZK_HOSTS, "default_ttl": 24 * 60 * 60, - } - } + }, + }, ] - } + }, }, ) diff --git a/scripts/crossbackend-processing-poc.py b/scripts/crossbackend-processing-poc.py index 3d2f7b01..e8b83e57 100644 --- a/scripts/crossbackend-processing-poc.py +++ b/scripts/crossbackend-processing-poc.py @@ -62,9 +62,7 @@ def backend_for_collection(collection_id) -> str: metadata = connection.describe_collection(collection_id) return metadata["summaries"][STAC_PROPERTY_FEDERATION_BACKENDS][0] - splitter = CrossBackendSplitter( - backend_for_collection=backend_for_collection, always_split=True - ) + splitter = CrossBackendSplitter(backend_for_collection=backend_for_collection, always_split=True) pjob: PartitionedJob = splitter.split({"process_graph": process_graph}) _log.info(f"Partitioned job: {pjob!r}") diff --git a/src/openeo_aggregator/app.py b/src/openeo_aggregator/app.py index 0cf0a098..a4cb7514 100644 --- a/src/openeo_aggregator/app.py +++ b/src/openeo_aggregator/app.py @@ -1,6 +1,7 @@ """ openeo-aggregator Flask app """ + import logging import os from pathlib import Path diff --git a/src/openeo_aggregator/caching.py b/src/openeo_aggregator/caching.py index 72d693a2..d9b5ded3 100644 --- a/src/openeo_aggregator/caching.py +++ b/src/openeo_aggregator/caching.py @@ -123,12 +123,10 @@ def __init__(self, namespace: str = DEFAULT_NAMESPACE): self._namespace = namespace @abc.abstractmethod - def get_or_call(self, key: CacheKey, callback: Callable[[], Any], ttl: Optional[float] = None) -> Any: - ... + def get_or_call(self, key: CacheKey, callback: Callable[[], Any], ttl: Optional[float] = None) -> Any: ... @abc.abstractmethod - def invalidate(self): - ... + def invalidate(self): ... def wrap(self, key: CacheKey, ttl: Optional[float] = None): """Wrapper to use memoizer as function/method decorator.""" diff --git a/src/openeo_aggregator/connection.py b/src/openeo_aggregator/connection.py index 1a1b8541..e799d663 100644 --- a/src/openeo_aggregator/connection.py +++ b/src/openeo_aggregator/connection.py @@ -258,7 +258,7 @@ def from_config() -> "MultiBackendConnection": def _get_connections(self, skip_failures=False) -> Iterator[BackendConnection]: """Create new backend connections.""" - for (bid, url) in self._backend_urls.items(): + for bid, url in self._backend_urls.items(): try: _log.info(f"Create backend {bid!r} connection to {url!r}") # TODO: Creating connection usually involves version discovery and request of capability doc. diff --git a/src/openeo_aggregator/metadata/merging.py b/src/openeo_aggregator/metadata/merging.py index aa4e62fb..b7f0a277 100644 --- a/src/openeo_aggregator/metadata/merging.py +++ b/src/openeo_aggregator/metadata/merging.py @@ -3,6 +3,7 @@ Functionality and tools for openEO collection/process metadata processing, normalizing, merging ... """ + import difflib import functools import json diff --git a/src/openeo_aggregator/metadata/models/temporal_extent.py b/src/openeo_aggregator/metadata/models/temporal_extent.py index 8f3c0435..6c4f909c 100644 --- a/src/openeo_aggregator/metadata/models/temporal_extent.py +++ b/src/openeo_aggregator/metadata/models/temporal_extent.py @@ -35,8 +35,9 @@ def to_dict(self) -> Dict[str, Any]: for interval_item_data in self.interval: interval_item = [] for interval_item_item_data in interval_item_data: - interval_item_item = interval_item_item_data.isoformat().replace("+00:00", "Z") \ - if interval_item_item_data else None + interval_item_item = ( + interval_item_item_data.isoformat().replace("+00:00", "Z") if interval_item_item_data else None + ) interval_item.append(interval_item_item) interval.append(interval_item)