diff --git a/Examples/compare/compare_ecef2eci.py b/Examples/compare/compare_ecef2eci.py index 81e3f47..cb228b5 100644 --- a/Examples/compare/compare_ecef2eci.py +++ b/Examples/compare/compare_ecef2eci.py @@ -38,7 +38,7 @@ def test_ecef_eci(): ecef = eci2ecef(*eci_matlab, utc) if has_aero: - ecef_matlab = eng.eci2ecef(utc_matlab, *eci_matlab, nargout=3) # type: ignore + ecef_matlab = eng.eci2ecef(utc_matlab, *eci_matlab, nargout=3) else: ecef_matlab = eng.matmap3d.eci2ecef(utc_matlab, *eci_matlab, nargout=3) diff --git a/src/pymap3d/ecef.py b/src/pymap3d/ecef.py index c6b9a23..a1f975b 100644 --- a/src/pymap3d/ecef.py +++ b/src/pymap3d/ecef.py @@ -191,7 +191,7 @@ def ecef2geodetic( ) try: - if inside.any(): # type: ignore + if inside.any(): # avoid all false assignment bug alt[inside] = -alt[inside] except (TypeError, AttributeError): diff --git a/src/pymap3d/enu.py b/src/pymap3d/enu.py index 67b40e4..b189a84 100644 --- a/src/pymap3d/enu.py +++ b/src/pymap3d/enu.py @@ -50,11 +50,11 @@ def enu2aer(e, n, u, deg: bool = True) -> tuple: u[abs(u) < 1e-3] = 0.0 except TypeError: if abs(e) < 1e-3: - e = 0.0 # type: ignore + e = 0.0 if abs(n) < 1e-3: - n = 0.0 # type: ignore + n = 0.0 if abs(u) < 1e-3: - u = 0.0 # type: ignore + u = 0.0 r = hypot(e, n) slantRange = hypot(r, u) diff --git a/src/pymap3d/latitude.py b/src/pymap3d/latitude.py index be41305..3265827 100644 --- a/src/pymap3d/latitude.py +++ b/src/pymap3d/latitude.py @@ -210,7 +210,7 @@ def geodetic2isometric(geodetic_lat, ell: Ellipsoid = None, deg: bool = True): i = abs(coslat) <= COS_EPS try: - isometric_lat[i] = sign(geodetic_lat[i]) * inf # type: ignore + isometric_lat[i] = sign(geodetic_lat[i]) * inf except TypeError: if i: isometric_lat = sign(geodetic_lat) * inf diff --git a/src/pymap3d/lox.py b/src/pymap3d/lox.py index 37055ec..2f578b1 100644 --- a/src/pymap3d/lox.py +++ b/src/pymap3d/lox.py @@ -245,7 +245,7 @@ def loxodrome_direct( dlon = tan(a12) * (newiso - iso) try: - dlon[i] = sign(pi - a12[i]) * rng[i] / rcurve.parallel(lat1[i], ell=ell, deg=False) # type: ignore + dlon[i] = sign(pi - a12[i]) * rng[i] / rcurve.parallel(lat1[i], ell=ell, deg=False) except (AttributeError, TypeError): if i: # straight east or west dlon = sign(pi - a12) * rng / rcurve.parallel(lat1, ell=ell, deg=False) @@ -256,7 +256,7 @@ def loxodrome_direct( lat2, lon2 = degrees(lat2), degrees(lon2) try: - return lat2.squeeze()[()], lon2.squeeze()[()] # type: ignore + return lat2.squeeze()[()], lon2.squeeze()[()] except AttributeError: return lat2, lon2 diff --git a/src/pymap3d/timeconv.py b/src/pymap3d/timeconv.py index e2566d4..21c7ad9 100644 --- a/src/pymap3d/timeconv.py +++ b/src/pymap3d/timeconv.py @@ -34,7 +34,7 @@ def str2dt(time: str | datetime) -> datetime: try: return dateutil.parser.parse(time) except NameError: - raise ImportError("pip install dateutil") + raise ImportError("pip install python-dateutil") # some sort of iterable try: @@ -45,7 +45,7 @@ def str2dt(time: str | datetime) -> datetime: except IndexError: pass except NameError: - raise ImportError("pip install dateutil") + raise ImportError("pip install python-dateutil") # pandas/xarray try: diff --git a/src/pymap3d/utils.py b/src/pymap3d/utils.py index bbc8a32..940f32b 100644 --- a/src/pymap3d/utils.py +++ b/src/pymap3d/utils.py @@ -59,10 +59,10 @@ def sanitize(lat, ell: Ellipsoid | None, deg: bool) -> tuple: lat = radians(lat) try: - if (abs(lat) > pi / 2).any(): # type: ignore + if (abs(lat) > pi / 2).any(): raise ValueError("-pi/2 <= latitude <= pi/2") except AttributeError: - if abs(lat) > pi / 2: # type: ignore + if abs(lat) > pi / 2: raise ValueError("-pi/2 <= latitude <= pi/2") return lat, ell diff --git a/src/pymap3d/vincenty.py b/src/pymap3d/vincenty.py index bcfc8d1..fb4f5e2 100644 --- a/src/pymap3d/vincenty.py +++ b/src/pymap3d/vincenty.py @@ -120,7 +120,7 @@ def vdist( if (abs(Lat1) > 90).any() | (abs(Lat2) > 90).any(): raise ValueError("Input latitudes must be in [-90, 90] degrees.") except NameError: - if (abs(Lat1) > 90) | (abs(Lat2) > 90): # type: ignore + if (abs(Lat1) > 90) | (abs(Lat2) > 90): raise ValueError("Input latitudes must be in [-90, 90] degrees.") # %% Supply WGS84 earth ellipsoid axis lengths in meters: a = ell.semimajor_axis @@ -155,7 +155,7 @@ def vdist( L[L > pi] = 2 * pi - L[L > pi] except TypeError: if L > pi: - L = 2 * pi - L # type: ignore + L = 2 * pi - L lamb = copy(L) # NOTE: program will fail without copy! itercount = 0 @@ -167,7 +167,7 @@ def vdist( if not warninggiven: logging.warning("Essentially antipodal points--precision may be reduced slightly.") - lamb = pi # type: ignore + lamb = pi break lambdaold = copy(lamb) @@ -213,7 +213,7 @@ def vdist( # print(f'then, lambda(21752) = {lamb[21752],20}) # correct for convergence failure for essentially antipodal points try: - i = (lamb > pi).any() # type: ignore + i = (lamb > pi).any() except AttributeError: i = lamb > pi @@ -222,11 +222,11 @@ def vdist( "Essentially antipodal points encountered. Precision may be reduced slightly." ) warninggiven = True - lambdaold = pi # type: ignore - lamb = pi # type: ignore + lambdaold = pi + lamb = pi try: - notdone = (abs(lamb - lambdaold) > 1e-12).any() # type: ignore + notdone = (abs(lamb - lambdaold) > 1e-12).any() except AttributeError: notdone = abs(lamb - lambdaold) > 1e-12 @@ -347,7 +347,7 @@ def vreckon( if (Rng < 0.0).any(): raise ValueError("Ground distance must be positive") except NameError: - if abs(Lat1) > 90.0: # type: ignore + if abs(Lat1) > 90.0: raise ValueError("Input lat. must be between -90 and 90 deg., inclusive.") if Rng < 0.0: raise ValueError("Ground distance must be positive")