Skip to content

Commit 5b6e1f6

Browse files
committed
Added testing of the new functions
1 parent 842bf7c commit 5b6e1f6

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

tests/test_tools.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numpy as np
99
import xarray as xr
1010
import gsw
11-
from seagliderOG1 import tools
11+
from seagliderOG1 import tools, readers, convertOG1
1212

1313

1414
def test_convert_units_var():
@@ -53,3 +53,16 @@ def test_calc_z():
5353
depth_z = tools.calc_Z(dataset)["DEPTH_Z"].values
5454

5555
assert np.array_equal(depth, depth_z)
56+
57+
def test_add_hdm_parameters():
58+
source = str(parent_dir / "data/demo_sg005")
59+
print("Testing load_basestation_files with source:", source)
60+
start_profile = 1
61+
end_profile = 5
62+
datasets = readers.load_basestation_files(source, start_profile, end_profile)
63+
hdm_parameters = tools.extract_hdm_parameters(datasets)
64+
ds_OG1, vars = convertOG1.convert_to_OG1(datasets)
65+
ds_OG1 = tools.add_hdm_parameters(ds_OG1, hdm_parameters)
66+
### check if the hdm parameters are added to the dataset and have the expected values
67+
for param in hdm_parameters:
68+
assert param in ds_OG1

0 commit comments

Comments
 (0)