Closed wulfdewolf closed 7 months ago
In plotzeta2, np.round is used to round to integers. However, np.round does not intrinsically return integers, if any of its arguments is a float, a float is returned.
plotzeta2
np.round
On lines 227 & 228 in plot_dependencies.py, this results in a type mismatch:
227 intPlotSpikeNum1 = np.round(dblReduceSpikesBy * vecSpikeTimes1.size) 228 intPlotSpikeNum2 = np.round(dblReduceSpikesBy * vecSpikeTimes2.size)
and on lines 233 & 234 in plot_dependencies.py, the result of np.linspace has to be rounded to integers as well:
np.linspace
233 vecSpikeT1_reduced = vecSpikeTimes1[np.round(np.linspace(0, vecSpikeTimes1.size-1, intPlotSpikeNum1))] 234 vecSpikeT2_reduced = vecSpikeTimes1[np.round(np.linspace(0, vecSpikeTimes2.size-1, intPlotSpikeNum2))]
The same issue occurs in plotzeta, but only for the np.linspace case.
On line 388 in plot_dependencies.py:
378 vecSpikeT_reduced = vecSpikeTimes[np.round(np.linspace(0, vecSpikeTimes.size-1, intPlotSpikeNum))]
All of these can be fixed by adding .astype(int).
.astype(int)
I am using Ubuntu 22.04.3 LTS, with the latest commit of the repository 1bd4862, and numpy version 1.24.4.
Thank you for your fix! I've merged the pull request and updated the pip package, zetapy 3.0.5 contains this fix.
In
plotzeta2
,np.round
is used to round to integers. However,np.round
does not intrinsically return integers, if any of its arguments is a float, a float is returned.On lines 227 & 228 in plot_dependencies.py, this results in a type mismatch:
and on lines 233 & 234 in plot_dependencies.py, the result of
np.linspace
has to be rounded to integers as well:The same issue occurs in plotzeta, but only for the
np.linspace
case.On line 388 in plot_dependencies.py:
All of these can be fixed by adding
.astype(int)
.I am using Ubuntu 22.04.3 LTS, with the latest commit of the repository 1bd4862, and numpy version 1.24.4.