Skip to content

Commit ac773ac

Browse files
committed
chore: move advanced stac client to submodule inside titiler.stacapi and removed _stac_io assertion
1 parent 1f95b97 commit ac773ac

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

tests/test_advanced_pystac_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from titiler.pystac import Client
8+
from titiler.stacapi.pystac import Client
99

1010
catalog_json = os.path.join(os.path.dirname(__file__), "fixtures", "catalog.json")
1111

@@ -42,7 +42,7 @@ def test_get_supported_aggregations(client, mock_stac_io):
4242

4343

4444
@patch(
45-
"titiler.pystac.advanced_client.Client.get_supported_aggregations",
45+
"titiler.stacapi.pystac.advanced_client.Client.get_supported_aggregations",
4646
return_value=["datetime_frequency"],
4747
)
4848
def test_get_aggregation_unsupported(supported_aggregations, client):
@@ -58,7 +58,7 @@ def test_get_aggregation_unsupported(supported_aggregations, client):
5858

5959

6060
@patch(
61-
"titiler.pystac.advanced_client.Client.get_supported_aggregations",
61+
"titiler.stacapi.pystac.advanced_client.Client.get_supported_aggregations",
6262
return_value=["datetime_frequency"],
6363
)
6464
def test_get_aggregation(supported_aggregations, client, mock_stac_io):
@@ -102,7 +102,7 @@ def test_get_aggregation(supported_aggregations, client, mock_stac_io):
102102

103103

104104
@patch(
105-
"titiler.pystac.advanced_client.Client.get_supported_aggregations",
105+
"titiler.stacapi.pystac.advanced_client.Client.get_supported_aggregations",
106106
return_value=["datetime_frequency"],
107107
)
108108
def test_get_aggregation_no_response(supported_aggregations, client, mock_stac_io):

titiler/pystac/__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

titiler/stacapi/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
from titiler.core.resources.responses import GeoJSONResponse, XMLResponse
4545
from titiler.core.utils import render_image
4646
from titiler.mosaic.factory import PixelSelectionParams
47-
from titiler.pystac import Client
4847
from titiler.stacapi.backend import STACAPIBackend
4948
from titiler.stacapi.dependencies import APIParams, STACApiParams, STACSearchParams
5049
from titiler.stacapi.models import FeatureInfo, LayerDict
50+
from titiler.stacapi.pystac import Client
5151
from titiler.stacapi.settings import CacheSettings, RetrySettings
5252
from titiler.stacapi.utils import _tms_limits
5353

titiler/stacapi/pystac/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""titiler.pystac"""
2+
3+
__all__ = [
4+
"Client",
5+
]
6+
7+
from titiler.stacapi.pystac.advanced_client import Client

titiler/pystac/advanced_client.py renamed to titiler/stacapi/pystac/advanced_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ def get_aggregation(
3131
Returns:
3232
List[str]: The aggregation response.
3333
"""
34-
assert self._stac_io is not None
35-
3634
if aggregation not in self.get_supported_aggregations():
3735
warnings.warn(
3836
f"Aggregation type {aggregation} is not supported", stacklevel=1

0 commit comments

Comments
 (0)