docstr: Tests that `Diff` throws error when given series to `inverse_transform`
  that has different frequency than fitting data.
docstr_tok: ["Tests","that","`","Diff","`","throws","error","when","given","series","to","`","inverse_transform","`","that","has","different","frequency","than","fitting","data","."]
code: def test_diff_incompatible_inverse_transform_freq(self):
      """
      Tests that `Diff` throws error when given series to `inverse_transform`
      that has different frequency than 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="W", periods=10),
      )
      series2 = TimeSeries.from_times_and_values(
          values=vals,
          times=pd.date_range(start="1/1/2018", freq="M", periods=10),
      )
      diff = Diff(lags=1, dropna=True)
      diff.fit(series1)
      with pytest.raises(ValueError) as e:
          diff.inverse_transform(
              series2.diff(n=1, periods=1, dropna=True)
          )
      assert (
          f"Series is of frequency {series2.freq}, but transform was fitted to data of frequency {series1.freq}."
          == 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 9 for calling the TestDiff obj's underlying member method code with example usage: obj.test_diff_incompatible_inverse_transform_freq() without return types