douglasrizzo / catsim

Computerized Adaptive Testing Simulator
GNU Lesser General Public License v3.0
124 stars 35 forks source link

Error running example #14

Closed Randy-Ram closed 5 years ago

Randy-Ram commented 5 years ago

Hey,

Not sure if this project is still supported but I'm trying to run the "Autonomous Usage" code that was shown in the docs and I'm getting the below error. Can you say if something has changed or needs to be updated?


File "/Users/rram/PycharmProjects/CAT_Testing/mac_venv/lib/python3.7/site-packages/catsim/selection.py", line 83, in <listcomp>

valid_indexes_low_r = [index for index in valid_indexes if items[index, 4] < self._r_max]

IndexError: index 4 is out of bounds for axis 1 with size 4```
douglasrizzo commented 5 years ago

Hi there @HyperManTT , thanks for showing interest in the project. While I've not been implementing anything new on catsim, since I'm not working with adaptive tests anymore, I am still interested in fixing bugs in the project and keeping it usable. I will take a look at this issue in the coming days.

Randy-Ram commented 5 years ago

Thanks @douglasrizzo. Thanks for the response. Really appreciate it.

douglasrizzo commented 5 years ago

I found the problem. When the Simulator object receives the item matrix, if this matrix doesn't have 5 columns (4 for the item parameters and the last one for the exposure rate), the simulator adds the last column before starting simulations. You can see it in these lines.

However, when the components are used autonomously (outside of a Simulator object) this column is not created and we get an out of bounds error. The correct thing to do, I believe, would be to check which components mention this column and which ones of these can either generate the column, ignore its value or throw a more informative error. I believe only selectors actually mention that column, but I'll have to check that.

douglasrizzo commented 5 years ago

I have pushed a few commits to the testing branch. I have tested the "autonomous usage" examples and they are working now. As soon as the automated tests are finished, I'll push a new version do PyPI and to the master branch.

douglasrizzo commented 5 years ago

This has been fixed in d6259796d00d139cfbeea8cc337cf431801e95c0.