Skip to content

Commit e0f192b

Browse files
committed
assert type checks
1 parent 4bcf825 commit e0f192b

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

gnss_lib_py/utils/sv_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@ def _filter_ephemeris_measurements(measurements, constellations,
616616
"""
617617
measurements.in_rows(['gnss_id', 'sv_id', 'gps_millis'])
618618
# Check whether the rows are in the right format as needed.
619-
isinstance(measurements['gnss_id'].dtype, object)
620-
isinstance(measurements['sv_id'].dtype, int)
621-
isinstance(measurements['gps_millis'].dtype, np.int64)
619+
assert isinstance(measurements['gnss_id'].dtype, object)
620+
assert np.issubdtype(measurements['sv_id'].dtype, np.integer)
621+
assert np.issubdtype(measurements['gps_millis'].dtype, float)
622622
rx_const= np.unique(measurements['gnss_id'])
623623
# Check if required constellations are available, keep only required
624624
# constellations

tests/parsers/test_android.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ def test_sensor_loaders(raw_path, sensor_type):
189189
"""
190190

191191
test_navdata = sensor_type(input_path = raw_path)
192-
isinstance(test_navdata, NavData)
192+
assert isinstance(test_navdata, NavData)
193193

194194
test_navdata = sensor_type(pathlib.Path(raw_path))
195-
isinstance(test_navdata, NavData)
195+
assert isinstance(test_navdata, NavData)
196196

197197
# raises exception if not a file path
198198
with pytest.raises(FileNotFoundError):
@@ -286,10 +286,10 @@ def test_fix_raw(android_raw_path):
286286
Path to Android Raw measurements text log file
287287
"""
288288
test_fix = android.AndroidRawFixes(android_raw_path)
289-
isinstance(test_fix, NavData)
289+
assert isinstance(test_fix, NavData)
290290

291291
test_fix = android.AndroidRawFixes(pathlib.Path(android_raw_path))
292-
isinstance(test_fix, NavData)
292+
assert isinstance(test_fix, NavData)
293293

294294
# raises exception if not a file path
295295
with pytest.raises(FileNotFoundError):

tests/parsers/test_google_decimeter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ def test_navdata_type(derived):
338338
derived : pytest.fixture
339339
Instance of AndroidDerived2021 for testing
340340
"""
341-
isinstance(derived, NavData)
342-
isinstance(derived, google_decimeter.AndroidDerived2021)
341+
assert isinstance(derived, NavData)
342+
assert isinstance(derived, google_decimeter.AndroidDerived2021)
343343

344344
def test_timestep_parsing(derived_path_xl):
345345
"""Test that the timesteps contain the same satellites.
@@ -442,8 +442,8 @@ def test_android_gtruth(gtruth):
442442
443443
"""
444444

445-
isinstance(gtruth, NavData)
446-
isinstance(gtruth, google_decimeter.AndroidGroundTruth2021)
445+
assert isinstance(gtruth, NavData)
446+
assert isinstance(gtruth, google_decimeter.AndroidGroundTruth2021)
447447

448448
assert int(gtruth["gps_millis",3]) == 1273529466442
449449

tests/parsers/test_smartloc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ def test_navdata_type(smartloc_raw):
193193
smartloc_raw : pytest.fixture
194194
Instance of SmartLocRaw for testing
195195
"""
196-
isinstance(smartloc_raw, NavData)
197-
isinstance(smartloc_raw, SmartLocRaw)
196+
assert isinstance(smartloc_raw, NavData)
197+
assert isinstance(smartloc_raw, SmartLocRaw)
198198

199199

200200
def test_shape_update(smartloc_raw):

0 commit comments

Comments
 (0)