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

Fix normalize_item_bank(...) #22

Merged
merged 1 commit into from
May 24, 2021

Conversation

frankier
Copy link
Contributor

Currently calling normalize_item_bank(...) on an array like so:

[[-2.0044746   1.1755979 ]
 [-1.7894522   1.047313  ]
 [-0.94069207  1.0814952 ]
 ...
 [-1.4703591   0.8663169 ]
 [ 0.59085643  0.7291509 ]
 [-1.177184    1.002756  ]]

Gives:

    bank = normalize_item_bank(bank)
  File "path/to/catsim/irt.py", line 336, in normalize_item_bank
    items = numpy.append(items, numpy.zeros((items.shape[0])), axis=1)
  File "<__array_function__ internals>", line 5, in append
  File "path/to/numpy/lib/function_base.py", line 4745, in append
    return concatenate((arr, values), axis=axis)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 1 dimension(s)

This PR fixes up the shapes of the extra columns.

@douglasrizzo douglasrizzo merged commit 737260c into douglasrizzo:master May 24, 2021
@douglasrizzo
Copy link
Owner

Nice catch. Thanks for that. I was able to reproduce it on my end and the problem is now gone.

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

Successfully merging this pull request may close these issues.

2 participants