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)
2267def test_load_jpk (
@@ -30,15 +75,14 @@ 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
37- assert result_pixel_to_nm_scaling == pixel_to_nm_scaling
81+ assert result_pixel_to_nm_scaling == pytest . approx ( pixel_to_nm_scaling )
3882 assert isinstance (result_image , np .ndarray )
3983 assert result_image .shape == image_shape
4084 assert result_image .dtype == image_dtype
41- assert result_image .sum () == image_sum
85+ assert result_image .sum () == pytest . approx ( image_sum )
4286
4387
4488def test_load_jpk_file_not_found () -> None :
0 commit comments