def test_lagged_prediction_data_single_lag_single_component_same_series(
        self, config
    ):
        """
        Tests that `create_lagged_prediction_data` correctly produces `X` and `times`
        when all the `series` inputs are identical, and all the `lags` inputs consist
        of a single value. In this situation, the expected `X` value can be found by
        concatenating three different slices of the same time series.
        """
        series_type, use_moving_windows = config
        if series_type == "integer":
            series = linear_timeseries(start=0, length=15)
        else:
            series = linear_timeseries(start=pd.Timestamp("1/1/2000"), length=15)
        lags = [-1]
        past_lags = [-3]
        future_lags = [2]
        # Can't create features for first 3 times (because `past_lags`) and last
        # two times (because `future_lags`):
        expected_times = series.time_index[3:-2]
        # Offset `3:-2` by `-1` lag:
        expected_X_target = series.all_values(copy=False)[2:-3, :, 0]
        # Offset `3:-2` by `-3` lag -> gives `0:-5`:
        expected_X_past = series.all_values(copy=False)[:-5, :, 0]
        # Offset `3:-2` by `+2` lag -> gives `5:None`:
        expected_X_future = series.all_values(copy=False)[5:, :, 0]
        expected_X = np.concatenate(
            [expected_X_target, expected_X_past, expected_X_future], axis=1
        )
        X, times = create_lagged_prediction_data(
            target_series=series,
            past_covariates=series,
            future_covariates=series,
            lags=lags,
            lags_past_covariates=past_lags,
            lags_future_covariates=future_lags,
            uses_static_covariates=False,
            use_moving_windows=use_moving_windows,
        )
        # Number of observations should match number of feature times:
        assert X.shape[0] == len(expected_times)
        assert X.shape[0] == len(times[0])
        # Check that outputs match:
        assert np.allclose(expected_X, X[:, :, 0])
        assert expected_times.equals(times[0])

        Tests that `create_lagged_prediction_data` correctly produces `X` and `times`
        when all the `series` inputs are identical, and all the `lags` inputs consist
        of a single value. In this situation, the expected `X` value can be found by
        concatenating three different slices of the same time series.
        
darts/tests/utils/tabularization/test_create_lagged_prediction_data.py