etna icon indicating copy to clipboard operation
etna copied to clipboard

[BUG] Non-deterministic order of segments during plotting

Open Mr-Geekman opened this issue 2 years ago • 0 comments

🐛 Bug Report

If you run ts.plot on the same dataset in different jupyter sessions, the sequence of segments will be different. May be it will be better if order will be the same each time.

Expected behavior

Order of segments during plotting is the same for all plotting methods that use different plots for each segment.

Probable solution is to make look at plotting functions and sort the segments inside them.

Places to fix:

  • analysis.decomposition.plot_trend: sort ts.segments
  • analysis.forecast.plot_forecast: sort segments
  • analysis.forecast.plot_forecast_decomposition: sort segments
  • datasets.tsdataset.TSDataset.plot: sort segments

How To Reproduce

  1. Run get_started notebook.
  2. Restart kernel and rerun get_started notebook and check that order of segments in plot_forecast changed.

Environment

No response

Additional context

No response

Checklist

  • [X] Bug appears at the latest library version

Mr-Geekman avatar Jan 19 '23 08:01 Mr-Geekman