Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError in genTime function (utils.py) #5

Open
miguelmsemprun opened this issue Apr 5, 2020 · 1 comment
Open

TypeError in genTime function (utils.py) #5

miguelmsemprun opened this issue Apr 5, 2020 · 1 comment

Comments

@miguelmsemprun
Copy link

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants