Skip to content

Commit c765a3d

Browse files
committed
Added full docstrings in test_dop
1 parent b0a71db commit c765a3d

1 file changed

Lines changed: 74 additions & 3 deletions

File tree

tests/utils/test_dop.py

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ def test_simple_enu_unit_vectors(navdata, expected_los_vectors):
9595
"""
9696
A simple set of satellites for ENU unit vector calculation.
9797
98+
Parameters
99+
----------
100+
navdata : NavData
101+
A NavData with only one time entry of a simple satellite scenario.
102+
103+
expected_los_vectors : np.ndarray
104+
The expected ENU unit vectors for the simple satellite scenario.
105+
98106
"""
99107
# Check the we get the expected ENUT matrix
100108
enut_matrix = _calculate_enut_matrix(navdata)
@@ -119,7 +127,16 @@ def test_simple_dop(navdata, expected_dop):
119127
"""
120128
A simple set of satellites for DOP calculation.
121129
130+
Parameters
131+
----------
132+
navdata : NavData
133+
A NavData with only one time entry of a simple satellite scenario.
134+
135+
expected_dop : dict
136+
The expected dop values for the simple satellite scenario.
137+
122138
"""
139+
# Run the DOP calculation
123140
dop_dict = calculate_dop(navdata)
124141

125142
# Check the DOP output has all the expected keys
@@ -151,10 +168,17 @@ def test_simple_dop(navdata, expected_dop):
151168
def test_simple_get_dop_default(navdata, expected_dop):
152169
"""
153170
Test that the get_dop function works correctly forms the DOP navdata under
154-
default selection of the dop entries (i.e., HDOP and VDOP only)
155-
"""
171+
default selection of the dop entries (i.e., HDOP and VDOP only).
156172
157-
# Perform the function under test
173+
Parameters
174+
----------
175+
navdata : NavData
176+
A NavData with only one time entry of a simple satellite scenario.
177+
178+
expected_dop : dict
179+
The expected dop values for the simple satellite scenario.
180+
"""
181+
# Run the DOP calculation
158182
dop_navdata = get_dop(navdata)
159183

160184
# Check the DOP NavData instance has the expected keys
@@ -197,6 +221,14 @@ def test_simple_get_dop_default(navdata, expected_dop):
197221
def test_simple_get_dop(navdata, expected_dop, which_dop):
198222
"""
199223
Test that the get_dop function works correctly forms the DOP navdata.
224+
225+
Parameters
226+
----------
227+
navdata : NavData
228+
A NavData with only one time entry of a simple satellite scenario.
229+
230+
expected_dop : dict
231+
The expected dop values for the simple satellite scenario.
200232
"""
201233
# Make a deep copy of which_dop to ensure it was not editted
202234
which_dop_deep_copy = copy.deepcopy(which_dop)
@@ -245,6 +277,14 @@ def test_simple_get_dop(navdata, expected_dop, which_dop):
245277
def test_splat_dop_matrix(navdata, expected_dop):
246278
"""
247279
Test that the splat_dop_matrix function works correctly.
280+
281+
Parameters
282+
----------
283+
navdata : NavData
284+
A NavData with only one time entry of a simple satellite scenario.
285+
286+
expected_dop : dict
287+
The expected dop values for the simple satellite scenario.
248288
"""
249289
# Perform the function under test
250290
dop_matrix = calculate_dop(navdata)['dop_matrix']
@@ -273,6 +313,14 @@ def test_splat_dop_matrix(navdata, expected_dop):
273313
def test_unsplat_dop_matrix(navdata, expected_dop):
274314
"""
275315
Test that the unsplat_dop_matrix function works correctly.
316+
317+
Parameters
318+
----------
319+
navdata : NavData
320+
A NavData with only one time entry of a simple satellite scenario.
321+
322+
expected_dop : dict
323+
The expected dop values for the simple satellite scenario.
276324
"""
277325
# Perform the function under test
278326
dop_matrix = calculate_dop(navdata)['dop_matrix']
@@ -337,6 +385,11 @@ def test_singularity_dop(navdata):
337385
"""
338386
Testing that the singularity error is raised and handled correctly.
339387
388+
Parameters
389+
----------
390+
navdata : NavData
391+
A NavData with only one time entry of a *singular* satellite scenario.
392+
340393
"""
341394
with pytest.raises(np.linalg.LinAlgError):
342395
enut_matrix = _calculate_enut_matrix(navdata)
@@ -364,6 +417,11 @@ def test_singularity_dop(navdata):
364417
def test_dop_across_time(navdata):
365418
"""
366419
Test DOP calculation across time is properly added to NAV data.
420+
421+
Parameters
422+
----------
423+
navdata : NavData
424+
A NavData with multiple timesteps (i.e., as in real data).
367425
"""
368426

369427
dop_navdata = get_dop(navdata)
@@ -394,6 +452,14 @@ def test_dop_across_time(navdata):
394452
def test_dop_across_time_with_selection(navdata, which_dop):
395453
"""
396454
Test DOP calculation across time is properly added to NAV data.
455+
456+
Parameters
457+
----------
458+
navdata : NavData
459+
A NavData with multiple timesteps (i.e., as in real data).
460+
461+
which_dop : dict
462+
A dictionary specifying which DOP values to calculate.
397463
"""
398464

399465
# Make a deep copy of which_dop to ensure it was not editted
@@ -464,6 +530,11 @@ def test_dop_across_time_with_selection(navdata, which_dop):
464530
def test_splat_unsplat_dop_matrix_across_time(navdata):
465531
"""
466532
Test that we can splat and unsplat the DOP matrix across time.
533+
534+
Parameters
535+
----------
536+
navdata : NavData
537+
A NavData with multiple timesteps (i.e., as in real data).
467538
"""
468539

469540
# Run through the data, calculate the DOP, and store as navdata

0 commit comments

Comments
 (0)