code: def _format_data(self, data):
          return [spectrum for spectrum in \
              sorted(data if isinstance(data, (list, tuple)) else [data],
                  key=lambda x: x.disp[0]) if np.any(np.isfinite(spectrum.flux))]