[Git][debian-gis-team/pystac-client][upstream] New upstream version 0.8.2

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Jun 1 16:50:23 BST 2024



Antonio Valentino pushed to branch upstream at Debian GIS Project / pystac-client


Commits:
11757061 by Antonio Valentino at 2024-06-01T15:39:40+00:00
New upstream version 0.8.2
- - - - -


6 changed files:

- .pre-commit-config.yaml
- CHANGELOG.md
- pyproject.toml
- pystac_client/item_search.py
- pystac_client/version.py
- tests/test_item_search.py


Changes:

=====================================
.pre-commit-config.yaml
=====================================
@@ -3,7 +3,7 @@
 
 repos:
   - repo: https://github.com/charliermarsh/ruff-pre-commit
-    rev: "v0.4.5"
+    rev: "v0.4.6"
     hooks:
       - id: ruff
         args: [--fix, --exit-non-zero-on-fix]
@@ -12,7 +12,7 @@ repos:
     hooks:
       - id: black
   - repo: https://github.com/codespell-project/codespell
-    rev: v2.2.6
+    rev: v2.3.0
     hooks:
       - id: codespell
         args: [--ignore-words=.codespellignore]


=====================================
CHANGELOG.md
=====================================
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 ## [Unreleased]
 
+## [v0.8.2] - 2024-05-30
+
+### Added
+
+- Support for "Feature" type `intersects` dictionaries [#696](https://github.com/stac-utils/pystac-client/pull/696)
+
 ## [v0.8.1] - 2024-05-23
 
 ### Fixed
@@ -372,7 +378,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 Initial release.
 
-[Unreleased]: https://github.com/stac-utils/pystac-client/compare/v0.8.1...main
+[Unreleased]: https://github.com/stac-utils/pystac-client/compare/v0.8.2...main
+[v0.8.2]: https://github.com/stac-utils/pystac-client/compare/v0.8.1...v0.8.2
 [v0.8.1]: https://github.com/stac-utils/pystac-client/compare/v0.8.0...v0.8.1
 [v0.8.0]: https://github.com/stac-utils/pystac-client/compare/v0.7.7...v0.8.0
 [v0.7.7]: https://github.com/stac-utils/pystac-client/compare/v0.7.6...v0.7.7


=====================================
pyproject.toml
=====================================
@@ -39,7 +39,7 @@ stac-client = "pystac_client.cli:cli"
 [project.optional-dependencies]
 dev = [
     "black~=24.0",
-    "codespell~=2.2.4",
+    "codespell~=2.3.0",
     "coverage~=7.2",
     "doc8~=1.1.1",
     "importlib-metadata~=7.0",
@@ -53,7 +53,7 @@ dev = [
     "pytest~=8.0",
     "recommonmark~=0.7.1",
     "requests-mock~=1.12",
-    "ruff==0.4.5",
+    "ruff==0.4.6",
     "tomli~=2.0; python_version<'3.11'",
     "types-python-dateutil>=2.8.19,<2.10.0",
     "types-requests~=2.31.0",


=====================================
pystac_client/item_search.py
=====================================
@@ -179,11 +179,10 @@ class ItemSearch:
         bbox: A list, tuple, or iterator representing a bounding box of 2D
             or 3D coordinates. Results will be filtered
             to only those intersecting the bounding box.
-        intersects: A string or dictionary representing a GeoJSON geometry, or
-            an object that implements a
-            ``__geo_interface__`` property, as supported by several libraries
-            including Shapely, ArcPy, PySAL, and
-            geojson. Results filtered to only those intersecting the geometry.
+        intersects: A string or dictionary representing a GeoJSON geometry or feature,
+            or an object that implements a ``__geo_interface__`` property, as supported
+            by several libraries including Shapely, ArcPy, PySAL, and geojson. Results
+            filtered to only those intersecting the geometry.
         datetime: Either a single datetime or datetime range used to filter results.
             You may express a single datetime using a :class:`datetime.datetime`
             instance, a `RFC 3339-compliant <https://tools.ietf.org/html/rfc3339>`__
@@ -646,7 +645,10 @@ class ItemSearch:
         if value is None:
             return None
         if isinstance(value, dict):
-            return deepcopy(value)
+            if value.get("type") == "Feature":
+                return deepcopy(value.get("geometry"))
+            else:
+                return deepcopy(value)
         if isinstance(value, str):
             return dict(json.loads(value))
         if hasattr(value, "__geo_interface__"):


=====================================
pystac_client/version.py
=====================================
@@ -1 +1 @@
-__version__ = "0.8.1"
+__version__ = "0.8.2"


=====================================
tests/test_item_search.py
=====================================
@@ -850,3 +850,17 @@ def test_fields() -> None:
     assert "geometry" not in item
     assert "assets" not in item
     assert "links" not in item
+
+
+def test_feature() -> None:
+    search = ItemSearch(
+        url="https://earth-search.aws.element84.com/v1/search",
+        intersects={
+            "type": "Feature",
+            "geometry": {"type": "Point", "coordinates": [-105.1019, 40.1672]},
+        },
+    )
+    assert search.get_parameters()["intersects"] == {
+        "type": "Point",
+        "coordinates": [-105.1019, 40.1672],
+    }



View it on GitLab: https://salsa.debian.org/debian-gis-team/pystac-client/-/commit/11757061516f4c4803cddd9c892923969a5e6064

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/debian-gis-team/pystac-client/-/commit/11757061516f4c4803cddd9c892923969a5e6064
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240601/de95acb7/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list