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=freqs["ME"], 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)
        )

        Tests that `Diff` throws error when given series to `inverse_transform`
        that has different frequency than fitting data.
        
darts/tests/dataprocessing/transformers/test_diff.py