docstr: Tests that `Diff` throws error when given series to `inverse_transform`
  that has different number of components or samples than the fitting data.
docstr_tok: ["Tests","that","`","Diff","`","throws","error","when","given","series","to","`","inverse_transform","`","that","has","different","number","of","components","or","samples","than","the","fitting","data","."]
code: def test_diff_incompatible_inverse_transform_shape(self):
      """
      Tests that `Diff` throws error when given series to `inverse_transform`
      that has different number of components or samples than the fitting data.
      """
      vals = np.random.rand(10, 5, 5)
      dates = pd.date_range(start="1/1/2018", freq="W", periods=10)
      series = TimeSeries.from_times_and_values(
          values=vals, times=dates
      )
      diff = Diff(lags=1, dropna=True)
      diff.fit(series)
      series_rm_comp = TimeSeries.from_times_and_values(
          values=vals[:, 1:, :], times=dates
      )
      with pytest.raises(ValueError) as e:
          diff.inverse_transform(
              series_rm_comp.diff(n=1, periods=1, dropna=True)
          )
      assert (
          f"Expected series to have {series.n_components} components; "
          f"instead, it has {series.n_components-1}." == str(e.value)
      )
      series_rm_samp = TimeSeries.from_times_and_values(
          values=vals[:, :, 1:], times=dates
      )
      with pytest.raises(ValueError) as e:
          diff.inverse_transform(
              series_rm_samp.diff(n=1, periods=1, dropna=True)
          )
      assert (
          f"Expected series to have {series.n_samples} samples; "
          f"instead, it has {series.n_samples-1}." == 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 10 for calling the TestDiff obj's underlying member method code with example usage: obj.test_diff_incompatible_inverse_transform_shape() without return types