docstr: MIDAS needs the high frequency period name in order to easily reverse_transform
  TimeSeries, the parallelization is handled by `transform` and/or `inverse_transform`
  (see InvertibleDataTransformer.__init__() docstring).
docstr_tok: ["MIDAS","needs","the","high","frequency","period","name","in","order","to","easily","reverse_transform","TimeSeries",",","the","parallelization","is","handled","by","`","transform","`","and\/or","`","inverse_transform","`","(","see","InvertibleDataTransformer.__init__","(",")","docstring",")","."]
code: def ts_fit(
      series: Union[TimeSeries, Sequence[TimeSeries]],
      params: Mapping[str, Any],
      *args,
      **kwargs,
  ) -> Union[Dict[str, Any], List[Dict[str, Any]]]:
      """MIDAS needs the high frequency period name in order to easily reverse_transform
      TimeSeries, the parallelization is handled by `transform` and/or `inverse_transform`
      (see InvertibleDataTransformer.__init__() docstring).
      """
      is_single_series = isinstance(series, TimeSeries)
  
      if is_single_series:
          series = [series]
  
      fitted_params = []
      low_freq = params["fixed"]["_low_freq"]
      for idx, ts in enumerate(series):
          high_freq = ts.freq_str
          if not pd.tseries.frequencies.is_subperiod(
              pd.tseries.frequencies.get_period_alias(high_freq),
              pd.tseries.frequencies.get_period_alias(low_freq),
          ):
              raise_log(
                  ValueError(
                      f"The frequency string of the series at index={idx} must be higher than the "
                      f"`low_freq` set at MIDAS creation. "
                      f"Received series frequency {high_freq} against `low_freq={low_freq}`"
                  ),
                  logger=logger,
              )
          fitted_params.append(
              {
                  "high_freq": high_freq,
                  "start": ts.start_time(),
                  "end": ts.end_time(),
              }
          )
      return fitted_params[0] if is_single_series else fitted_params
  
file_path: darts/darts/dataprocessing/transformers/midas.py
imports: from typing import Any, Dict, List, Mapping, Optional, Sequence, Union
  import numpy
  import pandas
  from darts import TimeSeries
  from darts.dataprocessing.transformers import FittableDataTransformer, InvertibleDataTransformer
  from darts.logging import get_logger, raise_log
  from darts.timeseries import _finite_rows_boundaries
  from darts.utils.timeseries_generation import generate_index
label_desc: Use image node_id 2 for calling the MIDAS obj's underlying member method code with example usage: obj.ts_fit(series, params) and returns: unknown