def test_diagonal_averaging(X, arr_desired):
    """Test that the actual results are the expected ones."""
    X = np.asarray(X, dtype='float64')
    n_samples, grouping_size, window_size, n_windows = X.shape
    n_timestamps = window_size + n_windows - 1
    gap = max(n_windows, window_size)

    arr_actual = _diagonal_averaging(
        X, n_samples, n_timestamps, window_size,
        n_windows, grouping_size, gap
    )
    np.testing.assert_allclose(arr_actual, arr_desired, atol=1e-5, rtol=0.)
Test that the actual results are the expected ones.
pyts/decomposition/tests/test_ssa.py