Spaces:
Sleeping
Sleeping
Update api_utils.py
Browse files- api_utils.py +4 -7
api_utils.py
CHANGED
|
@@ -384,8 +384,7 @@ def api_get_extremes_info(
|
|
| 384 |
'type': 'high_tide',
|
| 385 |
'time': time_kst.isoformat(), # KST ISO format
|
| 386 |
'time_kst': time_kst.strftime('%Y-%m-%d %H:%M:%S KST'),
|
| 387 |
-
'level': round(curr_level,
|
| 388 |
-
'time_kr': time_kst.strftime('%H시 %M분')
|
| 389 |
})
|
| 390 |
# 간조 (극소값)
|
| 391 |
elif curr_level < prev_level and curr_level < next_level:
|
|
@@ -397,8 +396,7 @@ def api_get_extremes_info(
|
|
| 397 |
'type': 'low_tide',
|
| 398 |
'time': time_kst.isoformat(), # KST ISO format
|
| 399 |
'time_kst': time_kst.strftime('%Y-%m-%d %H:%M:%S KST'),
|
| 400 |
-
'level': round(curr_level,
|
| 401 |
-
'time_kr': time_kst.strftime('%H시 %M분')
|
| 402 |
})
|
| 403 |
|
| 404 |
# 주요 만조/간조만 필터링 (부차 제외)
|
|
@@ -492,9 +490,8 @@ def api_check_tide_alert(
|
|
| 492 |
alerts.append({
|
| 493 |
"time": time_kst.isoformat(), # KST ISO format
|
| 494 |
"time_kst": time_kst.strftime('%Y-%m-%d %H:%M:%S KST'),
|
| 495 |
-
"level": round(level,
|
| 496 |
-
"severity": severity
|
| 497 |
-
"time_kr": time_kst.strftime('%m월 %d일 %H시 %M분')
|
| 498 |
})
|
| 499 |
|
| 500 |
# 첫 위험 시간 계산
|
|
|
|
| 384 |
'type': 'high_tide',
|
| 385 |
'time': time_kst.isoformat(), # KST ISO format
|
| 386 |
'time_kst': time_kst.strftime('%Y-%m-%d %H:%M:%S KST'),
|
| 387 |
+
'level': round(curr_level, 2)
|
|
|
|
| 388 |
})
|
| 389 |
# 간조 (극소값)
|
| 390 |
elif curr_level < prev_level and curr_level < next_level:
|
|
|
|
| 396 |
'type': 'low_tide',
|
| 397 |
'time': time_kst.isoformat(), # KST ISO format
|
| 398 |
'time_kst': time_kst.strftime('%Y-%m-%d %H:%M:%S KST'),
|
| 399 |
+
'level': round(curr_level, 2)
|
|
|
|
| 400 |
})
|
| 401 |
|
| 402 |
# 주요 만조/간조만 필터링 (부차 제외)
|
|
|
|
| 490 |
alerts.append({
|
| 491 |
"time": time_kst.isoformat(), # KST ISO format
|
| 492 |
"time_kst": time_kst.strftime('%Y-%m-%d %H:%M:%S KST'),
|
| 493 |
+
"level": round(level, 2),
|
| 494 |
+
"severity": severity
|
|
|
|
| 495 |
})
|
| 496 |
|
| 497 |
# 첫 위험 시간 계산
|