Skip to content

Commit 3d49658

Browse files
committed
pre-commit.
1 parent 25ff3e1 commit 3d49658

File tree

1 file changed

+36
-12
lines changed
  • stac_fastapi/types/stac_fastapi/types

1 file changed

+36
-12
lines changed

stac_fastapi/types/stac_fastapi/types/core.py

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ def json_patch_item(
176176
raise NotImplementedError("JSON Patch not implemented")
177177

178178
@abc.abstractmethod
179-
def delete_item(self, item_id: str, collection_id: str, **kwargs) -> Optional[Union[stac.Item, Response]]:
179+
def delete_item(
180+
self, item_id: str, collection_id: str, **kwargs
181+
) -> Optional[Union[stac.Item, Response]]:
180182
"""Delete an item from a collection.
181183
182184
Called with `DELETE /collections/{collection_id}/items/{item_id}`
@@ -191,7 +193,9 @@ def delete_item(self, item_id: str, collection_id: str, **kwargs) -> Optional[Un
191193
...
192194

193195
@abc.abstractmethod
194-
def create_collection(self, collection: Collection, **kwargs) -> Optional[Union[stac.Collection, Response]]:
196+
def create_collection(
197+
self, collection: Collection, **kwargs
198+
) -> Optional[Union[stac.Collection, Response]]:
195199
"""Create a new collection.
196200
197201
Called with `POST /collections`.
@@ -308,7 +312,9 @@ def json_patch_collection(
308312
...
309313

310314
@abc.abstractmethod
311-
def delete_collection(self, collection_id: str, **kwargs) -> Optional[Union[stac.Collection, Response]]:
315+
def delete_collection(
316+
self, collection_id: str, **kwargs
317+
) -> Optional[Union[stac.Collection, Response]]:
312318
"""Delete a collection.
313319
314320
Called with `DELETE /collections/{collection_id}`
@@ -461,7 +467,9 @@ async def json_patch_item(
461467
...
462468

463469
@abc.abstractmethod
464-
async def delete_item(self, item_id: str, collection_id: str, **kwargs) -> Optional[Union[stac.Item, Response]]:
470+
async def delete_item(
471+
self, item_id: str, collection_id: str, **kwargs
472+
) -> Optional[Union[stac.Item, Response]]:
465473
"""Delete an item from a collection.
466474
467475
Called with `DELETE /collections/{collection_id}/items/{item_id}`
@@ -476,7 +484,9 @@ async def delete_item(self, item_id: str, collection_id: str, **kwargs) -> Optio
476484
...
477485

478486
@abc.abstractmethod
479-
async def create_collection(self, collection: Collection, **kwargs) -> Optional[Union[stac.Collection, Response]]:
487+
async def create_collection(
488+
self, collection: Collection, **kwargs
489+
) -> Optional[Union[stac.Collection, Response]]:
480490
"""Create a new collection.
481491
482492
Called with `POST /collections`.
@@ -593,7 +603,9 @@ async def json_patch_collection(
593603
...
594604

595605
@abc.abstractmethod
596-
async def delete_collection(self, collection_id: str, **kwargs) -> Optional[Union[stac.Collection, Response]]:
606+
async def delete_collection(
607+
self, collection_id: str, **kwargs
608+
) -> Optional[Union[stac.Collection, Response]]:
597609
"""Delete a collection.
598610
599611
Called with `DELETE /collections/{collection_id}`
@@ -683,7 +695,9 @@ class BaseCoreClient(LandingPageMixin, abc.ABC):
683695
extensions: list of registered api extensions.
684696
"""
685697

686-
base_conformance_classes: List[str] = attr.ib(factory=lambda: BASE_CONFORMANCE_CLASSES)
698+
base_conformance_classes: List[str] = attr.ib(
699+
factory=lambda: BASE_CONFORMANCE_CLASSES
700+
)
687701
extensions: List[ApiExtension] = attr.ib(default=attr.Factory(list))
688702

689703
def conformance_classes(self) -> List[str]:
@@ -729,7 +743,9 @@ def landing_page(self, **kwargs) -> stac.LandingPage:
729743
)
730744

731745
# Add Queryables link
732-
if self.extension_is_enabled("FilterExtension") or self.extension_is_enabled("SearchFilterExtension"):
746+
if self.extension_is_enabled("FilterExtension") or self.extension_is_enabled(
747+
"SearchFilterExtension"
748+
):
733749
landing_page["links"].append(
734750
{
735751
"rel": Relations.queryables.value,
@@ -791,7 +807,9 @@ def conformance(self, **kwargs) -> stac.Conformance:
791807
return stac.Conformance(conformsTo=self.conformance_classes())
792808

793809
@abc.abstractmethod
794-
def post_search(self, search_request: BaseSearchPostRequest, **kwargs) -> stac.ItemCollection:
810+
def post_search(
811+
self, search_request: BaseSearchPostRequest, **kwargs
812+
) -> stac.ItemCollection:
795813
"""Cross catalog search (POST).
796814
797815
Called with `POST /search`.
@@ -897,7 +915,9 @@ class AsyncBaseCoreClient(LandingPageMixin, abc.ABC):
897915
extensions: list of registered api extensions.
898916
"""
899917

900-
base_conformance_classes: List[str] = attr.ib(factory=lambda: BASE_CONFORMANCE_CLASSES)
918+
base_conformance_classes: List[str] = attr.ib(
919+
factory=lambda: BASE_CONFORMANCE_CLASSES
920+
)
901921
extensions: List[ApiExtension] = attr.ib(default=attr.Factory(list))
902922

903923
def conformance_classes(self) -> List[str]:
@@ -933,7 +953,9 @@ async def landing_page(self, **kwargs) -> stac.LandingPage:
933953
)
934954

935955
# Add Queryables link
936-
if self.extension_is_enabled("FilterExtension") or self.extension_is_enabled("SearchFilterExtension"):
956+
if self.extension_is_enabled("FilterExtension") or self.extension_is_enabled(
957+
"SearchFilterExtension"
958+
):
937959
landing_page["links"].append(
938960
{
939961
"rel": Relations.queryables.value,
@@ -996,7 +1018,9 @@ async def conformance(self, **kwargs) -> stac.Conformance:
9961018
return stac.Conformance(conformsTo=self.conformance_classes())
9971019

9981020
@abc.abstractmethod
999-
async def post_search(self, search_request: BaseSearchPostRequest, **kwargs) -> stac.ItemCollection:
1021+
async def post_search(
1022+
self, search_request: BaseSearchPostRequest, **kwargs
1023+
) -> stac.ItemCollection:
10001024
"""Cross catalog search (POST).
10011025
10021026
Called with `POST /search`.

0 commit comments

Comments
 (0)