Skip to content

Commit

Permalink
Add tolerance when comparing transform parameter objects
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed Dec 20, 2024
1 parent 87f7c58 commit 5f80694
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ def compare_parameter_objects(param_obj1, param_obj2):
submap_1 = dict(param_obj1.GetParameterMap(index))
submap_2 = dict(param_obj2.GetParameterMap(index))

assert submap_1 == submap_2
for key in submap_1.keys():
if key == "TransformParameters":
assert np.allclose(
np.array(submap_1[key], dtype=np.double),
np.array(submap_2[key], dtype=np.double),
)
else:
assert submap_1[key] == submap_2[key]


@pytest.fixture(scope="module")
Expand Down

0 comments on commit 5f80694

Please sign in to comment.