Bug when supplying a 1D array as event times
guidomeijer opened this issue · 2 comments
guidomeijer commented
Thanks for providing this amazing statistical test with python code! There currently is a bug in the code that prevents inputting a 1D array as matEventTimes while the docstring states that it should be possible. To fix it you have to change lines 100-103 to the following:
if len(matEventTimes.shape) > 1:
boolStopSupplied = True
if np.shape(matEventTimes)[1] > 2:
matEventTimes = np.transpose(matEventTimes)
else:
matEventTimes = np.vstack((matEventTimes, np.zeros(matEventTimes.shape))).T
Cheers, Guido
heimel commented
Hey Guido,
Thanks a lot for detecting the bug and fixing it! I have uploaded your
bugfix.
The python code may contain some more bugs. Python is not my native
language. I have just tested the python translation on the examples
supplied with the matlab code. If you find more, perhaps Jorrit can also
make you a contributor if you like.
Have a good weekend,
Alexander
…On Fri, Feb 18, 2022 at 12:59 PM Guido Meijer ***@***.***> wrote:
Thanks for providing this amazing statistical test with python code! There
currently is a bug in the code that prevents inputting a 1D array as
matEventTimes while the docstring states that it should be possible. To fix
it you have to change lines 100-103 to the following:
if len(matEventTimes.shape) > 1:
boolStopSupplied = True
if np.shape(matEventTimes)[1] > 2:
matEventTimes = np.transpose(matEventTimes)
else:
matEventTimes = np.vstack((matEventTimes, np.zeros(matEventTimes.shape))).T
Cheers, Guido
—
Reply to this email directly, view it on GitHub
<#1>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOCJTZTOVT2WGN3SI5OLEDU3YYDRANCNFSM5OXV3LIA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
guidomeijer commented
Thanks for pushing the fix. Yes I'd be happy to help improve the python code! I already found a couple of other bugs.