def test_diff_quad_series(self):
        """
        Tests that differencing a quadratic series (computed by `cumsum`ing a linear series)
        yields the original linear series.
        """
        lin_series = linear_timeseries(start_value=1, end_value=10, length=50)
        quad_series = TimeSeries(lin_series.data_array().cumsum(axis=0))
        for dropna in (False, True):
            diff = Diff(lags=1, dropna=dropna)
            diff.fit(quad_series)
            # Differencing causes first point to be 'dropped':
            transformed_series = diff.transform(quad_series)
            expected_transform = lin_series.drop_before(0)
            if not dropna:
                expected_transform = expected_transform.prepend_values([np.nan])
            self.assert_series_equal(
                expected_transform, transformed_series, equal_nan=(not dropna)
            )
            self.assert_series_equal(
                series1=quad_series,
                series2=diff.inverse_transform(transformed_series),
                equal_nan=(not dropna),
            )

        Tests that differencing a quadratic series (computed by `cumsum`ing a linear series)
        yields the original linear series.
        
darts/tests/dataprocessing/transformers/test_diff.py