ADR-0016: Ability Estimators Issue Their Warnings and Keep Them in the Result#

Status#

Accepted 2026-12-02

Context#

An ability estimator warns about one examinee’s estimate: the weighted likelihood when a ranking integral does not converge, maximum likelihood when its search cannot settle whether a larger likelihood lies beyond its range. The warning pointed at the caller’s line, past irtlib’s own frames, and the weighted likelihood’s named the examinee’s row even in a matrix of one row: “examinee in row 0: “.

catsim estimates one examinee per call, a matrix of one row, so its users read a row they never passed, and catsim could not word the message for its own session. A Python warning reaches the code that called the estimator only through warnings.catch_warnings, which swaps the process-wide filters: it is not thread-safe, and it clears Python’s record of the warnings already shown, so under the default filters a warning shown once per line is shown at every call. irtlib itself caught the warnings of maximum_likelihood’s fallback that way, to rename their rows. The maintainer chose on 2026-12-02 that the warnings stay, and that the result also returns them.

Decision#

  • Every warning about a returned estimate is issued, from the line that called irtlib; no setting turns it off.

  • The row begins a warning about one examinee only when the response matrix has more than one.

  • The result keeps them. AbilityEstimates.warnings holds, for each examinee, the warnings issued about its estimate, as Warning instances of the category issued, without the row: a package that estimates one examinee at a time reads them and words its own message.

  • Code in irtlib that calls an estimator and reports for it runs the estimator within a private context variable that keeps it from issuing its warnings, and issues those of its result itself, with the rows of its own matrix: maximum_likelihood’s fallback, and joint maximum likelihood, whose ability step estimates groups of examinees and reports the last step’s warnings by examinee. The context variable is the calling thread’s alone, and no filter changes.

Consequences#

  • A direct caller sees every warning once per line under the default filters, with the row that locates the examinee in its matrix.

  • catsim has the warnings of its examinee as data, without catching anything.

  • A package that estimates through irtlib sees irtlib’s warning at its own call into irtlib, besides any warning it words from the result.

  • A fallback’s warnings, and a joint calibration’s, carry the caller’s rows. A user’s fallback reports through the estimates it returns: the warnings of irtlib estimators it calls are issued only if it returns them, those it issues itself pass through unchanged, and an estimator it runs in another thread, outside the context variable, issues its own with that thread’s rows.

  • A new warning about an examinee goes into the result and through the shared helper.

Alternatives Considered#

  • A skip_file_prefixes argument, catsim’s directory added to irtlib’s, so the warning points past catsim: it fixes the warning’s location alone, keeping irtlib’s words.

  • A setting that turns the warnings off: a caller who sets it to read the result loses them for every other reader, and the maintainer wants them issued always.

  • Warnings returned only: a researcher calling irtlib directly would miss them.

  • Warnings issued only: a caller of one examinee at a time catches them only by swapping the process-wide filters.

  • The row kept in every message: “row 0” of a matrix of one row tells its caller nothing.