Copilot commented on code in PR #2191:
URL: https://github.com/apache/sedona/pull/2191#discussion_r2241133474
##########
python/sedona/spark/stac/collection_client.py:
##########
@@ -377,25 +374,23 @@ def get_dataframe(
optional spatial and temporal filters to the data. The spatial filter
is applied using
a bounding box, and the temporal filter is applied using a date-time
range.
- Parameters:
- - bbox (Optional[list]): A list of bounding boxes for filtering the
items.
- Each bounding box is represented as a list of four float values:
[min_lon, min_lat, max_lon, max_lat].
- Example: [[-180.0, -90.0, 180.0, 90.0]] # This bounding box covers
the entire world.
- - geometry (Optional[Union[str, BaseGeometry, List[Union[str,
BaseGeometry]]]]): Shapely geometry object(s) or WKT string(s) for spatial
filtering.
- Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
- If both bbox and geometry are provided, geometry takes precedence.
- Example: Polygon(...) or "POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))" or
[Polygon(...), Polygon(...)]
- - datetime (Optional[Union[str, python_datetime.datetime, list]]): A
single datetime, RFC 3339-compliant timestamp,
- or a list of date-time ranges for filtering the items.
- Example: "2020-01-01T00:00:00Z" or python_datetime.datetime(2020, 1,
1) or [["2020-01-01T00:00:00Z", "2021-01-01T00:00:00Z"]]
-
- Returns:
- - DataFrame: A Spark DataFrame containing the filtered items. If no
filters are provided,
- the DataFrame contains all items in the collection.
-
- Raises:
- - RuntimeError: If there is an error loading the data or applying the
filters, a RuntimeError
- is raised with a message indicating the failure.
+ :param ids: A variable number of item IDs to filter the items.
+ Example: "item_id1" or ["item_id1", "item_id2"]
+ :param bbox: A list of bounding boxes for filtering the items.
+ Each bounding box is represented as a list of four float values:
[min_lon, min_lat, max_lon, max_lat].
+ Example: [[-180.0, -90.0, 180.0, 90.0]] # This bounding box
covers the entire world.
+ :param geometry: Shapely geometry object(s) or WKT string(s) for
spatial filtering.
+ Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
Review Comment:
The parameter description spans multiple lines but lacks proper Sphinx
indentation. The continuation lines should be indented to align with the
parameter description.
##########
python/sedona/spark/stac/client.py:
##########
@@ -88,39 +80,32 @@ def search(
"""
Searches for items in the specified collection with optional filters.
- Parameters:
- - ids (Union[str, list]): A variable number of item IDs to filter the
items.
- Example: "item_id1" or ["item_id1", "item_id2"]
-
- - collection_id (Optional[str]): The ID of the collection to search in.
- Example: "aster-l1t"
-
- - bbox (Optional[list]): A list of bounding boxes for filtering the
items.
- Each bounding box is represented as a list of four float values:
[min_lon, min_lat, max_lon, max_lat].
- Example: [[-180.0, -90.0, 180.0, 90.0]] # This bounding box covers
the entire world.
-
- - geometry (Optional[Union[str, BaseGeometry, List[Union[str,
BaseGeometry]]]]): Shapely geometry object(s) or WKT string(s) for spatial
filtering.
- Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
- If both bbox and geometry are provided, geometry takes precedence.
- Example: Polygon(...) or "POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))" or
[Polygon(...), Polygon(...)]
-
- - datetime (Optional[Union[str, python_datetime.datetime, list]]): A
single datetime, RFC 3339-compliant timestamp,
- or a list of date-time ranges for filtering the items. The datetime
can be specified in various formats:
- - "YYYY" expands to ["YYYY-01-01T00:00:00Z", "YYYY-12-31T23:59:59Z"]
- - "YYYY-mm" expands to ["YYYY-mm-01T00:00:00Z",
"YYYY-mm-<last_day>T23:59:59Z"]
- - "YYYY-mm-dd" expands to ["YYYY-mm-ddT00:00:00Z",
"YYYY-mm-ddT23:59:59Z"]
- - "YYYY-mm-ddTHH:MM:SSZ" remains as ["YYYY-mm-ddTHH:MM:SSZ",
"YYYY-mm-ddTHH:MM:SSZ"]
- - A list of date-time ranges can be provided for multiple intervals.
- Example: "2020-01-01T00:00:00Z" or python_datetime.datetime(2020, 1,
1) or [["2020-01-01T00:00:00Z", "2021-01-01T00:00:00Z"]]
-
- - max_items (Optional[int]): The maximum number of items to return
from the search, even if there are more matching results.
- Example: 100
-
- - return_dataframe (bool): If True, return the result as a Spark
DataFrame instead of an iterator of PyStacItem objects.
- Example: True
-
- Returns:
- - Union[Iterator[PyStacItem], DataFrame]: An iterator of PyStacItem
objects or a Spark DataFrame that match the specified filters.
+ :param ids: A variable number of item IDs to filter the items.
+ Example: "item_id1" or ["item_id1", "item_id2"]
+ :param collection_id: The ID of the collection to search in.
+ Example: "aster-l1t"
+ :param bbox: A list of bounding boxes for filtering the items.
+ Each bounding box is represented as a list of four float values:
[min_lon, min_lat, max_lon, max_lat].
+ Example: [[-180.0, -90.0, 180.0, 90.0]] # This bounding box
covers the entire world.
+ :param geometry: Shapely geometry object(s) or WKT string(s) for
spatial filtering.
+ Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
Review Comment:
The parameter description spans multiple lines but lacks proper Sphinx
indentation. The continuation lines should be indented to align with the
parameter description.
##########
python/sedona/spark/stac/client.py:
##########
@@ -88,39 +80,32 @@ def search(
"""
Searches for items in the specified collection with optional filters.
- Parameters:
- - ids (Union[str, list]): A variable number of item IDs to filter the
items.
- Example: "item_id1" or ["item_id1", "item_id2"]
-
- - collection_id (Optional[str]): The ID of the collection to search in.
- Example: "aster-l1t"
-
- - bbox (Optional[list]): A list of bounding boxes for filtering the
items.
- Each bounding box is represented as a list of four float values:
[min_lon, min_lat, max_lon, max_lat].
- Example: [[-180.0, -90.0, 180.0, 90.0]] # This bounding box covers
the entire world.
-
- - geometry (Optional[Union[str, BaseGeometry, List[Union[str,
BaseGeometry]]]]): Shapely geometry object(s) or WKT string(s) for spatial
filtering.
- Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
- If both bbox and geometry are provided, geometry takes precedence.
- Example: Polygon(...) or "POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))" or
[Polygon(...), Polygon(...)]
-
- - datetime (Optional[Union[str, python_datetime.datetime, list]]): A
single datetime, RFC 3339-compliant timestamp,
- or a list of date-time ranges for filtering the items. The datetime
can be specified in various formats:
- - "YYYY" expands to ["YYYY-01-01T00:00:00Z", "YYYY-12-31T23:59:59Z"]
- - "YYYY-mm" expands to ["YYYY-mm-01T00:00:00Z",
"YYYY-mm-<last_day>T23:59:59Z"]
- - "YYYY-mm-dd" expands to ["YYYY-mm-ddT00:00:00Z",
"YYYY-mm-ddT23:59:59Z"]
- - "YYYY-mm-ddTHH:MM:SSZ" remains as ["YYYY-mm-ddTHH:MM:SSZ",
"YYYY-mm-ddTHH:MM:SSZ"]
- - A list of date-time ranges can be provided for multiple intervals.
- Example: "2020-01-01T00:00:00Z" or python_datetime.datetime(2020, 1,
1) or [["2020-01-01T00:00:00Z", "2021-01-01T00:00:00Z"]]
-
- - max_items (Optional[int]): The maximum number of items to return
from the search, even if there are more matching results.
- Example: 100
-
- - return_dataframe (bool): If True, return the result as a Spark
DataFrame instead of an iterator of PyStacItem objects.
- Example: True
-
- Returns:
- - Union[Iterator[PyStacItem], DataFrame]: An iterator of PyStacItem
objects or a Spark DataFrame that match the specified filters.
+ :param ids: A variable number of item IDs to filter the items.
+ Example: "item_id1" or ["item_id1", "item_id2"]
+ :param collection_id: The ID of the collection to search in.
+ Example: "aster-l1t"
+ :param bbox: A list of bounding boxes for filtering the items.
+ Each bounding box is represented as a list of four float values:
[min_lon, min_lat, max_lon, max_lat].
+ Example: [[-180.0, -90.0, 180.0, 90.0]] # This bounding box
covers the entire world.
+ :param geometry: Shapely geometry object(s) or WKT string(s) for
spatial filtering.
+ Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
+ If both bbox and geometry are provided, geometry takes precedence.
+ Example: Polygon(...) or "POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))" or
[Polygon(...), Polygon(...)]
+ :param datetime: A single datetime, RFC 3339-compliant timestamp,
+ or a list of date-time ranges for filtering the items. The
datetime can be specified in various formats:
+
+ - "YYYY" expands to ["YYYY-01-01T00:00:00Z",
"YYYY-12-31T23:59:59Z"]
+ - "YYYY-mm" expands to ["YYYY-mm-01T00:00:00Z",
"YYYY-mm-<last_day>T23:59:59Z"]
+ - "YYYY-mm-dd" expands to ["YYYY-mm-ddT00:00:00Z",
"YYYY-mm-ddT23:59:59Z"]
+ - "YYYY-mm-ddTHH:MM:SSZ" remains as ["YYYY-mm-ddTHH:MM:SSZ",
"YYYY-mm-ddTHH:MM:SSZ"]
+ - A list of date-time ranges can be provided for multiple
intervals.
Review Comment:
The bullet point list within the parameter description should maintain
consistent indentation. This line should be indented to align with the other
bullet points above it.
```suggestion
- A list of date-time ranges can be provided for multiple intervals.
```
##########
python/sedona/spark/stac/collection_client.py:
##########
@@ -325,23 +325,20 @@ def get_items(
Returns an iterator of items. Each item has the supplied item ID
and/or optional spatial and temporal extents.
This method loads the collection data from the specified collection
URL and applies
- optional filters to the data. The filters include:
- - IDs: A list of item IDs to filter the items. If not provided, no ID
filtering is applied.
- - bbox (Optional[list]): A list of bounding boxes for filtering the
items.
- - geometry (Optional[Union[str, BaseGeometry, List[Union[str,
BaseGeometry]]]]): Shapely geometry object(s) or WKT string(s) for spatial
filtering.
- Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
- If both bbox and geometry are provided, geometry takes precedence.
- - datetime (Optional[Union[str, python_datetime.datetime, list]]): A
single datetime, RFC 3339-compliant timestamp,
- or a list of date-time ranges for filtering the items.
- - max_items (Optional[int]): The maximum number of items to return
from the search, even if there are more matching results.
-
- Returns:
- - Iterator[PyStacItem]: An iterator of PyStacItem objects that match
the specified filters.
- If no filters are provided, the iterator contains all items in the
collection.
-
- Raises:
- - RuntimeError: If there is an error loading the data or applying the
filters, a RuntimeError
- is raised with a message indicating the failure.
+ optional filters to the data.
+
+ :param ids: A list of item IDs to filter the items. If not provided,
no ID filtering is applied.
+ :param bbox: A list of bounding boxes for filtering the items.
+ :param geometry: Shapely geometry object(s) or WKT string(s) for
spatial filtering.
+ Can be a single geometry, WKT string, or a list of geometries/WKT
strings.
Review Comment:
The parameter description spans multiple lines but lacks proper Sphinx
indentation. The continuation lines should be indented to align with the
parameter description.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]