Skip to content

Commit eeb8792

Browse files
favyen2yawenzzzz
authored andcommitted
Fix lint errors.
1 parent ec5b7dc commit eeb8792

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

landsat/example_request.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Use this script to inference the API with locally stored data"""
1+
"""Use this script to inference the API with locally stored data."""
22

33
import json
44
import os
@@ -8,18 +8,20 @@
88
PORT = os.getenv("Landsat_PORT", default=5555)
99
LANDSAT_ENDPOINT = f"http://localhost:{PORT}/detections"
1010
TIMEOUT_SECONDS = 60000
11-
SCENE_ID = 'LC09_L1GT_106084_20241002_20241002_02_T2'
12-
CROP_PATH = 'temp_crops'
11+
SCENE_ID = "LC09_L1GT_106084_20241002_20241002_02_T2"
12+
CROP_PATH = "temp_crops"
1313

14-
def sample_request() -> None:
15-
"""Sample request for files stored locally"""
1614

15+
def sample_request() -> None:
16+
"""Sample request for files stored locally."""
1717
REQUEST_BODY = {
1818
"scene_id": SCENE_ID,
1919
"crop_path": CROP_PATH,
2020
}
2121

22-
response = requests.post(LANDSAT_ENDPOINT, json=REQUEST_BODY, timeout=TIMEOUT_SECONDS)
22+
response = requests.post(
23+
LANDSAT_ENDPOINT, json=REQUEST_BODY, timeout=TIMEOUT_SECONDS
24+
)
2325
output_filename = os.path.join(
2426
os.path.dirname(os.path.realpath(__file__)), "sample_response.json"
2527
)

rslp/landsat_vessels/predict_pipeline.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import json
44
from datetime import datetime, timedelta
5+
from tempfile import TemporaryDirectory
56
from typing import Any
67

78
import numpy as np
@@ -183,8 +184,8 @@ def run_classifier(
183184

184185
def predict_pipeline(
185186
crop_path: str,
186-
scratch_path: Optional[str] = None,
187-
json_path: Optional[str] = None,
187+
scratch_path: str | None = None,
188+
json_path: str | None = None,
188189
image_files: dict[str, str] | None = None,
189190
scene_id: str | None = None,
190191
) -> dict[str, Any]:
@@ -203,8 +204,6 @@ def predict_pipeline(
203204
scene_id: Landsat scene ID. Exactly one of image_files or scene_id should be
204205
specified.
205206
"""
206-
207-
208207
if not scratch_path:
209208
tmp_dir = TemporaryDirectory()
210209
scratch_path = tmp_dir.name

0 commit comments

Comments
 (0)