The following code fails using commit bc98686 (a few commits upstream of when plot-violin was merged into develop):
>>> FlowCal.plot.violin(data=[])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\sexto\.conda\envs\py3_anaconda2020.07_fc_JS3xton_bc98686\lib\site-packages\flowcal-1.2.2-py3.8.egg\FlowCal\plot.py", line 1690, in violin
StopIteration
The error occurs when next() is called on an empty iterator when trying to understand data:
# understand `data`
if channel is None:
# assume 1D sequence or sequence of 1D sequences
try:
first_element = next(iter(data)) # <-- fails here
except TypeError:
msg = "`data` should be 1D array or list of 1D arrays."
msg += " Specify `channel` to use ND array or list of ND"
msg += " arrays."
raise TypeError(msg)
# promote singleton if necessary
try:
iter(first_element) # success => sequence of 1D sequences
data_length = len(data)
except TypeError:
data = [data]
data_length = 1
The following code fails using commit bc98686 (a few commits upstream of when
plot-violinwas merged intodevelop):The error occurs when
next()is called on an empty iterator when trying to understanddata: