Skip to content

Commit 4aa2ed1

Browse files
committed
removed optional
1 parent 21ff8e8 commit 4aa2ed1

File tree

2 files changed

+16
-27
lines changed

2 files changed

+16
-27
lines changed

client.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,40 @@
1414

1515
# client.py
1616
import logging
17-
from typing import List, Optional, Tuple
17+
from typing import List, Tuple
1818
from planet_overlap.filters import build_filters
1919
from planet_overlap.geometry import load_aoi
2020

2121
logging.basicConfig(level=logging.INFO)
2222

2323

2424
def prepare_filters(
25-
geojson_paths: List[str],
26-
date_ranges: List[Tuple[str, str]]
25+
geojson_paths: List[str], date_ranges: List[Tuple[str, str]]
2726
) -> dict:
2827
"""
2928
Build filters for multiple AOIs and date ranges.
30-
29+
3130
Args:
3231
geojson_paths: List of file paths to AOI geojsons.
3332
date_ranges: List of (start_date, end_date) tuples.
34-
33+
3534
Returns:
3635
Dictionary containing combined filters.
3736
"""
3837
filters = build_filters(geojson_paths, date_ranges)
39-
logging.info("Filters prepared for %d AOIs/date ranges", len(filters.get("config", [])))
38+
logging.info(
39+
"Filters prepared for %d AOIs/date ranges", len(filters.get("config", []))
40+
)
4041
return filters
4142

4243

4344
def load_aois(geojson_paths: List[str]):
4445
"""
4546
Load AOIs from GeoJSON files.
46-
47+
4748
Args:
4849
geojson_paths: List of AOI geojson paths.
49-
50+
5051
Returns:
5152
List of AOI geometries.
5253
"""
@@ -55,17 +56,14 @@ def load_aois(geojson_paths: List[str]):
5556
return aois
5657

5758

58-
def run_client(
59-
geojson_paths: List[str],
60-
date_ranges: List[Tuple[str, str]]
61-
):
59+
def run_client(geojson_paths: List[str], date_ranges: List[Tuple[str, str]]):
6260
"""
6361
Full client workflow: load AOIs, prepare filters, and return filters + AOIs.
64-
62+
6563
Args:
6664
geojson_paths: List of AOI GeoJSON paths.
6765
date_ranges: List of (start_date, end_date) tuples.
68-
66+
6967
Returns:
7068
Tuple of (filters dict, list of AOI geometries)
7169
"""

tests/test_filters.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ def test_single_geojson_and_single_date():
1414

1515
def test_multiple_geojson_and_multiple_date_ranges():
1616
"""Test multiple AOIs with multiple date ranges."""
17-
geojson_paths = [
18-
"tests/data/sample_aoi.geojson",
19-
"tests/data/sample_aoi2.geojson"
20-
]
21-
date_ranges = [
22-
("2023-01-01", "2023-01-15"),
23-
("2023-02-01", "2023-02-10")
24-
]
17+
geojson_paths = ["tests/data/sample_aoi.geojson", "tests/data/sample_aoi2.geojson"]
18+
date_ranges = [("2023-01-01", "2023-01-15"), ("2023-02-01", "2023-02-10")]
2519
filters = build_filters(geojson_paths, date_ranges)
2620
# Ensure each AOI/date pair generates a config entry
2721
assert len(filters["config"]) == 2
@@ -32,13 +26,10 @@ def test_multiple_geojson_and_multiple_date_ranges():
3226

3327
def test_mixed_single_and_range_dates():
3428
"""Test handling of a mix of single dates and date ranges."""
35-
geojson_paths = [
36-
"tests/data/sample_aoi.geojson",
37-
"tests/data/sample_aoi2.geojson"
38-
]
29+
geojson_paths = ["tests/data/sample_aoi.geojson", "tests/data/sample_aoi2.geojson"]
3930
date_ranges = [
4031
("2023-01-01", "2023-01-01"), # single date as range
41-
("2023-02-01", "2023-02-10")
32+
("2023-02-01", "2023-02-10"),
4233
]
4334
filters = build_filters(geojson_paths, date_ranges)
4435
assert len(filters["config"]) == 2

0 commit comments

Comments
 (0)