Skip to content

Commit 0f65fa0

Browse files
rprosperoDrPaulSharp
authored andcommitted
Start on Sesans testing
1 parent b2d497b commit 0f65fa0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/sasdataloader/utest_sasdataload.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from sasdata.temp_ascii_reader import load_data as ascii_load_data
2727
from sasdata.temp_hdf5_reader import load_data as hdf_load_data
2828
from sasdata.temp_xml_reader import load_data as xml_load_data
29+
from sasdata.temp_sesans_reader import load_data as sesans_load_data
2930

3031

3132
def local_load(path: str):
@@ -50,6 +51,8 @@ def local_json_load(path: str):
5051
return local_load(f"{os.path.join('json', path)}")
5152

5253

54+
def local_sesans_load(path: str):
55+
return local_load(f"{os.path.join('sesans_data', path)}")
5356

5457

5558
@pytest.mark.sasdata
@@ -324,6 +327,14 @@ class SesansTestCase(BaseTestCase):
324327
json_file=local_json_load("valid_cansas_xml.json"),
325328
expected_values={},
326329
),
330+
SesansTestCase(
331+
filename=local_sesans_load("sphere2micron.ses"),
332+
metadata_file=local_reference_load("sphere2micron.txt"),
333+
expected_values={
334+
0: {"SpinEchoLength": 391.56, "Depolarisation": 0.0041929},
335+
-1: {"SpinEchoLength": 46099, "Depolarisation": -0.19956},
336+
},
337+
),
327338
]
328339

329340

@@ -367,6 +378,9 @@ def test_load_file(test_case: BaseTestCase):
367378
# Not bulk, so just assume we get one dataset.
368379
combined_data = xml_load_data(test_case.filename)
369380
loaded_data = combined_data[test_case.entry]
381+
case SesansTestCase():
382+
loaded_data = sesans_load_data(test_case.filename)
383+
combined_data = {"only": loaded_data}
370384
case _:
371385
raise ValueError("Invalid loader")
372386
if isinstance(test_case, BulkAsciiTestCase):

0 commit comments

Comments
 (0)