@@ -57,6 +57,42 @@ def test_first_match_used(self):
5757 assert len (idxs ) == 1
5858 assert idxs [0 ] == 1 # First match
5959
60+ def test_large_input (self ):
61+ """Should work correctly with larger arrays."""
62+ simulated = np .linspace (0 , 10 , 1001 )
63+ observed = np .array ([1.0 , 5.0 , 9.0 ])
64+ eps = 0.01
65+
66+ idxs = find_indexes_of_intersections (simulated , observed , eps )
67+
68+ assert len (idxs ) == 3
69+ # Verify values at found indexes are close to observed
70+ for i , o_val in enumerate (observed ):
71+ assert abs (simulated [idxs [i ]] - o_val ) <= eps * 1.01
72+
73+ def test_returns_int_array (self ):
74+ """Return type should be numpy int array."""
75+ simulated = np .array ([0.0 , 0.1 , 0.2 ])
76+ observed = np .array ([0.1 ])
77+ eps = 0.01
78+
79+ idxs = find_indexes_of_intersections (simulated , observed , eps )
80+
81+ assert isinstance (idxs , np .ndarray )
82+ assert idxs .dtype == int
83+
84+ def test_empty_observed_returns_empty_int_array (self ):
85+ """Empty observed array should return empty int array."""
86+ simulated = np .array ([0.0 , 0.1 , 0.2 ])
87+ observed = np .array ([])
88+ eps = 0.01
89+
90+ idxs = find_indexes_of_intersections (simulated , observed , eps )
91+
92+ assert isinstance (idxs , np .ndarray )
93+ assert idxs .dtype == int
94+ assert len (idxs ) == 0
95+
6096
6197class TestCalibratorInitialization :
6298 """Tests for Calibrator initialization."""
0 commit comments