@@ -161,6 +161,34 @@ def test_full_rainflow_recorder_empty_histogram_5_bins():
161161 np .testing .assert_array_equal (histogram , np .zeros ((5 , 5 )))
162162
163163
164+ def test_full_rainflow_recorder_empty_histogram_interval_index_success ():
165+ fr = RFR .FullRecorder ()
166+ interval_bins = pd .interval_range (start = - 10.0 , end = 10.0 , periods = 5 )
167+ histogram , _ , _ = fr .histogram_numpy (bins = interval_bins )
168+ np .testing .assert_array_equal (histogram , np .zeros ((5 , 5 )))
169+
170+
171+ def test_full_rainflow_recorder_empty_histogram_interval_array_success ():
172+ fr = RFR .FullRecorder ()
173+ interval_bins = pd .arrays .IntervalArray .from_breaks (np .linspace (- 10.0 , 10.0 , 6 ))
174+ histogram , _ , _ = fr .histogram_numpy (bins = interval_bins )
175+ np .testing .assert_array_equal (histogram , np .zeros ((5 , 5 )))
176+
177+
178+ def test_full_rainflow_recorder_empty_histogram_interval_bins_overlapping ():
179+ fr = RFR .FullRecorder ()
180+ interval_bins = pd .IntervalIndex .from_tuples ([(0.0 , 2.0 ), (1.0 , 3.0 ), (2.0 , 4.0 )])
181+ with pytest .raises (ValueError , match = "Intervals must not overlap and must be continuous and monotonic." ):
182+ histogram , _ , _ = fr .histogram_numpy (bins = interval_bins )
183+
184+
185+ def test_full_rainflow_recorder_empty_histogram_interval_bins_non_continous ():
186+ fr = RFR .FullRecorder ()
187+ interval_bins = pd .IntervalIndex .from_tuples ([(0.0 , 1.0 ), (2.0 , 3.0 ), (4.0 , 5.0 )])
188+ with pytest .raises (ValueError , match = "Intervals must not overlap and must be continuous and monotonic." ):
189+ histogram , _ , _ = fr .histogram_numpy (bins = interval_bins )
190+
191+
164192@pytest .mark .parametrize ('value_from, value_to, index_from, index_to' , [
165193 (23. , 42. , 11 , 17 ),
166194 (46. , 84. , 22 , 34 )
0 commit comments