pipeline.domain.spectralwindow.compress

compress(values: Sequence[int | float]) Sequence[int | float] | ArithmeticProgression[source]

Compress (if possible) a sequence of values.

If the numbers in the given list constitute an arithmetic progression, return an ArithmeticProgression object that summarises it as such. If the list cannot be summarised as a simple arithmetic progression, return the list as given.