docstr: Tests that differencing a quadratic series (computed by `cumsum`ing a linear series)
  yields the original linear series.
docstr_tok: ["Tests","that","differencing","a","quadratic","series","(","computed","by","`","cumsum","`","ing","a","linear","series",")","yields","the","original","linear","series","."]
code: 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),
          )
  
imports: from copy import deepcopy
  from typing import Optional, Sequence
  import numpy
  import pandas
  import pytest
  from darts.dataprocessing.transformers import Diff
  from darts.timeseries import TimeSeries
  from darts.timeseries import concatenate
  from darts.utils.timeseries_generation import linear_timeseries, sine_timeseries
label_desc: Use image node_id 2 for calling the TestDiff obj's underlying member method code with example usage: obj.test_diff_quad_series() without return types