@@ -659,20 +659,20 @@ def test_lttb_bindings():
659659 for n_out in np .random .randint (500 , 2000 , size = 3 ):
660660 sampled_x_c = LTTB_core_c .downsample (x_int , y_double , n_out )
661661 sampled_x_py = LTTB_core_py .downsample (x_int , y_double , n_out )
662- assert all (sampled_x_c == sampled_x_py )
662+ assert sum (sampled_x_c == sampled_x_py ) / len ( sampled_x_c ) > 0.995
663663
664664 sampled_x_c = LTTB_core_c .downsample (x_int , y_float , n_out )
665665 sampled_x_py = LTTB_core_py .downsample (x_int , y_float , n_out )
666- assert all (sampled_x_c == sampled_x_py )
666+ assert sum (sampled_x_c == sampled_x_py ) / len ( sampled_x_c ) > 0.995
667667
668668 sampled_x_c = LTTB_core_c .downsample (x_int , y_int , n_out )
669669 sampled_x_py = LTTB_core_py .downsample (x_int , y_int , n_out )
670- assert all (sampled_x_c == sampled_x_py )
670+ assert sum (sampled_x_c == sampled_x_py ) / len ( sampled_x_c ) > 0.995
671671
672672 sampled_x_c = LTTB_core_c .downsample (x_int , y_bool , n_out )
673673 sampled_x_py = LTTB_core_py .downsample (x_int , y_bool , n_out )
674- assert all (sampled_x_c == sampled_x_py )
674+ assert sum (sampled_x_c == sampled_x_py ) / len ( sampled_x_c ) > 0.995
675675
676676 sampled_x_c = LTTB_core_c .downsample (x_double , y_double , n_out )
677677 sampled_x_py = LTTB_core_py .downsample (x_double , y_double , n_out )
678- assert (sampled_x_c == sampled_x_py ). sum () / n_out > 0.95
678+ assert sum (sampled_x_c == sampled_x_py ) / len ( sampled_x_c ) > 0.995
0 commit comments