docstr: Tests that `Diff` throws error when given series to `inverse_transform`
  which starts at a date not equal to the first data of the fitting data.
docstr_tok: ["Tests","that","`","Diff","`","throws","error","when","given","series","to","`","inverse_transform","`","which","starts","at","a","date","not","equal","to","the","first","data","of","the","fitting","data","."]
code: def test_diff_incompatible_inverse_transform_date(self):
      """
      Tests that `Diff` throws error when given series to `inverse_transform`
      which starts at a date not equal to the first data of the fitting data.
      """
      vals = np.random.rand(10, 5)
      series1 = TimeSeries.from_times_and_values(
          values=vals,
          times=pd.date_range(start="1/1/2018", freq="d", periods=10),
      )
      series2 = TimeSeries.from_times_and_values(
          values=vals,
          times=pd.date_range(start="1/2/2018", freq="d", periods=10),
      )
      for dropna in (False, True):
          diff = Diff(lags=1, dropna=dropna)
          diff.fit(series1)
          series2_diffed = series2.diff(n=1, periods=1, dropna=dropna)
          with pytest.raises(ValueError) as e:
              diff.inverse_transform(series2_diffed)
          expected_start = (
              series1.start_time()
              if (not dropna)
              else series1.start_time() + series1.freq
          )
          assert (
              f"Expected series to begin at time {expected_start}; "
              f"instead, it begins at time {series2_diffed.start_time()}."
          ) == str(e.value)
  
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 8 for calling the TestDiff obj's underlying member method code with example usage: obj.test_diff_incompatible_inverse_transform_date() without return types