mslugocki / bayesfit

Bayesian Psychometric Curve Fitting Tool
Apache License 2.0
45 stars 8 forks source link

TypeError: 'float' object cannot be interpreted as an integer #8

Closed dominikstrb closed 3 years ago

dominikstrb commented 4 years ago

Hi!

First of all, thanks for this easy-to-use package for fitting psychometric functions! Lately, I am having one issue, though. If I input a numpy array to the fitmodel function, I get a TypeError: 'float' object cannot be interpreted as an integer.

Example code:

import bayesfit as bf

x = np.array([[ 1, 19, 40],
       [ 2, 26, 40],
       [ 3, 32, 40],
       [ 4, 38, 40]])

bf.fitmodel(x, nafc=2)

I am not sure if this is due to my numpy version. I am using version 1.18.1

Thanks, Dominik

mslugocki commented 4 years ago

Yes, indeed this is an issue that crops up as of numpy version 1.18. I changed the requirements.txt to reflect this, and force require numpy>=1.11.0,<=1.17.0.

For the time being, my recommendation is to create a virtual python environment that uses a numpy version less than 1.18 by installing all the required packages via the requirements file.

git clone --recursive https://github.com/slugocm/bayesfit.git cd bayesfit python setup.py install

I will try to set aside some time to fix this issue. Otherwise, always happy to review merge requests if you get around to it sooner than me :) Will keep issue open so others are aware of current workaround.

Best, M