def test_error_when_frequency_not_suitable_for_midas(self):
        """
        MIDAS can only be performed when the high frequency is the same and the exact multiple of the low frequency.
        For example, there are always exactly three months in a quarter, but the number of days in a month differs.
        So the monthly to quarterly transformation is possible, while the daily to monthly MIDAS transform is
        impossible.
        """
        daily_times = pd.date_range(start="01-2020", end="09-30-2020", freq="D")
        daily_values = np.arange(1, len(daily_times) + 1)
        daily_ts = TimeSeries.from_times_and_values(
            times=daily_times, values=daily_values, columns=["values"]
        )

        midas = MIDAS(low_freq=freqs["ME"])
        with pytest.raises(ValueError) as msg:
            midas.fit_transform(daily_ts)
        assert str(msg.value).startswith(
            "The frequency of the input series should be an exact multiple"
        )

        MIDAS can only be performed when the high frequency is the same and the exact multiple of the low frequency.
        For example, there are always exactly three months in a quarter, but the number of days in a month differs.
        So the monthly to quarterly transformation is possible, while the daily to monthly MIDAS transform is
        impossible.
        
darts/tests/dataprocessing/transformers/test_midas.py