From a95073d27ce0f8cb4699226173937dfe16c84b9e Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Mon, 15 Feb 2021 11:09:13 -0500 Subject: [PATCH] clean defaults --- CHANGES.md | 1 + titiler/endpoints/factory.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5317828e5..dfecdc558 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ * update `titiler.dependencies.AssetsBidxParams` to make `asset` a required parameter (https://github.com/developmentseed/titiler/pull/230 * the STAC `/info` endpoint now expect the `assets` parameter to be passed. To ge the list of available assets we added a new `/assets` endpoint within the tiler factory +* remove `COGReader` as default `reader` in `titiler.endpoints.factory.BaseTilerFactory` ## 0.1.0a14 (2021-01-05) diff --git a/titiler/endpoints/factory.py b/titiler/endpoints/factory.py index 55290265a..ae91118be 100644 --- a/titiler/endpoints/factory.py +++ b/titiler/endpoints/factory.py @@ -68,7 +68,7 @@ class BaseTilerFactory(metaclass=abc.ABCMeta): """BaseTiler Factory.""" - reader: Type[BaseReader] = COGReader + reader: Type[BaseReader] reader_options: Dict = field(default_factory=dict) # FastAPI router @@ -122,6 +122,9 @@ def url_for(self, request: Request, name: str, **path_params: Any) -> str: class TilerFactory(BaseTilerFactory): """Tiler Factory.""" + # Default reader is set to COGReader + reader: Type[BaseReader] = COGReader + # Endpoint Dependencies metadata_dependency: Type[DefaultDependency] = MetadataParams img_dependency: Type[DefaultDependency] = ImageParams @@ -925,7 +928,7 @@ class MosaicTilerFactory(BaseTilerFactory): needs a reader (MosaicBackend) and a dataset_reader (BaseReader). """ - reader: BaseBackend = MosaicBackend + reader: Type[BaseBackend] = MosaicBackend dataset_reader: Type[BaseReader] = COGReader # BaseBackend does not support other TMS than WebMercator