diff --git a/simulations/11_pulsed_timing.py b/simulations/11_pulsed_timing.py index eb7fb7f..a2e36a9 100755 --- a/simulations/11_pulsed_timing.py +++ b/simulations/11_pulsed_timing.py @@ -5,10 +5,20 @@ from lib import util from scipy import signal, interpolate, stats import matplotlib.pyplot as plt import numpy as np -from itertools import zip_longest, pairwise +from itertools import zip_longest import h5py from copy import deepcopy +try: + from itertools import pairwise +except: # pairwise only introduced since python 3.10 + from itertools import tee + def pairwise(iterable): + # pairwise('ABCDEFG') --> AB BC CD DE EF FG + a, b = tee(iterable) + next(b, None) + return zip(a, b) + try: from tqdm import tqdm except: