From 3ed775816bd3df787b4532d6b29ece49070ff0a0 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 1 Mar 2026 19:02:20 +0800 Subject: [PATCH] fix: cast to float in get_deb_accuracy to fix str subtraction error --- src/analysis/deb_algorithm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/analysis/deb_algorithm.py b/src/analysis/deb_algorithm.py index 315866e6..9f251516 100644 --- a/src/analysis/deb_algorithm.py +++ b/src/analysis/deb_algorithm.py @@ -198,6 +198,12 @@ def get_deb_accuracy(city_name): if deb_pred is None or actual is None: continue + try: + deb_pred = float(deb_pred) + actual = float(actual) + except: + continue + total += 1 deb_wu = round(deb_pred) actual_wu = round(actual)