Skip to content

Commit 4cd8f06

Browse files
Add APILayoutStrategy as fallback strategy (#666)
* add APILayoutStrategy as fallback * update changelog * fix(docs): changelog entry --------- Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
1 parent 2a34206 commit 4cd8f06

File tree

5 files changed

+422
-3
lines changed

5 files changed

+422
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- Updated to **pystac** v1.10.0 [#661](https://github.com/stac-utils/pystac-client/pull/661)
1313
- Use [uv](https://github.com/astral-sh/uv) for CI [#663](https://github.com/stac-utils/pystac-client/pull/663)
14+
- use `APILayoutStrategy` as fallback strategy [#666](https://github.com/stac-utils/pystac-client/pull/666)
1415

1516
## [v0.7.6]
1617

pystac_client/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pystac.utils
1818
import pystac.validation
1919
from pystac import CatalogType, Collection
20-
from pystac.layout import HrefLayoutStrategy
20+
from pystac.layout import APILayoutStrategy, HrefLayoutStrategy
2121
from requests import Request
2222

2323
from pystac_client._utils import Modifiable, call_modifier
@@ -62,6 +62,7 @@ class Client(pystac.Catalog, QueryablesMixin):
6262
"""
6363

6464
_stac_io: Optional[StacApiIO]
65+
_fallback_strategy: HrefLayoutStrategy = APILayoutStrategy()
6566

6667
def __init__(
6768
self,

pystac_client/collection_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515

1616
import pystac
17-
import pystac.layout
17+
from pystac.layout import APILayoutStrategy, HrefLayoutStrategy
1818

1919
from pystac_client._utils import Modifiable, call_modifier
2020
from pystac_client.conformance import ConformanceClasses
@@ -33,6 +33,7 @@
3333
class CollectionClient(pystac.Collection, QueryablesMixin):
3434
modifier: Callable[[Modifiable], None]
3535
_stac_io: StacApiIO
36+
_fallback_strategy: HrefLayoutStrategy = APILayoutStrategy()
3637

3738
def __init__(
3839
self,
@@ -49,7 +50,7 @@ def __init__(
4950
providers: Optional[List[pystac.Provider]] = None,
5051
summaries: Optional[pystac.Summaries] = None,
5152
assets: Optional[Dict[str, pystac.Asset]] = None,
52-
strategy: Optional[pystac.layout.HrefLayoutStrategy] = None,
53+
strategy: Optional[HrefLayoutStrategy] = None,
5354
*,
5455
modifier: Optional[Callable[[Modifiable], None]] = None,
5556
**kwargs: Dict[str, Any],

0 commit comments

Comments
 (0)