Skip to content

Commit b4278e5

Browse files
committed
fix: renamed pystac advanced_client
1 parent 6a819e4 commit b4278e5

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

tests/test_advanced_pystac_client.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

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

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

@@ -19,7 +19,7 @@ def mock_stac_io():
1919
@pytest.fixture
2020
def client(mock_stac_io):
2121
"""STAC client mock"""
22-
client = AdvancedClient(id="pystac-client", description="pystac-client")
22+
client = Client(id="pystac-client", description="pystac-client")
2323

2424
with open(catalog_json, "r") as f:
2525
catalog = json.loads(f.read())
@@ -42,7 +42,7 @@ def test_get_supported_aggregations(client, mock_stac_io):
4242

4343

4444
@patch(
45-
"titiler.pystac.advanced_client.AdvancedClient.get_supported_aggregations",
45+
"titiler.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.AdvancedClient.get_supported_aggregations",
61+
"titiler.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.AdvancedClient.get_supported_aggregations",
105+
"titiler.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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""titiler.pystac"""
22

33
__all__ = [
4-
"AdvancedClient",
4+
"Client",
55
]
66

7-
from titiler.pystac.advanced_client import AdvancedClient
7+
from titiler.pystac.advanced_client import Client

titiler/pystac/advanced_client.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
This module provides an advanced client for interacting with STAC (SpatioTemporal Asset Catalog) APIs.
33
4-
The `AdvancedClient` class extends the basic functionality of the `pystac.Client` to include
4+
The `Client` class extends the basic functionality of the `pystac.Client` to include
55
methods for retrieving and aggregating data from STAC collections.
66
"""
77

@@ -10,11 +10,11 @@
1010
from urllib.parse import urlencode
1111

1212
import pystac
13-
from pystac_client import Client
13+
import pystac_client
1414

1515

16-
class AdvancedClient(Client):
17-
"""AdvancedClient extends the basic functionality of the pystac.Client class."""
16+
class Client(pystac_client.Client):
17+
"""Client extends the basic functionality of the pystac.Client class."""
1818

1919
def get_aggregation(
2020
self,

titiler/stacapi/factory.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
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 AdvancedClient
47+
from titiler.pystac import Client
4848
from titiler.stacapi.backend import STACAPIBackend
4949
from titiler.stacapi.dependencies import APIParams, STACApiParams, STACSearchParams
5050
from titiler.stacapi.models import FeatureInfo, LayerDict
@@ -568,7 +568,7 @@ def get_layer_from_collections( # noqa: C901
568568
),
569569
headers=headers,
570570
)
571-
catalog = AdvancedClient.open(url, stac_io=stac_api_io)
571+
catalog = Client.open(url, stac_io=stac_api_io)
572572

573573
layers: Dict[str, LayerDict] = {}
574574
for collection in catalog.get_collections():

0 commit comments

Comments
 (0)