/// Consume two `RegularTimeSeries<1>` and return a `RegularTimeSeries<2>` over a tuple of the
/// original values. If the duration of the two time-series' are different then panic. If the
/// the result is empty, return an empty `RegularTimeSeries`.
pub fn zip(self, other: RegularTimeSeries<1>) -> RegularTimeSeries<2> {
// Each TimeSeries is a Vec of DatePoints. We can therefore just do the checks and use a
// consuming iterator over all the DatePoints.
if self.duration() != other.duration() { panic!() };
// Find first and last dates, then create iterators with this date range and zip.
let first_date = self.first_date().max(other.first_date());
let last_date = self.last_date().min(other.last_date());
let date_range = DateRange::new(Some(first_date), Some(last_date));
let v: Vec<DatePoint<2>> = Vec::new();
let () = self.iter(date_range);
for (dp1, dp2) in self.iter(date_range).zip(other.iter(date_range)) {
// let () = dp1;
v.push(DatePoint::<2>::new(dp1.date(), [ dp1.value(0), dp2.value(0) ]));
}
TimeSeries::<2>::new(v).try_into().unwrap()
}
}