()
| 93 | |
| 94 | #[test] |
| 95 | fn test_number_of_bins() { |
| 96 | let (x, y_1, _) = load_series(); |
| 97 | let n_bins_x = get_optimal_number_of_bins(x.len(), None).expect("n bins x"); |
| 98 | let corr = corrcoef(&x, &y_1); |
| 99 | let n_bins_x_y = get_optimal_number_of_bins(x.len(), Some(corr)).expect("n bins x y"); |
| 100 | |
| 101 | assert_eq!(n_bins_x, 15); |
| 102 | assert_eq!(n_bins_x_y, 9); |
| 103 | } |
| 104 | |
| 105 | /// A correlation of -1 used to reach the bivariate bin formula, divide by zero, and ask for |
| 106 | /// isize::MAX bins, which panicked with "capacity overflow" inside the histogram. |
nothing calls this directly
no test coverage detected