mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 11:33:32 +01:00
Pulse: fix import pairwise for python <3.10
This commit is contained in:
parent
208bd9a35d
commit
fd636247b9
1 changed files with 11 additions and 1 deletions
|
@ -5,10 +5,20 @@ from lib import util
|
||||||
from scipy import signal, interpolate, stats
|
from scipy import signal, interpolate, stats
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from itertools import zip_longest, pairwise
|
from itertools import zip_longest
|
||||||
import h5py
|
import h5py
|
||||||
from copy import deepcopy
|
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:
|
try:
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in a new issue