Skip to content

fix: validate response data inputs#15

Merged
kholdrex merged 4 commits into
mainfrom
fix/validate-response-data
Jun 4, 2026
Merged

fix: validate response data inputs#15
kholdrex merged 4 commits into
mainfrom
fix/validate-response-data

Conversation

@kholdrex
Copy link
Copy Markdown
Member

@kholdrex kholdrex commented Jun 3, 2026

Summary

Adds constructor-time validation for response data passed to the Rasch, 2PL, and 3PL models. The models now reject malformed input with clear ArgumentError messages instead of allowing ambiguous failures or invalid fits.

Changes

  • Adds a shared response data validator for all three model constructors.
  • Requires response data to be a non-empty rectangular Matrix or array-of-arrays.
  • Allows only integer 0, integer 1, and nil response values.
  • Documents the stricter input contract in the README and changelog.
  • Adds shared specs for invalid shapes, invalid values, direct type rejection, and strict binary response handling.

Test plan

  • RSpec suite passed.
  • RuboCop passed with no offenses.
  • Direct model-file require smoke checks passed.
  • Gem build/package check passed.

@kholdrex kholdrex merged commit 1bd558b into main Jun 4, 2026
4 checks passed
@kholdrex kholdrex deleted the fix/validate-response-data branch June 4, 2026 02:40
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.

1 participant