Skip to content

Commit 92756bd

Browse files
committed
tests(jpk): Adds sample .jpk-qi-image to test suite
Closes #154 AFMReader appears to already be able to read files with `.jpk-qi-image` as the `AFMReader.jpk.load_jpk()` function loads these fine. @sebastienjanel provided a sample file so its been added to the test suite and parameterised tests for the following channels created... - `measuredHeight_trace` - `vDeflection_trace` - `adhesion_trace` - `height_trace` - `slope_trace`
1 parent 794e2d1 commit 92756bd

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

284 KB
Binary file not shown.

tests/test_jpk.py

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,52 @@
1616
[
1717
pytest.param(
1818
"sample_0.jpk", "height_trace", 1.2770176335964876, (256, 256), float, 219242202.8256843, id="test image 0"
19-
)
19+
),
20+
pytest.param(
21+
"sample_0.jpk-qi-image",
22+
"height_trace",
23+
4.999999999999986,
24+
(100, 100),
25+
float,
26+
31593146.16051172,
27+
id="qi-image 0; height_trace",
28+
),
29+
pytest.param(
30+
"sample_0.jpk-qi-image",
31+
"slope_trace",
32+
4.999999999999986,
33+
(100, 100),
34+
float,
35+
626.3810326940231,
36+
id="qi-image 0; slope_trace",
37+
),
38+
pytest.param(
39+
"sample_0.jpk-qi-image",
40+
"adhesion_trace",
41+
4.999999999999986,
42+
(100, 100),
43+
float,
44+
1.579363986493833e-06,
45+
id="qi-image 0; adhesion_trace",
46+
),
47+
pytest.param(
48+
"sample_0.jpk-qi-image",
49+
"measuredHeight_trace",
50+
4.999999999999986,
51+
(100, 100),
52+
float,
53+
32181137.138706185,
54+
id="qi-image 0; measuredHeight_trace",
55+
),
56+
pytest.param(
57+
"sample_0.jpk-qi-image",
58+
"vDeflection_trace",
59+
4.999999999999986,
60+
(100, 100),
61+
float,
62+
-1.3615033224242345e-05,
63+
id="qi-image 0; vDeflection_trace",
64+
),
2065
],
2166
)
2267
def test_load_jpk(
@@ -30,7 +75,6 @@ def test_load_jpk(
3075
"""Test the normal operation of loading a .jpk file."""
3176
result_image = np.ndarray
3277
result_pixel_to_nm_scaling = float
33-
3478
file_path = RESOURCES / file_name
3579
result_image, result_pixel_to_nm_scaling = jpk.load_jpk(file_path, channel) # type: ignore
3680

0 commit comments

Comments
 (0)