Skip to content

Commit

Permalink
tests(io): Updating target array sums for loading asd files
Browse files Browse the repository at this point in the history
As detailed in #851 the sum of the arrays changes on switching from `topofileformats` > `AFMReader`. The issue notes
some details of investigation.
  • Loading branch information
ns-rse committed Jun 6, 2024
1 parent 87b998b commit 389fb10
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def test_load_scan_asd(load_scan_asd: LoadScans) -> None:
frames, px_to_nm_scaling = load_scan_asd.load_asd()
assert isinstance(frames, np.ndarray)
assert frames.shape == (197, 200, 200)
assert frames.sum() == -71724923530211.84
assert frames.sum() == -1368044348.3393068
assert isinstance(px_to_nm_scaling, float)
assert px_to_nm_scaling == 2.0

Expand Down Expand Up @@ -698,12 +698,14 @@ def test__spm_pixel_to_nm_scaling(
@pytest.mark.parametrize(
("load_scan_object", "length", "image_shape", "image_sum", "filename", "pixel_to_nm_scaling"),
[
("load_scan_spm", 1, (1024, 1024), 30695369.188316286, "minicircle", 0.4940029296875),
("load_scan_ibw", 1, (512, 512), -218091520.0, "minicircle2", 1.5625),
("load_scan_jpk", 1, (256, 256), 286598232.9308627, "file", 1.2770176335964876),
("load_scan_gwy", 1, (512, 512), 33836850.232917726, "file", 0.8468632812499975),
("load_scan_topostats", 1, (1024, 1024), 184140.8593819073, "file", 0.4940029296875),
("load_scan_asd", 197, (200, 200), -673381139990.2344, "file_122", 2.0),
pytest.param("load_scan_spm", 1, (1024, 1024), 30695369.188316286, "minicircle", 0.4940029296875, id="spm"),
pytest.param("load_scan_ibw", 1, (512, 512), -218091520.0, "minicircle2", 1.5625, id="ibw"),
pytest.param("load_scan_jpk", 1, (256, 256), 286598232.9308627, "file", 1.2770176335964876, id="jpk"),
pytest.param("load_scan_gwy", 1, (512, 512), 33836850.232917726, "file", 0.8468632812499975, id="gwy"),
pytest.param(
"load_scan_topostats", 1, (1024, 1024), 184140.8593819073, "file", 0.4940029296875, id="topostats"
),
pytest.param("load_scan_asd", 197, (200, 200), -12843725.967220962, "file_122", 2.0, id="asd"),
],
)
def test_load_scan_get_data(
Expand Down

0 comments on commit 389fb10

Please sign in to comment.