We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8543d5c commit 20cd729Copy full SHA for 20cd729
setup.cfg
@@ -1,6 +1,6 @@
1
[metadata]
2
name = pymap3d
3
-version = 2.7.1
+version = 2.7.2
4
author = Michael Hirsch, Ph.D.
5
author_email = [email protected]
6
description = pure Python (no prereqs) coordinate conversions, following convention of several popular Matlab routines.
src/pymap3d/lox.py
@@ -4,18 +4,7 @@
import typing
try:
7
- from numpy import (
8
- radians,
9
- degrees,
10
- cos,
11
- arctan2 as atan2,
12
- tan,
13
- pi,
14
- array,
15
- atleast_1d,
16
- broadcast_arrays,
17
- broadcast_to,
18
- )
+ from numpy import radians, degrees, cos, arctan2 as atan2, tan, pi, array, broadcast_arrays
19
except ImportError:
20
from math import radians, degrees, cos, atan2, tan, pi # type: ignore
21
@@ -227,16 +216,7 @@ def loxodrome_direct(
227
216
lat1, lon1, a12 = radians(lat1), radians(lon1), radians(a12)
228
217
229
218
230
- lat1 = atleast_1d(lat1)
231
- rng = atleast_1d(rng)
232
-
233
- if lat1.shape != rng.shape:
234
- if rng.size == 1:
235
- rng = broadcast_to(rng, lat1.shape)
236
- elif lat1.size == 1:
237
- lat1 = broadcast_to(lat1, rng.shape)
238
- else:
239
- raise ValueError("lat1 and rng must each be scalars or same shape")
219
+ lat1, rng = broadcast_arrays(lat1, rng)
240
220
if (abs(lat1) > pi / 2).any(): # type: ignore
241
221
raise ValueError("-90 <= latitude <= 90")
242
222
if (rng < 0).any(): # type: ignore
src/pymap3d/tests/test_rhumb.py
@@ -78,9 +78,7 @@ def test_numpy_loxodrome_inverse():
78
79
def test_numpy_2d_loxodrome_inverse():
80
pytest.importorskip("numpy")
81
- d, a = lox.loxodrome_inverse(
82
- [[40, 40], [40, 40]], [[-80, -80], [-80, -80]], 65, -148
83
+ d, a = lox.loxodrome_inverse([[40, 40], [40, 40]], [[-80, -80], [-80, -80]], 65, -148)
84
assert d == approx(5248666.209)
85
assert a == approx(302.00567)
86
@@ -90,9 +88,7 @@ def test_numpy_2d_loxodrome_inverse():
90
88
d, a = lox.loxodrome_inverse(
91
89
[[40, 40], [40, 40]], [[-80, -80], [-80, -80]], 65, [[-148, -148], [-148, -148]]
92
)
93
94
- 40, -80, [[65, 65], [65, 65]], [[-148, -148], [-148, -148]]
95
+ d, a = lox.loxodrome_inverse(40, -80, [[65, 65], [65, 65]], [[-148, -148], [-148, -148]])
96
97
98
@pytest.mark.parametrize(
0 commit comments