Skip to content

Commit bd21a33

Browse files
author
BriannaLind
committed
black again
1 parent f54840f commit bd21a33

File tree

5 files changed

+9
-29
lines changed

5 files changed

+9
-29
lines changed

src/planet_overlap/analysis.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,10 @@ def compute_central_coordinates(
3434
) -> Tuple[np.ndarray, np.ndarray]:
3535
"""Compute central latitude and longitude for each polygon."""
3636
central_lon = np.array(
37-
[
38-
np.mean([pt[0] for pt in geom["coordinates"][0]])
39-
for geom in geometries
40-
]
37+
[np.mean([pt[0] for pt in geom["coordinates"][0]]) for geom in geometries]
4138
)
4239
central_lat = np.array(
43-
[
44-
np.mean([pt[1] for pt in geom["coordinates"][0]])
45-
for geom in geometries
46-
]
40+
[np.mean([pt[1] for pt in geom["coordinates"][0]]) for geom in geometries]
4741
)
4842
return central_lon, central_lat
4943

@@ -166,9 +160,7 @@ def process_tiles(
166160
"central_lon": central_lon,
167161
"central_lat": central_lat,
168162
"local_times": local_times,
169-
"max_sun_diff": [
170-
sun_diff_2d[i, :].max() for i in range(len(polygons))
171-
],
163+
"max_sun_diff": [sun_diff_2d[i, :].max() for i in range(len(polygons))],
172164
}
173165
)
174166
gdf.set_index("id", inplace=True)

src/planet_overlap/filters.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def build_filters(
9494
else:
9595
date_filter = {
9696
"type": "OrFilter",
97-
"config": [
98-
date_range_filter(start, end) for start, end in date_ranges
99-
],
97+
"config": [date_range_filter(start, end) for start, end in date_ranges],
10098
}
10199

102100
# Combine quality filters

src/planet_overlap/geometry.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ def load_aoi(paths: List[Union[str, Path]]) -> List[Polygon]:
4040
return aois
4141

4242

43-
def buffer_points(
44-
points: List[Point], buffer_deg: float = 0.01
45-
) -> List[Polygon]:
43+
def buffer_points(points: List[Point], buffer_deg: float = 0.01) -> List[Polygon]:
4644
(
4745
"Converts points into small polygons (buffers) "
4846
"for Planet requests. Args: "

src/planet_overlap/pagination.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ def tile_dates(
3939
slice_length = min(threshold_days, total_days)
4040
current_start = start
4141
while current_start <= end:
42-
current_end = min(
43-
current_start + timedelta(days=slice_length - 1), end
44-
)
42+
current_end = min(current_start + timedelta(days=slice_length - 1), end)
4543
slices.append((current_start, current_end))
4644
current_start = current_end + timedelta(days=1)
4745

src/planet_overlap/utils.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ def estimate_scene_count(
99
) -> int:
1010
(" Estimate number of scenes before execution.")
1111

12-
days = (
13-
datetime.fromisoformat(end_date) - datetime.fromisoformat(start_date)
14-
).days
12+
days = (datetime.fromisoformat(end_date) - datetime.fromisoformat(start_date)).days
1513

1614
estimated = int(days * scenes_per_day * (1 - max_cloud))
1715
return max(estimated, 0)
@@ -26,14 +24,10 @@ def generate_monthly_ranges(start_date: str, end_date: str):
2624
end = datetime.fromisoformat(end_date)
2725

2826
while current < end:
29-
next_month = (current.replace(day=28) + timedelta(days=4)).replace(
30-
day=1
31-
)
27+
next_month = (current.replace(day=28) + timedelta(days=4)).replace(day=1)
3228
window_end = min(next_month, end)
3329

34-
ranges.append(
35-
(current.date().isoformat(), window_end.date().isoformat())
36-
)
30+
ranges.append((current.date().isoformat(), window_end.date().isoformat()))
3731

3832
current = window_end
3933

0 commit comments

Comments
 (0)