Skip to content

Commit 0eb91dc

Browse files
authored
Merge branch 'ashwin/measures_sats' into derek/sort-where
2 parents 9ee1c01 + c48ebb7 commit 0eb91dc

6 files changed

Lines changed: 66 additions & 13 deletions

File tree

docs/source/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pyzmq==25.0.2 ; python_version >= "3.8" and python_version < "3.12"
113113
qtconsole==5.4.2 ; python_version >= "3.8" and python_version < "3.12"
114114
qtpy==2.3.1 ; python_version >= "3.8" and python_version < "3.12"
115115
reindent==3.5.1 ; python_version >= "3.8" and python_version < "3.12"
116-
requests==2.28.2 ; python_version >= "3.8" and python_version < "3.12"
116+
requests==2.29.0 ; python_version >= "3.8" and python_version < "3.12"
117117
rfc3339-validator==0.1.4 ; python_version >= "3.8" and python_version < "3.12"
118118
rfc3986-validator==0.1.1 ; python_version >= "3.8" and python_version < "3.12"
119119
scipy==1.10.1 ; python_version >= "3.8" and python_version < "3.12"

gnss_lib_py/utils/sv_models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,13 @@ def _combine_gnss_sv_ids(measurement_frame):
352352
measurement_frame : gnss_lib_py.parsers.navdata.NavData
353353
NavData instance containing measurements including `gnss_id` and
354354
`sv_id`.
355+
356+
Returns
357+
-------
358+
gnss_sv_id : np.ndarray
359+
New row values that combine `gnss_id` and `sv_id` into a something
360+
similar to 'R01' or 'G12' for example.
361+
355362
"""
356363
constellation_char_inv = {const : gnss_char for gnss_char, const in consts.CONSTELLATION_CHARS.items()}
357364
gnss_chars = [constellation_char_inv[const] for const in measurement_frame['gnss_id']]

poetry.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "gnss-lib-py"
3-
version = "0.1.8"
3+
version = "0.1.9"
44
description = "Modular Python tool for parsing, analyzing, and visualizing Global Navigation Satellite Systems (GNSS) data and state estimates"
55
authors = ["Derek Knowles <dcknowles@stanford.edu>",
66
"Ashwin Kanhere <akanhere@stanford.edu>",
@@ -34,6 +34,7 @@ pytest-lazy-fixture = "^0.6.3"
3434
matplotlib = "^3.5.1"
3535
plotly = "^5.8.0"
3636
kaleido = "0.2.1"
37+
requests = "^2.29.0"
3738

3839
[tool.poetry.group.dev.dependencies]
3940
Sphinx = "^4.1.1"

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ attrs==23.1.0 ; python_version >= "3.8" and python_version < "3.12"
99
backcall==0.2.0 ; python_version >= "3.8" and python_version < "3.12"
1010
beautifulsoup4==4.12.2 ; python_version >= "3.8" and python_version < "3.12"
1111
bleach==6.0.0 ; python_version >= "3.8" and python_version < "3.12"
12+
certifi==2022.12.7 ; python_version >= "3.8" and python_version < "3.12"
1213
cffi==1.15.1 ; python_version >= "3.8" and python_version < "3.12"
14+
charset-normalizer==3.1.0 ; python_version >= "3.8" and python_version < "3.12"
1315
colorama==0.4.6 ; python_version >= "3.8" and python_version < "3.12" and sys_platform == "win32"
1416
comm==0.1.3 ; python_version >= "3.8" and python_version < "3.12"
1517
contourpy==1.0.7 ; python_version >= "3.8" and python_version < "3.12"
@@ -103,6 +105,7 @@ pyzmq==25.0.2 ; python_version >= "3.8" and python_version < "3.12"
103105
qtconsole==5.4.2 ; python_version >= "3.8" and python_version < "3.12"
104106
qtpy==2.3.1 ; python_version >= "3.8" and python_version < "3.12"
105107
reindent==3.5.1 ; python_version >= "3.8" and python_version < "3.12"
108+
requests==2.29.0 ; python_version >= "3.8" and python_version < "3.12"
106109
rfc3339-validator==0.1.4 ; python_version >= "3.8" and python_version < "3.12"
107110
rfc3986-validator==0.1.1 ; python_version >= "3.8" and python_version < "3.12"
108111
scipy==1.10.1 ; python_version >= "3.8" and python_version < "3.12"
@@ -124,6 +127,7 @@ typing-extensions==4.5.0 ; python_version >= "3.8" and python_version < "3.12"
124127
tzdata==2023.3 ; python_version >= "3.8" and python_version < "3.12"
125128
unlzw3==0.2.2 ; python_version >= "3.8" and python_version < "3.12"
126129
uri-template==1.2.0 ; python_version >= "3.8" and python_version < "3.12"
130+
urllib3==1.26.15 ; python_version >= "3.8" and python_version < "3.12"
127131
wcwidth==0.2.6 ; python_version >= "3.8" and python_version < "3.12"
128132
webcolors==1.13 ; python_version >= "3.8" and python_version < "3.12"
129133
webencodings==0.5.1 ; python_version >= "3.8" and python_version < "3.12"

tests/parsers/test_ephemeris.py

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import os
99
import ftplib
10+
import requests
1011
from datetime import datetime, timezone
1112

1213
import pytest
@@ -247,8 +248,48 @@ def test_download_ephem(ephem_download_path, fileinfo):
247248
dest_filepath = os.path.join(ephem_man.data_directory, 'nasa', filename)
248249

249250
# download the ephemeris file
250-
ephem_man.retrieve_file(url, directory, filename,
251-
dest_filepath)
251+
try:
252+
ephem_man.retrieve_file(url, directory, filename,
253+
dest_filepath)
254+
except ftplib.error_perm as ftplib_exception:
255+
print(ftplib_exception)
256+
257+
remove_download_eph(ephem_download_path)
258+
259+
@pytest.mark.parametrize('fileinfo',
260+
[
261+
{'filepath': 'IGS/BRDC/2023/099/BRDC00WRD_S_20230990000_01D_MN.rnx.gz',
262+
'url': 'http://igs.bkg.bund.de/root_ftp/'},
263+
])
264+
def test_request_igs(ephem_download_path, fileinfo):
265+
"""Test requests download for igs files.
266+
267+
The reason for this test is that Github workflow actions seem to
268+
block international IPs and so won't properly bind to the igs IP.
269+
270+
Parameters
271+
----------
272+
ephem_download_path : string
273+
Location where ephemeris files are stored/to be downloaded to.
274+
fileinfo : dict
275+
Filenames for ephemeris with ftp server and constellation details
276+
277+
"""
278+
279+
remove_download_eph(ephem_download_path)
280+
os.makedirs(ephem_download_path)
281+
282+
ephem_man = EphemerisManager(ephem_download_path, verbose=True)
283+
284+
filepath = fileinfo['filepath']
285+
filename = os.path.split(filepath)[1]
286+
dest_filepath = os.path.join(ephem_man.data_directory, 'igs', filename)
287+
288+
requests_url = fileinfo['url'] + fileinfo['filepath']
289+
290+
response = requests.get(requests_url, timeout=5)
291+
with open(dest_filepath,'wb') as file:
292+
file.write(response.content)
252293

253294
remove_download_eph(ephem_download_path)
254295

0 commit comments

Comments
 (0)