HIIT / Ledapy

Partial Python port of Ledalab (www.ledalab.de)
MIT License
16 stars 5 forks source link

TypeError in genTime function (utils.py) #5

Open miguelmsemprun opened 4 years ago

miguelmsemprun commented 4 years ago

Hi, I continue using your program and I have detected a problem with the linspace function. It expects int type parameters but gets float because the "seconds" parameter passed is len(conductance) / srate. The error is: File "C:\Users\migue\PythonProjects\testlib-master.venv\lib\site-packages\ledapy\utils.py", line 247, in genTimeVector return genTime(len(conductance) / srate, srate) File "C:\Users\migue\PythonProjects\testlib-master.venv\lib\site-packages\ledapy\utils.py", line 239, in genTime return np.linspace(0, seconds, seconds * srate) File "<__array_function__ internals>", line 5, in linspace File "C:\Users\migue\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numpy\core\function_base.py", line 119, in linspace raise TypeError( TypeError: object of type <class 'float'> cannot be safely interpreted as an integer.

MarcoFiletti commented 4 years ago

Hi, I changed the genTime function to use the length of the vector instead of doing the multiplication. Does it seem ok now?