Skip to content

Commit 9e64145

Browse files
committed
Add test
1 parent 9f6d88c commit 9e64145

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_metrics.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from skmatter.datasets import load_degenerate_CH4_manifold
88
from skmatter.metrics import (
9+
check_global_reconstruction_measures_input,
910
componentwise_prediction_rigidity,
1011
global_reconstruction_distortion,
1112
global_reconstruction_error,
@@ -214,6 +215,17 @@ def test_local_reconstruction_error_test_idx(self):
214215
f"size {test_size}",
215216
)
216217

218+
def test_source_target_len(self):
219+
# tests that the source and target features have the same lenght
220+
X = np.array([[1, 2, 3], [4, 5, 6]])
221+
Y = np.array([[1, 2, 3]])
222+
223+
with self.assertRaises(ValueError) as context:
224+
check_global_reconstruction_measures_input(X, Y)
225+
226+
expected_message = "First dimension of X (2) and Y (1) must match"
227+
self.assertEqual(str(context.exception), expected_message)
228+
217229

218230
class DistanceTests(unittest.TestCase):
219231
@classmethod

0 commit comments

Comments
 (0)