Skip to content

Commit 54fea73

Browse files
committed
remove unneeded mypy ignore
1 parent 907c675 commit 54fea73

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

Examples/compare/compare_ecef2eci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_ecef_eci():
3838
ecef = eci2ecef(*eci_matlab, utc)
3939

4040
if has_aero:
41-
ecef_matlab = eng.eci2ecef(utc_matlab, *eci_matlab, nargout=3) # type: ignore
41+
ecef_matlab = eng.eci2ecef(utc_matlab, *eci_matlab, nargout=3)
4242
else:
4343
ecef_matlab = eng.matmap3d.eci2ecef(utc_matlab, *eci_matlab, nargout=3)
4444

src/pymap3d/ecef.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def ecef2geodetic(
191191
)
192192

193193
try:
194-
if inside.any(): # type: ignore
194+
if inside.any():
195195
# avoid all false assignment bug
196196
alt[inside] = -alt[inside]
197197
except (TypeError, AttributeError):

src/pymap3d/enu.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ def enu2aer(e, n, u, deg: bool = True) -> tuple:
5050
u[abs(u) < 1e-3] = 0.0
5151
except TypeError:
5252
if abs(e) < 1e-3:
53-
e = 0.0 # type: ignore
53+
e = 0.0
5454
if abs(n) < 1e-3:
55-
n = 0.0 # type: ignore
55+
n = 0.0
5656
if abs(u) < 1e-3:
57-
u = 0.0 # type: ignore
57+
u = 0.0
5858

5959
r = hypot(e, n)
6060
slantRange = hypot(r, u)

src/pymap3d/latitude.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def geodetic2isometric(geodetic_lat, ell: Ellipsoid = None, deg: bool = True):
210210
i = abs(coslat) <= COS_EPS
211211

212212
try:
213-
isometric_lat[i] = sign(geodetic_lat[i]) * inf # type: ignore
213+
isometric_lat[i] = sign(geodetic_lat[i]) * inf
214214
except TypeError:
215215
if i:
216216
isometric_lat = sign(geodetic_lat) * inf

src/pymap3d/lox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def loxodrome_direct(
245245
dlon = tan(a12) * (newiso - iso)
246246

247247
try:
248-
dlon[i] = sign(pi - a12[i]) * rng[i] / rcurve.parallel(lat1[i], ell=ell, deg=False) # type: ignore
248+
dlon[i] = sign(pi - a12[i]) * rng[i] / rcurve.parallel(lat1[i], ell=ell, deg=False)
249249
except (AttributeError, TypeError):
250250
if i: # straight east or west
251251
dlon = sign(pi - a12) * rng / rcurve.parallel(lat1, ell=ell, deg=False)
@@ -256,7 +256,7 @@ def loxodrome_direct(
256256
lat2, lon2 = degrees(lat2), degrees(lon2)
257257

258258
try:
259-
return lat2.squeeze()[()], lon2.squeeze()[()] # type: ignore
259+
return lat2.squeeze()[()], lon2.squeeze()[()]
260260
except AttributeError:
261261
return lat2, lon2
262262

src/pymap3d/timeconv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def str2dt(time: str | datetime) -> datetime:
3434
try:
3535
return dateutil.parser.parse(time)
3636
except NameError:
37-
raise ImportError("pip install dateutil")
37+
raise ImportError("pip install python-dateutil")
3838

3939
# some sort of iterable
4040
try:
@@ -45,7 +45,7 @@ def str2dt(time: str | datetime) -> datetime:
4545
except IndexError:
4646
pass
4747
except NameError:
48-
raise ImportError("pip install dateutil")
48+
raise ImportError("pip install python-dateutil")
4949

5050
# pandas/xarray
5151
try:

src/pymap3d/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def sanitize(lat, ell: Ellipsoid | None, deg: bool) -> tuple:
5959
lat = radians(lat)
6060

6161
try:
62-
if (abs(lat) > pi / 2).any(): # type: ignore
62+
if (abs(lat) > pi / 2).any():
6363
raise ValueError("-pi/2 <= latitude <= pi/2")
6464
except AttributeError:
65-
if abs(lat) > pi / 2: # type: ignore
65+
if abs(lat) > pi / 2:
6666
raise ValueError("-pi/2 <= latitude <= pi/2")
6767

6868
return lat, ell

src/pymap3d/vincenty.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def vdist(
120120
if (abs(Lat1) > 90).any() | (abs(Lat2) > 90).any():
121121
raise ValueError("Input latitudes must be in [-90, 90] degrees.")
122122
except NameError:
123-
if (abs(Lat1) > 90) | (abs(Lat2) > 90): # type: ignore
123+
if (abs(Lat1) > 90) | (abs(Lat2) > 90):
124124
raise ValueError("Input latitudes must be in [-90, 90] degrees.")
125125
# %% Supply WGS84 earth ellipsoid axis lengths in meters:
126126
a = ell.semimajor_axis
@@ -155,7 +155,7 @@ def vdist(
155155
L[L > pi] = 2 * pi - L[L > pi]
156156
except TypeError:
157157
if L > pi:
158-
L = 2 * pi - L # type: ignore
158+
L = 2 * pi - L
159159

160160
lamb = copy(L) # NOTE: program will fail without copy!
161161
itercount = 0
@@ -167,7 +167,7 @@ def vdist(
167167
if not warninggiven:
168168
logging.warning("Essentially antipodal points--precision may be reduced slightly.")
169169

170-
lamb = pi # type: ignore
170+
lamb = pi
171171
break
172172

173173
lambdaold = copy(lamb)
@@ -213,7 +213,7 @@ def vdist(
213213
# print(f'then, lambda(21752) = {lamb[21752],20})
214214
# correct for convergence failure for essentially antipodal points
215215
try:
216-
i = (lamb > pi).any() # type: ignore
216+
i = (lamb > pi).any()
217217
except AttributeError:
218218
i = lamb > pi
219219

@@ -222,11 +222,11 @@ def vdist(
222222
"Essentially antipodal points encountered. Precision may be reduced slightly."
223223
)
224224
warninggiven = True
225-
lambdaold = pi # type: ignore
226-
lamb = pi # type: ignore
225+
lambdaold = pi
226+
lamb = pi
227227

228228
try:
229-
notdone = (abs(lamb - lambdaold) > 1e-12).any() # type: ignore
229+
notdone = (abs(lamb - lambdaold) > 1e-12).any()
230230
except AttributeError:
231231
notdone = abs(lamb - lambdaold) > 1e-12
232232

@@ -347,7 +347,7 @@ def vreckon(
347347
if (Rng < 0.0).any():
348348
raise ValueError("Ground distance must be positive")
349349
except NameError:
350-
if abs(Lat1) > 90.0: # type: ignore
350+
if abs(Lat1) > 90.0:
351351
raise ValueError("Input lat. must be between -90 and 90 deg., inclusive.")
352352
if Rng < 0.0:
353353
raise ValueError("Ground distance must be positive")

0 commit comments

Comments
 (0)