Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Oct 31, 2023
1 parent f36eb3c commit 766718a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
10 changes: 7 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,18 @@ Note: Minor version `0.X.0` update might break the API, It's recommended to pin
print(items_list["next"]) # Next Offset
print(items_list["prev"]) # Previous Offset
```
- rename `catalog_dependency` attribute to `collections_dependency`

- move `/collections` QueryParameters in the `CatalogParams` dependency
- move the `collections_dependency` attribute from the `EndpointsFactory` to `OGCFeaturesFactory` class

- the `CatalogParams` now returns a `CollectionList` object
- move `/collections` QueryParameters in the `CollectionsParams` dependency

- rename `CatalogParams` to `CollectionsParams`

- the `CollectionsParams` now returns a `CollectionList` object

- move `s_intersects` and `t_intersects` functions from `tipg.factory` to `tipg.dependencies`

- move the `catalog_dependency` attribute from the `EndpointsFactory` to `OGCFeaturesFactory` class

## [0.4.4] - 2023-10-03

Expand Down
2 changes: 1 addition & 1 deletion tipg/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def CollectionParams(
)


def CatalogParams(
def CollectionsParams(
request: Request,
bbox_filter: Annotated[Optional[List[float]], Depends(bbox_query)],
datetime_filter: Annotated[Optional[List[str]], Depends(datetime_query)],
Expand Down
12 changes: 6 additions & 6 deletions tipg/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from tipg import model
from tipg.collections import Collection, CollectionList
from tipg.dependencies import (
CatalogParams,
CollectionParams,
CollectionsParams,
ItemsOutputType,
OutputType,
QueryablesOutputType,
Expand Down Expand Up @@ -331,8 +331,8 @@ def landing(
class OGCFeaturesFactory(EndpointsFactory):
"""OGC Features Endpoints Factory."""

# catalog dependency
catalog_dependency: Callable[..., CollectionList] = CatalogParams
# collections dependency
collections_dependency: Callable[..., CollectionList] = CollectionsParams

@property
def conforms_to(self) -> List[str]:
Expand Down Expand Up @@ -414,7 +414,7 @@ def collections(
request: Request,
collection_list: Annotated[
CollectionList,
Depends(self.catalog_dependency),
Depends(self.collections_dependency),
],
output_type: Annotated[
Optional[MediaType],
Expand Down Expand Up @@ -1819,7 +1819,7 @@ class Endpoints(EndpointsFactory):
"""OGC Features and Tiles Endpoints Factory."""

# OGC Features dependency
catalog_dependency: Callable[..., CollectionList] = CatalogParams
collections_dependency: Callable[..., CollectionList] = CollectionsParams

# OGC Tiles dependency
supported_tms: TileMatrixSets = default_tms
Expand All @@ -1846,7 +1846,7 @@ def links(self, request: Request) -> List[model.Link]:
def register_routes(self):
"""Register factory Routes."""
self.ogc_features = OGCFeaturesFactory(
catalog_dependency=self.catalog_dependency,
collections_dependency=self.collections_dependency,
collection_dependency=self.collection_dependency,
router_prefix=self.router_prefix,
templates=self.templates,
Expand Down

0 comments on commit 766718a

Please sign in to comment.