Skip to content

Commit

Permalink
fix: renamed pystac advanced_client
Browse files Browse the repository at this point in the history
  • Loading branch information
jverrydt committed Oct 31, 2024
1 parent 6a819e4 commit b4278e5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions tests/test_advanced_pystac_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pytest

from titiler.pystac import AdvancedClient
from titiler.pystac import Client

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

Expand All @@ -19,7 +19,7 @@ def mock_stac_io():
@pytest.fixture
def client(mock_stac_io):
"""STAC client mock"""
client = AdvancedClient(id="pystac-client", description="pystac-client")
client = Client(id="pystac-client", description="pystac-client")

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


@patch(
"titiler.pystac.advanced_client.AdvancedClient.get_supported_aggregations",
"titiler.pystac.advanced_client.Client.get_supported_aggregations",
return_value=["datetime_frequency"],
)
def test_get_aggregation_unsupported(supported_aggregations, client):
Expand All @@ -58,7 +58,7 @@ def test_get_aggregation_unsupported(supported_aggregations, client):


@patch(
"titiler.pystac.advanced_client.AdvancedClient.get_supported_aggregations",
"titiler.pystac.advanced_client.Client.get_supported_aggregations",
return_value=["datetime_frequency"],
)
def test_get_aggregation(supported_aggregations, client, mock_stac_io):
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_get_aggregation(supported_aggregations, client, mock_stac_io):


@patch(
"titiler.pystac.advanced_client.AdvancedClient.get_supported_aggregations",
"titiler.pystac.advanced_client.Client.get_supported_aggregations",
return_value=["datetime_frequency"],
)
def test_get_aggregation_no_response(supported_aggregations, client, mock_stac_io):
Expand Down
4 changes: 2 additions & 2 deletions titiler/pystac/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""titiler.pystac"""

__all__ = [
"AdvancedClient",
"Client",
]

from titiler.pystac.advanced_client import AdvancedClient
from titiler.pystac.advanced_client import Client
8 changes: 4 additions & 4 deletions titiler/pystac/advanced_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This module provides an advanced client for interacting with STAC (SpatioTemporal Asset Catalog) APIs.
The `AdvancedClient` class extends the basic functionality of the `pystac.Client` to include
The `Client` class extends the basic functionality of the `pystac.Client` to include
methods for retrieving and aggregating data from STAC collections.
"""

Expand All @@ -10,11 +10,11 @@
from urllib.parse import urlencode

import pystac
from pystac_client import Client
import pystac_client


class AdvancedClient(Client):
"""AdvancedClient extends the basic functionality of the pystac.Client class."""
class Client(pystac_client.Client):
"""Client extends the basic functionality of the pystac.Client class."""

def get_aggregation(
self,
Expand Down
4 changes: 2 additions & 2 deletions titiler/stacapi/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from titiler.core.resources.responses import GeoJSONResponse, XMLResponse
from titiler.core.utils import render_image
from titiler.mosaic.factory import PixelSelectionParams
from titiler.pystac import AdvancedClient
from titiler.pystac import Client
from titiler.stacapi.backend import STACAPIBackend
from titiler.stacapi.dependencies import APIParams, STACApiParams, STACSearchParams
from titiler.stacapi.models import FeatureInfo, LayerDict
Expand Down Expand Up @@ -568,7 +568,7 @@ def get_layer_from_collections( # noqa: C901
),
headers=headers,
)
catalog = AdvancedClient.open(url, stac_io=stac_api_io)
catalog = Client.open(url, stac_io=stac_api_io)

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

0 comments on commit b4278e5

Please sign in to comment.