Skip to content

Commit bf7c668

Browse files
committed
type anno corrections
ci mypy install prereq
1 parent 679fe28 commit bf7c668

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: [3.6, 3.9]
15+
python-version: [3.7, 3.9]
1616
steps:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-python@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Batch converts NAV and OBS GPS RINEX (including Hatanaka compressed OBS) data in
1111
[xarray.Dataset](http://xarray.pydata.org/en/stable/api.html#dataset)
1212
for easy use in analysis and plotting.
1313
This gives remarkable speed vs. legacy iterative methods, and allows for HPC / out-of-core operations on massive amounts of GNSS data.
14-
GeoRinex works in Python ≥ 3.6 and has over 125 unit tests driven by Pytest.
14+
GeoRinex has over 125 unit tests driven by Pytest.
1515

1616
Pure compiled language RINEX processors such as within Fortran NAPEOS give perhaps 2x faster performance than this Python program--that's pretty good for a scripted language like Python!
1717
However, the initial goal of this Python program was to be for one-time offline conversion of ASCII (and compressed ASCII) RINEX to HDF5/NetCDF4,

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ lint =
5555
flake8-builtins
5656
flake8-blind-except
5757
mypy
58+
types-python-dateutil
5859
plot =
5960
matplotlib
6061
seaborn

src/georinex/base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,7 @@ def load(
5959
if tlim[1] < tlim[0]:
6060
raise ValueError("stop time must be after start time")
6161

62-
try:
63-
info = rinexinfo(rinexfn)
64-
except RuntimeError:
65-
logging.error(
66-
f"could not read {rinexfn} header. It may not be a known type of RINEX file."
67-
)
68-
return None
62+
info = rinexinfo(rinexfn)
6963

7064
if info["rinextype"] == "nav":
7165
return rinexnav(rinexfn, outfn, use=use, tlim=tlim, overwrite=overwrite)

src/georinex/geo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def get_locations(files: list[Path]) -> pandas.DataFrame:
1919
if isinstance(files[0], io.StringIO):
2020
locs = pandas.DataFrame(index=["0"], columns=["lat", "lon", "interval"])
2121
elif isinstance(files[0], Path):
22-
locs = pandas.DataFrame(index=[file.name for file in files], columns=["lat", "lon", "interval"])
22+
locs = pandas.DataFrame(
23+
index=[file.name for file in files], columns=["lat", "lon", "interval"]
24+
)
2325
else:
2426
raise TypeError("Expecting pathlib.Path")
2527

src/georinex/keplerian.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
import numpy as np
1010

1111

12-
def keplerian2ecef(sv: xarray.DataArray) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
12+
def keplerian2ecef(
13+
sv: xarray.Dataset,
14+
) -> tuple[xarray.DataArray, xarray.DataArray, xarray.DataArray]:
1315
"""
1416
based on:
1517
https://ascelibrary.org/doi/pdf/10.1061/9780784411506.ap03

src/georinex/obs3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def obsheader3(f: T.TextIO, use: list[str] = None, meas: list[str] = None) -> di
348348

349349
# perhaps this could be done more efficiently, but it's probably low impact on overall program.
350350
# simple set and frozenset operations do NOT preserve order, which would completely mess up reading!
351-
sysind = {}
351+
sysind: dict[str, T.Any] = {}
352352
if isinstance(meas, (tuple, list, np.ndarray)):
353353
for sk in fields: # iterate over each system
354354
# ind = np.isin(fields[sk], meas) # boolean vector

src/georinex/tests/test_scripts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def test_convenience():
1313

1414

1515
def test_time():
16+
pytest.importorskip("unlzw3")
1617
subprocess.check_call(["georinex_time", str(R)])
1718

1819

src/georinex/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def rinexheader(fn: T.TextIO | Path) -> dict[str, T.Any]:
117117
return hdr
118118

119119

120-
def _tlim(tlim: tuple[str, str] | tuple[datetime, datetime] = None) -> tuple[datetime, datetime]:
120+
def _tlim(tlim: tuple[datetime, datetime] = None) -> tuple[datetime, datetime]:
121121
if tlim is None:
122122
pass
123123
elif len(tlim) == 2 and isinstance(tlim[0], datetime):

0 commit comments

Comments
 (0)