From: Eugene Crosser Date: Wed, 3 Aug 2022 18:33:38 +0000 (+0200) Subject: opencellid: raise exception on the lack of data X-Git-Tag: 1.92~1 X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=commitdiff_plain;h=58381e852f1aa2013f45de7757a55d01463befa2;hp=c9f23958d20dfc6578b9f76706bd8b3e687389b0 opencellid: raise exception on the lack of data --- diff --git a/loctrkd/opencellid.py b/loctrkd/opencellid.py index a70dc26..20fd3ae 100644 --- a/loctrkd/opencellid.py +++ b/loctrkd/opencellid.py @@ -46,7 +46,7 @@ def lookup( lc.execute("""detach database mem""") lc.close() if not data: - return 0.0, 0.0 + raise ValueError("No location data found in opencellid") sumsig = sum([1 / sig for _, _, sig in data]) nsigs = [1 / sig / sumsig for _, _, sig in data] avlat = sum([lat * nsig for (lat, _, _), nsig in zip(data, nsigs)])