Command Line – irtlib.cli#
The irtlib command: calibrate, score and check fit on files, from a shell (ADR-0019).
Each command of a calibrator, estimator or fit statistic calls it, and its options other than its files are the
call’s keyword arguments, with hyphens for underscores and the API’s own default when left out:
irtlib calibrate mml --max-cycles 100 calls MMLCalibrator with max_cycles=100. A
settings object takes one option per field, such as --slope-prior MEAN SD for Priors’
slope; --seed is rng, and --prior a normal or uniform ability prior. Arguments that take Python
objects, the grids and maximum_likelihood()’s fallback, have no option.
irtlib <command> --help lists a command’s options.
The files are those of irtlib.files and ItemBank.to_csv, and -D
gives a bank file’s scaling constant. A command prints its result as print() shows it, or, for compare,
classical and draw, a table or a line of its own; writes a file only for an option that names one; and prints
each warning as one line on standard error. It exits with status 0 when it ran, a calibration that did not converge
included; 1 for an error, printed without a traceback; and 2 for a mistake in the command line.
irtlib calibrate {mml,cml,jml,mcmc} RESPONSES [options] [--out CALIBRATION] [--bank-out BANK]
irtlib score {eap,map,ml,wle} RESPONSES --bank BANK [options] [--out ABILITIES]
irtlib score number-correct --bank BANK [--prior KIND A B] [-D D]
irtlib fit {s-x2,mean-squares} RESPONSES --calibration CALIBRATION [options]
irtlib fit persons RESPONSES --bank BANK --abilities ABILITIES [-D D]
irtlib compare CALIBRATION [CALIBRATION ...] --responses RESPONSES [--g2]
irtlib classical RESPONSES
irtlib generate N_ITEMS --out BANK [--model MODEL] [--corr CORR] [--seed SEED] [-D D]
irtlib draw --bank BANK (--examinees N | --abilities ABILITIES) --out RESPONSES [--seed SEED] [-D D]
- irtlib.cli.main(argv: Sequence[str] | None = None) int[source]#
Run the
irtlibcommand and return its exit status.- Parameters:
- argvsequence of str, optional
The command line’s arguments, after the program’s name. Default is None, which reads the process’s.
- Returns:
- int
0 when the command ran, and 1 when it failed with an error, which it prints on standard error. A mistake in the command line exits with status 2 before the command runs.