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

examples/stats_tuning example does not work #6

Closed
tokekark opened this issue Dec 6, 2017 · 3 comments
Closed

examples/stats_tuning example does not work #6

tokekark opened this issue Dec 6, 2017 · 3 comments

Comments

@tokekark
Copy link

tokekark commented Dec 6, 2017

I have installed cochlea on Ubuntu and trying to run stats_tuning.py. This gives a strange error as follows. I havn't changed any code.
ERROR STACK -
Traceback (most recent call last):
File "stats_tuning.py", line 41, in
main()
File "stats_tuning.py", line 24, in main
model_pars={'species': 'human'}
File "/usr/local/lib/python3.6/dist-packages/cochlea/stats/tuning.py", line 53, in calc_tuning
model_pars=model_pars
File "/usr/local/lib/python3.6/dist-packages/thorns/util/maps.py", line 387, in wrap
result = func(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/cochlea/stats/threshold_rate.py", line 88, in calc_spont_threshold
silence = np.zeros(fs*tmax)
TypeError: 'float' object cannot be interpreted as an integer

@mrkrd
Copy link
Owner

mrkrd commented Dec 7, 2017 via email

@tokekark
Copy link
Author

tokekark commented Dec 8, 2017

Yes I realized the python 3.6 related issue and made a small fix in my local code. Those worked for me very well. (Thanks for your prompt response.)

  1. cochlea/stats/threshold_rate.py - line 88
(silence = np.zeros(fs*tmax)) 
#replaced by silence = np.zeros(int(fs*tmax))

In Thorns
2. thorns/util/maps.py - attribute "'func_name" replaced with "name".
See if these are correct fixes (though did not check impact on rest of the code). In case you want me fix those let me know (I am new to github)

@tokekark tokekark closed this as completed Dec 8, 2017
@mrkrd
Copy link
Owner

mrkrd commented Dec 8, 2017 via email

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