cyberjunky / addon-p2000_rtlsdr

Receive P2000 events using Home Assistant and your RTL-SDR dongle
MIT License
16 stars 7 forks source link

UserWarning: Latitude normalization has been prohibited in the newer versions of geopy #12

Open junrt opened 4 months ago

junrt commented 4 months ago

2024-07-04 02:00:02: JSON from API doesn't have a 'results' key /usr/lib/python3.11/site-packages/geopy/point.py:472: UserWarning: Latitude normalization has been prohibited in the newer versions of geopy, because the normalized value happened to be on a different pole, which is probably not what was meant. If you pass coordinates as positional args, please make sure that the order is (latitude, longitude) or (y, x) in Cartesian terms. return cls(args) Exception in thread ProcessThread: Traceback (most recent call last): File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/usr/lib/python3.11/threading.py", line 982, in run self._target(self._args, *self._kwargs) File "/p2000.py", line 1174, in process_thread_call self.post_data(msg) File "/p2000.py", line 653, in post_data geodesic( File "/usr/lib/python3.11/site-packages/geopy/distance.py", line 540, in init super().init(args, *kwargs) File "/usr/lib/python3.11/site-packages/geopy/distance.py", line 276, in init kilometers += self.measure(a, b) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/geopy/distance.py", line 556, in measure a, b = Point(a), Point(b) ^^^^^^^^ File "/usr/lib/python3.11/site-packages/geopy/point.py", line 175, in new return cls.from_sequence(seq) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/geopy/point.py", line 472, in from_sequence return cls(args) ^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/geopy/point.py", line 188, in new _normalize_coordinates(latitude, longitude, altitude) File "/usr/lib/python3.11/site-packages/geopy/point.py", line 74, in _normalize_coordinates raise ValueError('Latitude must be in the [-90; 90] range.') ValueError: Latitude must be in the [-90; 90] range.

cyberjunky commented 3 months ago

Hi, thanks for reporting, this looks like an internal issue within geopy, since we call the geodesic() function as advertised in the readme, underneath the point() routine is called which has this issue, I haven't seen the error yet, can you check if you still have this, after rebuilding the addon, maybe it was related to a certain version of py3-geopy.

https://github.com/geopy/geopy?tab=readme-ov-file#measuring-distance