docstr: 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.
docstr_tok: ["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","."]
code: 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="M")
      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"
      )
  
imports: import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.dataprocessing.transformers import MIDAS
  from darts.models import LinearRegressionModel
  from darts.utils.timeseries_generation import generate_index, linear_timeseries
label_desc: Use image node_id 10 for calling the TestMIDAS obj's underlying member method code with example usage: obj.test_error_when_frequency_not_suitable_for_midas() without return types