Skip to content

Commit fea7320

Browse files
committed
chore: threshold docstring
1 parent 3e0eb3f commit fea7320

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ee_mcp/server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ def filter_image_by_threshold(
235235
image_path,
236236
threshold,
237237
)
238+
if threshold != "mean":
239+
try:
240+
threshold = float(threshold)
241+
except (ValueError, TypeError) as e:
242+
msg = f"Invalid threshold value '{threshold}': must be a number or 'mean'"
243+
logger.exception(msg)
244+
raise ValueError(msg) from e
245+
238246
res = handle_filter_image_by_threshold(image_path, threshold)
239247
result_path = f"{'/'.join(image_path.split('/')[:-1])}/{result_name}.json"
240248
save_ee_object(result_path, res)

0 commit comments

Comments
 (0)