Skip to content

Commit

Permalink
Fixup black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Mar 4, 2024
1 parent e07d51f commit d26a009
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 26 deletions.
13 changes: 5 additions & 8 deletions conf/aggregator.dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"https://editor.openeo.cloud",
"http://localhost:1410/",
"https://editor.openeo.org",
]
],
}

_DEFAULT_EGI_SCOPES = [
Expand Down Expand Up @@ -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,
}
}
},
},
]
}
},
},
)
13 changes: 5 additions & 8 deletions conf/aggregator.prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"https://editor.openeo.cloud",
"http://localhost:1410/",
"https://editor.openeo.org",
]
],
}

_DEFAULT_EGI_SCOPES = [
Expand Down Expand Up @@ -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,
}
}
},
},
]
}
},
},
)
4 changes: 1 addition & 3 deletions scripts/crossbackend-processing-poc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
1 change: 1 addition & 0 deletions src/openeo_aggregator/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
openeo-aggregator Flask app
"""

import logging
import os
from pathlib import Path
Expand Down
6 changes: 2 additions & 4 deletions src/openeo_aggregator/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion src/openeo_aggregator/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/openeo_aggregator/metadata/merging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Functionality and tools for openEO collection/process metadata processing, normalizing, merging ...
"""

import difflib
import functools
import json
Expand Down
5 changes: 3 additions & 2 deletions src/openeo_aggregator/metadata/models/temporal_extent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d26a009

Please sign in to comment.