flexpyirt 0.0.1__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flexpyirt-0.2.0/.gitignore +19 -0
- flexpyirt-0.2.0/CITATION.cff +29 -0
- flexpyirt-0.2.0/CONTRIBUTING.ja.md +207 -0
- flexpyirt-0.2.0/CONTRIBUTING.md +240 -0
- flexpyirt-0.2.0/PKG-INFO +227 -0
- flexpyirt-0.2.0/README.ja.md +185 -0
- flexpyirt-0.2.0/README.md +193 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/README.ja.md +46 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/README.md +53 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/data.py +54 -8
- flexpyirt-0.2.0/benchmarks/emm_3pl.py +230 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/report.py +54 -1
- flexpyirt-0.2.0/benchmarks/results/2026-11-26-many-groups.json +1069 -0
- flexpyirt-0.2.0/benchmarks/results/2026-11-26-many-groups.md +53 -0
- flexpyirt-0.2.0/benchmarks/results/2026-11-28-emm-3pl.json +7398 -0
- flexpyirt-0.2.0/benchmarks/results/2026-11-28-emm-3pl.md +57 -0
- flexpyirt-0.2.0/benchmarks/run_batched.py +196 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/run_flexpyirt.py +79 -7
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/run_mirt.R +32 -3
- flexpyirt-0.2.0/benchmarks/sparse_grid.py +97 -0
- flexpyirt-0.2.0/benchmarks/sparse_grid_mirt.R +24 -0
- flexpyirt-0.2.0/benchmarks/sparse_grid_study.py +324 -0
- flexpyirt-0.2.0/docs/accuracy.ja.md +284 -0
- flexpyirt-0.2.0/docs/accuracy.md +319 -0
- flexpyirt-0.2.0/docs/case-studies.ja.md +28 -0
- flexpyirt-0.2.0/docs/case-studies.md +30 -0
- flexpyirt-0.2.0/docs/citation.ja.md +51 -0
- flexpyirt-0.2.0/docs/citation.md +55 -0
- flexpyirt-0.2.0/docs/comparison.ja.md +40 -0
- flexpyirt-0.2.0/docs/comparison.md +42 -0
- flexpyirt-0.2.0/docs/dev/API.ja.md +212 -0
- flexpyirt-0.2.0/docs/dev/API.md +226 -0
- flexpyirt-0.2.0/docs/dev/DESIGN.ja.md +3947 -0
- flexpyirt-0.2.0/docs/dev/DESIGN.md +5135 -0
- flexpyirt-0.2.0/docs/dev/ROADMAP.ja.md +180 -0
- flexpyirt-0.2.0/docs/dev/ROADMAP.md +247 -0
- flexpyirt-0.2.0/docs/dev/VALIDATION.ja.md +1379 -0
- flexpyirt-0.2.0/docs/dev/VALIDATION.md +1775 -0
- flexpyirt-0.2.0/docs/features.ja.md +94 -0
- flexpyirt-0.2.0/docs/features.md +99 -0
- flexpyirt-0.2.0/docs/guide.ja.md +2177 -0
- flexpyirt-0.2.0/docs/guide.md +2431 -0
- flexpyirt-0.2.0/docs/images/plots/dif.png +0 -0
- flexpyirt-0.2.0/docs/images/plots/expected_score.png +0 -0
- flexpyirt-0.2.0/docs/images/plots/information.png +0 -0
- flexpyirt-0.2.0/docs/images/plots/item_curves.png +0 -0
- flexpyirt-0.2.0/docs/images/plots/wright_map.png +0 -0
- flexpyirt-0.2.0/docs/images/readme/information.png +0 -0
- flexpyirt-0.2.0/docs/images/readme/item_curves.png +0 -0
- flexpyirt-0.2.0/docs/index.ja.md +163 -0
- flexpyirt-0.2.0/docs/index.md +168 -0
- flexpyirt-0.2.0/docs/mirt-users.ja.md +162 -0
- flexpyirt-0.2.0/docs/mirt-users.md +171 -0
- flexpyirt-0.2.0/docs/reference.ja.md +2488 -0
- flexpyirt-0.2.0/docs/reference.md +2749 -0
- flexpyirt-0.2.0/docs/theory.ja.md +644 -0
- flexpyirt-0.2.0/docs/theory.md +766 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/mkdocs.yml +24 -10
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/pyproject.toml +25 -8
- flexpyirt-0.2.0/scripts/check_plotting_without_matplotlib.py +65 -0
- flexpyirt-0.2.0/scripts/compare_references.py +226 -0
- flexpyirt-0.2.0/scripts/guide_figures.py +55 -0
- flexpyirt-0.2.0/scripts/readme_figures.py +50 -0
- flexpyirt-0.2.0/src/flexpyirt/__init__.py +195 -0
- flexpyirt-0.2.0/src/flexpyirt/_batch.py +389 -0
- flexpyirt-0.2.0/src/flexpyirt/_classification.py +67 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/_compile.py +701 -157
- flexpyirt-0.2.0/src/flexpyirt/_core.py +3116 -0
- flexpyirt-0.2.0/src/flexpyirt/_dif.py +323 -0
- flexpyirt-0.2.0/src/flexpyirt/_equating.py +353 -0
- flexpyirt-0.2.0/src/flexpyirt/_information.py +122 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/_itemfit.py +20 -12
- flexpyirt-0.2.0/src/flexpyirt/_jsi.py +140 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/_json.py +312 -35
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/_linking.py +507 -28
- flexpyirt-0.2.0/src/flexpyirt/_local_dependence.py +214 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/_m2.py +228 -50
- flexpyirt-0.2.0/src/flexpyirt/_newton.py +232 -0
- flexpyirt-0.2.0/src/flexpyirt/_personfit.py +236 -0
- flexpyirt-0.2.0/src/flexpyirt/_polychoric.py +344 -0
- flexpyirt-0.2.0/src/flexpyirt/_progress.py +154 -0
- flexpyirt-0.2.0/src/flexpyirt/_projection.py +93 -0
- flexpyirt-0.2.0/src/flexpyirt/_robust_se.py +202 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/_scoring.py +10 -9
- flexpyirt-0.2.0/src/flexpyirt/_screening.py +126 -0
- flexpyirt-0.2.0/src/flexpyirt/bootstrap.py +495 -0
- flexpyirt-0.2.0/src/flexpyirt/cache.py +93 -0
- flexpyirt-0.2.0/src/flexpyirt/classification.py +476 -0
- flexpyirt-0.2.0/src/flexpyirt/comparison.py +197 -0
- flexpyirt-0.2.0/src/flexpyirt/correlation.py +324 -0
- flexpyirt-0.2.0/src/flexpyirt/curves.py +424 -0
- flexpyirt-0.2.0/src/flexpyirt/dif.py +727 -0
- flexpyirt-0.2.0/src/flexpyirt/dimensionality.py +782 -0
- flexpyirt-0.2.0/src/flexpyirt/equating.py +983 -0
- flexpyirt-0.2.0/src/flexpyirt/errors.py +73 -0
- flexpyirt-0.2.0/src/flexpyirt/fit.py +920 -0
- flexpyirt-0.2.0/src/flexpyirt/inference.py +307 -0
- flexpyirt-0.2.0/src/flexpyirt/information.py +605 -0
- flexpyirt-0.2.0/src/flexpyirt/item_design.py +272 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/items.py +248 -25
- flexpyirt-0.2.0/src/flexpyirt/lagrange.py +126 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/latent.py +45 -6
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/linking.py +635 -93
- flexpyirt-0.2.0/src/flexpyirt/method.py +128 -0
- flexpyirt-0.2.0/src/flexpyirt/model.py +1132 -0
- flexpyirt-0.2.0/src/flexpyirt/plotting.py +411 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/priors.py +140 -9
- flexpyirt-0.2.0/src/flexpyirt/projection.py +535 -0
- flexpyirt-0.2.0/src/flexpyirt/quadrature.py +293 -0
- flexpyirt-0.2.0/src/flexpyirt/result.py +2391 -0
- flexpyirt-0.2.0/src/flexpyirt/screening.py +543 -0
- flexpyirt-0.2.0/src/flexpyirt/simulate.py +503 -0
- flexpyirt-0.2.0/src/flexpyirt/sumscore.py +241 -0
- flexpyirt-0.0.1/tests/test_mirt_m4_multigroup.py → flexpyirt-0.2.0/tests/_mirt_multigroup.py +15 -20
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/_reference.py +26 -1
- flexpyirt-0.2.0/tests/conftest.py +166 -0
- flexpyirt-0.2.0/tests/durations-fast.json +52 -0
- flexpyirt-0.2.0/tests/durations.json +73 -0
- flexpyirt-0.2.0/tests/reference/flexpyctt/v24_polychoric.json +1 -0
- flexpyirt-0.2.0/tests/reference/flexpyctt/v27_detect.json +1 -0
- flexpyirt-0.2.0/tests/reference/sparse_grid/gqn.json +1 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v11_3pl.json +134 -133
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v11_4pl.json +179 -178
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v12_irtpars.json +128 -127
- flexpyirt-0.2.0/tests/reference/v13_fscores.json +5605 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v14_mirt2d.json +164 -163
- flexpyirt-0.2.0/tests/reference/v14_mirt_map.json +946 -0
- flexpyirt-0.2.0/tests/reference/v14_mirt_mlwle.json +5040 -0
- flexpyirt-0.2.0/tests/reference/v15_sx2.json +77 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v15_sx2_multigroup.json +50 -49
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v16_lsat7_common_slope.json +23 -22
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v16_mixed_constraints.json +51 -50
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v16_twogroup_common_slope.json +93 -92
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v17_dif.json +10 -9
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v18_m2.json +48 -47
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v19_davidian_2pl_k3.json +197 -196
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v19_davidian_fipc_k3.json +92 -91
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v19_davidian_grm_k2.json +146 -145
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v1_lsat7_2pl.json +30 -27
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v1_sim_2pl.json +58 -55
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v20_linking.json +1153 -1152
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v21_mirt_multigroup.json +127 -124
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v22_mixture_2pl_k2.json +107 -106
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v22_mixture_gpcm_k3.json +283 -282
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v22_mixture_grm_k2.json +223 -222
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v23_nominal_2d.json +64 -63
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v23_nominal_mixed.json +293 -292
- flexpyirt-0.2.0/tests/reference/v23_nominal_science.json +610 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v23_nominal_sim.json +360 -359
- flexpyirt-0.2.0/tests/reference/v23_nominal_unordered.json +2567 -0
- flexpyirt-0.2.0/tests/reference/v26_local_dependence.json +1 -0
- flexpyirt-0.2.0/tests/reference/v26_local_dependence_extensions.json +1 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v2_lsat7_rasch.json +20 -17
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v2_sim_rasch.json +36 -33
- flexpyirt-0.2.0/tests/reference/v31_jsi.json +1 -0
- flexpyirt-0.2.0/tests/reference/v32_bifactor.json +4038 -0
- flexpyirt-0.2.0/tests/reference/v33_two_tier.json +4228 -0
- flexpyirt-0.2.0/tests/reference/v34_weights_2pl.json +1 -0
- flexpyirt-0.2.0/tests/reference/v34_weights_bifactor.json +1 -0
- flexpyirt-0.2.0/tests/reference/v34_weights_fipc.json +1 -0
- flexpyirt-0.2.0/tests/reference/v34_weights_grm.json +1 -0
- flexpyirt-0.2.0/tests/reference/v34_weights_twogroup.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_2pl_map.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_2pl_misfit.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_fipc_eh.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_fipc_equal.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_mixed.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_three_factor.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_two_factor.json +1 -0
- flexpyirt-0.2.0/tests/reference/v35_twogroup.json +1 -0
- flexpyirt-0.2.0/tests/reference/v36_sumscore.json +1355 -0
- flexpyirt-0.2.0/tests/reference/v37_information.json +14848 -0
- flexpyirt-0.2.0/tests/reference/v38_local_dependence_bifactor.json +1 -0
- flexpyirt-0.2.0/tests/reference/v39_fit_multidim.json +244 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v3_science_grm.json +40 -38
- flexpyirt-0.2.0/tests/reference/v40_linking_multidim.json +17493 -0
- flexpyirt-0.2.0/tests/reference/v40_linking_unidim.json +18753 -0
- flexpyirt-0.2.0/tests/reference/v42_m2_groups_missing_map.json +1 -0
- flexpyirt-0.2.0/tests/reference/v43_information_multidim.json +4048 -0
- flexpyirt-0.2.0/tests/reference/v45_3pl_logit_norm_map.json +348 -0
- flexpyirt-0.2.0/tests/reference/v48_plots.json +7539 -0
- flexpyirt-0.2.0/tests/reference/v49_dif_screen.json +2764 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v4_twogroup_2pl.json +133 -131
- flexpyirt-0.2.0/tests/reference/v50_screening.json +11831 -0
- flexpyirt-0.2.0/tests/reference/v51_irt_equating.json +531 -0
- flexpyirt-0.2.0/tests/reference/v52_classification.json +8129 -0
- flexpyirt-0.2.0/tests/reference/v53_person_fit.json +1 -0
- flexpyirt-0.2.0/tests/reference/v54_compare_fits.json +72 -0
- flexpyirt-0.2.0/tests/reference/v54_simulate.json +7655 -0
- flexpyirt-0.2.0/tests/reference/v55_many_groups.json +4229 -0
- flexpyirt-0.2.0/tests/reference/v56a_davidian_three_groups.json +2038 -0
- flexpyirt-0.2.0/tests/reference/v56b_mixture_two_groups.json +2391 -0
- flexpyirt-0.2.0/tests/reference/v56c_fipc_davidian.json +1173 -0
- flexpyirt-0.2.0/tests/reference/v57_school_2pl.json +1 -0
- flexpyirt-0.2.0/tests/reference/v57_twogroup.json +1 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v5_fipc_2pl.json +44 -42
- flexpyirt-0.2.0/tests/reference/v60_qmc.json +2421 -0
- flexpyirt-0.2.0/tests/reference/v61_projection.json +4159 -0
- flexpyirt-0.2.0/tests/reference/v62_latent_regression.json +3955 -0
- flexpyirt-0.2.0/tests/reference/v63_equating_se.json +258 -0
- flexpyirt-0.2.0/tests/reference/v64_bootstrap.json +2748 -0
- flexpyirt-0.2.0/tests/reference/v65_wald_plci.json +4123 -0
- flexpyirt-0.2.0/tests/reference/v66_lagrange.json +3089 -0
- flexpyirt-0.2.0/tests/reference/v67_item_design.json +3564 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v6_fipc_eh.json +70 -69
- flexpyirt-0.2.0/tests/reference/v6_twogroup_fipc_eh.json +5254 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v7_2pl_lnorm_map.json +99 -98
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v7_2pl_map.json +98 -97
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v7_3pl_map.json +152 -151
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v8_science_gpcm.json +47 -46
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v8_sim_gpcm.json +107 -106
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v8_sim_pcm.json +81 -80
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/reference/v9_missing_2pl.json +60 -58
- flexpyirt-0.2.0/tests/test_anderson.py +272 -0
- flexpyirt-0.2.0/tests/test_asymptote_mixture.py +238 -0
- flexpyirt-0.2.0/tests/test_batched_fits.py +442 -0
- flexpyirt-0.2.0/tests/test_bootstrap.py +187 -0
- flexpyirt-0.2.0/tests/test_classification.py +380 -0
- flexpyirt-0.2.0/tests/test_cold_start.py +209 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_core.py +1 -0
- flexpyirt-0.2.0/tests/test_custom_items.py +409 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_docs.py +25 -6
- flexpyirt-0.2.0/tests/test_equating.py +484 -0
- flexpyirt-0.2.0/tests/test_equating_se.py +205 -0
- flexpyirt-0.2.0/tests/test_estep_fastpaths.py +247 -0
- flexpyirt-0.2.0/tests/test_examples.py +106 -0
- flexpyirt-0.2.0/tests/test_item_design.py +103 -0
- flexpyirt-0.2.0/tests/test_lagrange.py +143 -0
- flexpyirt-0.2.0/tests/test_latent_regression.py +250 -0
- flexpyirt-0.2.0/tests/test_logitnormal_prior.py +413 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m2_units.py +2 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m3_3pl_4pl.py +26 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m3_eh.py +11 -3
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m3_gpcm.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m3_priors.py +7 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m3_squarem.py +7 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m4_json.py +39 -6
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m4_mirt.py +12 -3
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m4_result.py +11 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m4_scoring.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m5_davidian.py +14 -8
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m5_dif.py +5 -0
- flexpyirt-0.2.0/tests/test_m5_dif_screen.py +357 -0
- flexpyirt-0.2.0/tests/test_m5_ensemble.py +242 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m5_equal_items.py +7 -0
- flexpyirt-0.2.0/tests/test_m5_jsi.py +214 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m5_linking.py +49 -6
- flexpyirt-0.2.0/tests/test_m5_local_dependence.py +455 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m5_m2.py +145 -27
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m5_mixture.py +15 -7
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_m5_nominal.py +7 -2
- flexpyirt-0.2.0/tests/test_m5_polychoric.py +319 -0
- flexpyirt-0.2.0/tests/test_m6_fit_multidim.py +207 -0
- flexpyirt-0.2.0/tests/test_m6_linking_multidim.py +551 -0
- flexpyirt-0.2.0/tests/test_m7_bifactor.py +401 -0
- flexpyirt-0.2.0/tests/test_m7_information.py +384 -0
- flexpyirt-0.2.0/tests/test_m7_information_multidim.py +293 -0
- flexpyirt-0.2.0/tests/test_m7_local_dependence_reduced.py +180 -0
- flexpyirt-0.2.0/tests/test_m7_robust_se.py +428 -0
- flexpyirt-0.2.0/tests/test_m7_sumscore.py +198 -0
- flexpyirt-0.2.0/tests/test_m7_two_tier.py +454 -0
- flexpyirt-0.2.0/tests/test_m7_weights.py +392 -0
- flexpyirt-0.2.0/tests/test_m_step_scale.py +277 -0
- flexpyirt-0.2.0/tests/test_many_groups.py +222 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m1.py +2 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m2.py +19 -8
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m3.py +68 -11
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m3_gpcm.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m3_priors.py +27 -13
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m4_irtpars.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m4_mirt.py +32 -11
- flexpyirt-0.2.0/tests/test_mirt_m4_multigroup.py +11 -0
- flexpyirt-0.2.0/tests/test_mirt_m4_multigroup_cross.py +31 -0
- flexpyirt-0.2.0/tests/test_mirt_m4_multigroup_hessian.py +15 -0
- flexpyirt-0.2.0/tests/test_mirt_m4_multigroup_simple.py +27 -0
- flexpyirt-0.2.0/tests/test_mirt_m4_multigroup_squarem.py +15 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m4_scoring.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_davidian.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_dif.py +3 -0
- flexpyirt-0.2.0/tests/test_mirt_m5_dif_screen.py +276 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_equal_items.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_itemfit.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_itemfit_multigroup.py +8 -2
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_linking.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_m2.py +14 -9
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_mixture.py +3 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_m5_nominal.py +3 -0
- flexpyirt-0.2.0/tests/test_mirt_m6_fit_multidim.py +236 -0
- flexpyirt-0.2.0/tests/test_mirt_m6_m2_groups.py +237 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_bifactor.py +198 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_information.py +239 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_information_multidim.py +158 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_local_dependence.py +250 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_local_dependence_bifactor.py +119 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_robust_se.py +303 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_two_tier.py +208 -0
- flexpyirt-0.2.0/tests/test_mirt_m7_weights.py +274 -0
- flexpyirt-0.2.0/tests/test_mirt_v40_linking.py +345 -0
- flexpyirt-0.2.0/tests/test_mirt_v40_linking_multidim.py +381 -0
- flexpyirt-0.2.0/tests/test_mirt_v48_plots.py +250 -0
- flexpyirt-0.2.0/tests/test_mirt_v53_person_fit.py +302 -0
- flexpyirt-0.2.0/tests/test_mirt_v54_compare_fits.py +113 -0
- flexpyirt-0.2.0/tests/test_mirt_v55_many_groups.py +118 -0
- flexpyirt-0.2.0/tests/test_mirt_v56_multigroup_shapes.py +146 -0
- flexpyirt-0.2.0/tests/test_mirt_v57_weighted_cluster_se.py +260 -0
- flexpyirt-0.2.0/tests/test_mirt_v60_qmc.py +98 -0
- flexpyirt-0.2.0/tests/test_mirt_v61_projection.py +158 -0
- flexpyirt-0.2.0/tests/test_mirt_v62_latent_regression.py +181 -0
- flexpyirt-0.2.0/tests/test_mirt_v64_bootstrap.py +110 -0
- flexpyirt-0.2.0/tests/test_mirt_v65_wald_plci.py +147 -0
- flexpyirt-0.2.0/tests/test_mirt_v66_lagrange.py +77 -0
- flexpyirt-0.2.0/tests/test_mirt_v67_item_design.py +113 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_mirt_v6_eh.py +3 -0
- flexpyirt-0.2.0/tests/test_mixed_precision.py +275 -0
- flexpyirt-0.2.0/tests/test_multigroup_latent_shapes.py +242 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_oakes.py +162 -0
- flexpyirt-0.2.0/tests/test_packaging.py +61 -0
- flexpyirt-0.2.0/tests/test_person_fit.py +223 -0
- flexpyirt-0.2.0/tests/test_plotting.py +327 -0
- flexpyirt-0.2.0/tests/test_progress.py +181 -0
- flexpyirt-0.2.0/tests/test_projection.py +313 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_quadrature_gh.py +3 -0
- flexpyirt-0.2.0/tests/test_quadrature_qmc.py +211 -0
- flexpyirt-0.2.0/tests/test_r_classification.py +212 -0
- flexpyirt-0.2.0/tests/test_r_equating.py +383 -0
- flexpyirt-0.2.0/tests/test_r_equating_se.py +157 -0
- flexpyirt-0.2.0/tests/test_r_m7_sumscore.py +114 -0
- flexpyirt-0.2.0/tests/test_r_v50_screening.py +215 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_reference_meta.py +12 -0
- flexpyirt-0.2.0/tests/test_reference_provenance.py +138 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_scaffold.py +2 -0
- flexpyirt-0.2.0/tests/test_screening.py +271 -0
- flexpyirt-0.2.0/tests/test_shards.py +42 -0
- flexpyirt-0.2.0/tests/test_sparse_grid.py +86 -0
- flexpyirt-0.2.0/tests/test_v54_simulate.py +422 -0
- flexpyirt-0.2.0/tests/test_wald_profile_ci.py +140 -0
- flexpyirt-0.2.0/tests/test_weighted_cluster_se.py +377 -0
- flexpyirt-0.2.0/validation/r/classification_reference.R +347 -0
- flexpyirt-0.2.0/validation/r/install_mirt.R +32 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m1_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m2_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m3_eh_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m3_gpcm_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m3_priors_reference.R +4 -3
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m3_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m4_irtpars_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m4_mirt_map_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m4_mirt_mlwle_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m4_mirt_multigroup_reference.R +3 -2
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m4_mirt_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m4_scoring_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_davidian_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_dif_reference.R +2 -1
- flexpyirt-0.2.0/validation/r/m5_dif_screen_reference.R +235 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_equal_items_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_itemfit_multigroup_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_itemfit_reference.R +2 -1
- flexpyirt-0.2.0/validation/r/m5_jsi_reference.R +83 -0
- flexpyirt-0.2.0/validation/r/m5_linking_extensions_reference.R +694 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_linking_reference.R +2 -1
- flexpyirt-0.2.0/validation/r/m5_local_dependence_reference.R +89 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_m2_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_mixture_reference.R +2 -1
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/validation/r/m5_nominal_reference.R +3 -2
- flexpyirt-0.2.0/validation/r/m6_fit_multidim_reference.R +230 -0
- flexpyirt-0.2.0/validation/r/m6_m2_groups_missing_map_reference.R +396 -0
- flexpyirt-0.2.0/validation/r/m7_bifactor_reference.R +218 -0
- flexpyirt-0.2.0/validation/r/m7_information_multidim_reference.R +218 -0
- flexpyirt-0.2.0/validation/r/m7_information_reference.R +254 -0
- flexpyirt-0.2.0/validation/r/m7_local_dependence_bifactor_reference.R +168 -0
- flexpyirt-0.2.0/validation/r/m7_local_dependence_reference.R +350 -0
- flexpyirt-0.2.0/validation/r/m7_logit_norm_prior_reference.R +157 -0
- flexpyirt-0.2.0/validation/r/m7_robust_se_reference.R +271 -0
- flexpyirt-0.2.0/validation/r/m7_sumscore_reference.R +111 -0
- flexpyirt-0.2.0/validation/r/m7_two_tier_reference.R +254 -0
- flexpyirt-0.2.0/validation/r/m7_weights_reference.R +211 -0
- flexpyirt-0.2.0/validation/r/person_fit_reference.R +283 -0
- flexpyirt-0.2.0/validation/r/run_references.sh +62 -0
- flexpyirt-0.2.0/validation/r/setup.R +55 -0
- flexpyirt-0.2.0/validation/r/sparse_grid_reference.R +43 -0
- flexpyirt-0.2.0/validation/r/v48_plots_reference.R +255 -0
- flexpyirt-0.2.0/validation/r/v50_screening_reference.R +442 -0
- flexpyirt-0.2.0/validation/r/v51_irt_equating_reference.R +290 -0
- flexpyirt-0.2.0/validation/r/v54_compare_simulate_reference.R +192 -0
- flexpyirt-0.2.0/validation/r/v55_many_groups_reference.R +113 -0
- flexpyirt-0.2.0/validation/r/v56_multigroup_shapes_reference.R +396 -0
- flexpyirt-0.2.0/validation/r/v57_weighted_cluster_se_reference.R +220 -0
- flexpyirt-0.2.0/validation/r/v60_qmc_reference.R +166 -0
- flexpyirt-0.2.0/validation/r/v61_projection_reference.R +179 -0
- flexpyirt-0.2.0/validation/r/v62_latent_regression_reference.R +151 -0
- flexpyirt-0.2.0/validation/r/v63_equating_se_reference.R +95 -0
- flexpyirt-0.2.0/validation/r/v64_bootstrap_reference.R +99 -0
- flexpyirt-0.2.0/validation/r/v65_wald_plci_reference.R +103 -0
- flexpyirt-0.2.0/validation/r/v66_lagrange_reference.R +131 -0
- flexpyirt-0.2.0/validation/r/v67_item_design_reference.R +69 -0
- flexpyirt-0.2.0/validation/simulation/bootstrap_type1.json +218 -0
- flexpyirt-0.2.0/validation/simulation/bootstrap_type1.py +87 -0
- flexpyirt-0.0.1/.gitignore +0 -13
- flexpyirt-0.0.1/CONTRIBUTING.ja.md +0 -137
- flexpyirt-0.0.1/CONTRIBUTING.md +0 -150
- flexpyirt-0.0.1/PKG-INFO +0 -204
- flexpyirt-0.0.1/README.ja.md +0 -165
- flexpyirt-0.0.1/README.md +0 -172
- flexpyirt-0.0.1/docs/API.ja.md +0 -159
- flexpyirt-0.0.1/docs/API.md +0 -172
- flexpyirt-0.0.1/docs/DESIGN.ja.md +0 -1071
- flexpyirt-0.0.1/docs/DESIGN.md +0 -1530
- flexpyirt-0.0.1/docs/ROADMAP.ja.md +0 -50
- flexpyirt-0.0.1/docs/ROADMAP.md +0 -67
- flexpyirt-0.0.1/docs/VALIDATION.ja.md +0 -552
- flexpyirt-0.0.1/docs/VALIDATION.md +0 -685
- flexpyirt-0.0.1/docs/guide.ja.md +0 -857
- flexpyirt-0.0.1/docs/guide.md +0 -924
- flexpyirt-0.0.1/docs/index.ja.md +0 -57
- flexpyirt-0.0.1/docs/index.md +0 -59
- flexpyirt-0.0.1/docs/reference.ja.md +0 -748
- flexpyirt-0.0.1/docs/reference.md +0 -820
- flexpyirt-0.0.1/src/flexpyirt/__init__.py +0 -48
- flexpyirt-0.0.1/src/flexpyirt/_core.py +0 -1387
- flexpyirt-0.0.1/src/flexpyirt/_dif.py +0 -198
- flexpyirt-0.0.1/src/flexpyirt/_newton.py +0 -96
- flexpyirt-0.0.1/src/flexpyirt/errors.py +0 -57
- flexpyirt-0.0.1/src/flexpyirt/fit.py +0 -389
- flexpyirt-0.0.1/src/flexpyirt/method.py +0 -47
- flexpyirt-0.0.1/src/flexpyirt/model.py +0 -621
- flexpyirt-0.0.1/src/flexpyirt/quadrature.py +0 -135
- flexpyirt-0.0.1/src/flexpyirt/result.py +0 -1230
- flexpyirt-0.0.1/tests/conftest.py +0 -25
- flexpyirt-0.0.1/tests/reference/v13_fscores.json +0 -5586
- flexpyirt-0.0.1/tests/reference/v14_mirt_map.json +0 -945
- flexpyirt-0.0.1/tests/reference/v14_mirt_mlwle.json +0 -5039
- flexpyirt-0.0.1/tests/reference/v15_sx2.json +0 -76
- flexpyirt-0.0.1/tests/reference/v23_nominal_science.json +0 -609
- flexpyirt-0.0.1/tests/reference/v23_nominal_unordered.json +0 -2566
- flexpyirt-0.0.1/tests/reference/v6_twogroup_fipc_eh.json +0 -122631
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/LICENSE +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/__init__.py +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/results/2026-11-21-apple-m5.json +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/benchmarks/results/2026-11-21-apple-m5.md +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/docs/javascripts/mathjax.js +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/scripts/check_pr.py +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/scripts/mkdocs_hooks.py +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/scripts/release_version.py +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/_precision.py +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/src/flexpyirt/py.typed +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/__init__.py +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_benchmarks.py +0 -0
- {flexpyirt-0.0.1 → flexpyirt-0.2.0}/tests/test_release_version.py +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.egg-info/
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
.mypy_cache/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
.ipynb_checkpoints/
|
|
10
|
+
validation/r/.Rhistory
|
|
11
|
+
validation/r/logs/
|
|
12
|
+
# Local R library for the GitHub mirt (FLEXPYIRT_R_LIB=validation/r/lib); never committed
|
|
13
|
+
validation/r/lib/
|
|
14
|
+
.hypothesis/
|
|
15
|
+
benchmarks/data/
|
|
16
|
+
site/
|
|
17
|
+
|
|
18
|
+
# Persistent JAX compilation cache (CI)
|
|
19
|
+
.jax-cache/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# How to cite flexpyirt. GitHub shows this as "Cite this repository", and Zenodo reads it when it
|
|
2
|
+
# archives a release. The version is not written here: it comes from the git tag (hatch-vcs), and
|
|
3
|
+
# Zenodo records it with each release's DOI.
|
|
4
|
+
cff-version: 1.2.0
|
|
5
|
+
message: >-
|
|
6
|
+
If you use flexpyirt in your research, please cite it as below, together with the version you
|
|
7
|
+
used (flexpyirt.__version__).
|
|
8
|
+
type: software
|
|
9
|
+
title: "flexpyirt: Item response theory estimation in Python, built on JAX"
|
|
10
|
+
abstract: >-
|
|
11
|
+
flexpyirt estimates item response theory (IRT) models by marginal maximum likelihood with the
|
|
12
|
+
Bock–Aitkin EM algorithm, built on JAX. It supports dichotomous and polytomous item models,
|
|
13
|
+
multiple-group calibration, fixed item parameter calibration, multidimensional models, flexible
|
|
14
|
+
latent densities, item and model fit, DIF, scale linking and IRT equating. Every supported
|
|
15
|
+
feature is checked numerically against the R package mirt.
|
|
16
|
+
authors:
|
|
17
|
+
- given-names: Takumi
|
|
18
|
+
family-names: Itamiya
|
|
19
|
+
alias: takuizum
|
|
20
|
+
repository-code: "https://github.com/takuizum/flexpyirt"
|
|
21
|
+
url: "https://takuizum.github.io/flexpyirt/"
|
|
22
|
+
license: MIT
|
|
23
|
+
keywords:
|
|
24
|
+
- item response theory
|
|
25
|
+
- IRT
|
|
26
|
+
- psychometrics
|
|
27
|
+
- EM algorithm
|
|
28
|
+
- marginal maximum likelihood
|
|
29
|
+
- JAX
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# 開発フロー
|
|
2
|
+
|
|
3
|
+
[English](CONTRIBUTING.md) | 日本語
|
|
4
|
+
|
|
5
|
+
## 関連パッケージ
|
|
6
|
+
|
|
7
|
+
関連する 3 つのパッケージは、それぞれ自分のリポジトリとバージョンを持つ(DESIGN.md §16.18、§16.24)。このリポジトリに
|
|
8
|
+
あるのは flexpyirt だけである。
|
|
9
|
+
|
|
10
|
+
| パッケージ | リポジトリ | 内容 |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| `flexpyirt` | [takuizum/flexpyirt](https://github.com/takuizum/flexpyirt)(ここ) | 推定と、推定済みのモデルを使うものすべて。JAX と flexpyctt に依存する |
|
|
13
|
+
| `flexpyctt` | [takuizum/flexpyctt](https://github.com/takuizum/flexpyctt) | 推定済みのモデルを使わない項目・テスト分析。依存は NumPy、SciPy、pandas だけ |
|
|
14
|
+
| `flexpyequate` | [takuizum/flexpyequate](https://github.com/takuizum/flexpyequate) | 得点分布の等化。依存は NumPy、SciPy、pandas だけ。他の 2 つとは独立 |
|
|
15
|
+
|
|
16
|
+
- **flexpyirt は `flexpyctt>=0.X,<0.(X+1)` に依存する**(`pyproject.toml`)。1.0 より前は flexpyctt のマイナー
|
|
17
|
+
バージョンを互換性の単位とし、flexpyctt のパッチリリースは公開 API を変えない。flexpyctt のマイナーバージョンが
|
|
18
|
+
上がったら、ここで範囲を上げる PR を作り、CI が通ることを確かめる(`tests/test_packaging.py` が範囲の形を確認する)。
|
|
19
|
+
- `FitResult` が要る道具は flexpyirt に、データだけで済む道具は flexpyctt に置く。flexpyirt は flexpyctt の公開名を
|
|
20
|
+
再公開する(再公開する名前は `src/flexpyirt/__init__.py` に明示してある)。
|
|
21
|
+
- flexpyirt は flexpyctt の非公開ヘルパーを 4 つ import している(`_coerce_ordinal`、`_observed_correlation`、
|
|
22
|
+
`_eigenvalues`、`_descending_eigenvalues`)。flexpyctt のテストがそのシグネチャを守っている。
|
|
23
|
+
- **両方にまたがる変更**は、先に flexpyctt のリポジトリで変更してリリースし、そのあとここで依存の範囲を上げる。
|
|
24
|
+
- `tests/reference/flexpyctt/v24_polychoric.json` と `v27_detect.json` は flexpyctt の参照値のコピーである。flexpyctt で
|
|
25
|
+
再生成したら、ここにもコピーする。
|
|
26
|
+
- 項目パラメータを使う等化は flexpyirt に置く。flexpyirt は flexpyequate に依存しない(開発用の依存にだけ
|
|
27
|
+
入れている。`tests/test_equating.py` が独立した実装として照合に使う)。
|
|
28
|
+
|
|
29
|
+
## ブランチ
|
|
30
|
+
|
|
31
|
+
| ブランチ | 役割 | 作り方 / マージ先 |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `main` | リリース済みの状態だけを置く。直接 push しない | `develop` からのリリース PR だけを受け付ける |
|
|
34
|
+
| `develop` | 統合ブランチ。次のリリースに入る変更が集まる | `feature/*` と `fix/*` の PR を受け付ける |
|
|
35
|
+
| `feature/<slug>` | 機能追加・ドキュメント・リファクタリングなど | `develop` から切り、`develop` へ PR |
|
|
36
|
+
| `fix/<issue番号>-<slug>` | バグ修正。**必ず issue に対応させる** | `develop` から切り、`develop` へ PR |
|
|
37
|
+
|
|
38
|
+
- `<slug>` は小文字・数字・`.`・`_`・`-` だけ(例: `feature/grm-docs`, `fix/12-oakes-se`)。
|
|
39
|
+
- fix ブランチの PR 説明には `Closes #<issue番号>` を書く。issue は open でなければならない。
|
|
40
|
+
(`develop` は既定ブランチではないので、issue はマージ時ではなく**リリース時**にワークフローが閉じる。)
|
|
41
|
+
- これらは PR ごとに `PR rules` チェック(`scripts/check_pr.py`)が検査する。
|
|
42
|
+
|
|
43
|
+
## PR とレビュー
|
|
44
|
+
|
|
45
|
+
- すべての変更は PR で入れる。`main` と `develop` はルールセットで保護され、CI(`test (3.12/3.13)`)と
|
|
46
|
+
`pr-rules` が通らないとマージできない。
|
|
47
|
+
- PR はリポジトリのオーナーがレビューしてからマージする(自動マージしない)。
|
|
48
|
+
- 数値計算に関わる変更は、R mirt との照合テスト([docs/dev/VALIDATION.ja.md](docs/dev/VALIDATION.ja.md))が通ることが前提。
|
|
49
|
+
|
|
50
|
+
## リリース
|
|
51
|
+
|
|
52
|
+
バージョンは **git タグ**(`vX.Y.Z`)から決まる(hatch-vcs)。`pyproject.toml` にはバージョンを書かず、
|
|
53
|
+
リリースはタグを打つことで行う。タグのない開発中のコミットは `0.0.2.dev3+g1a2b3c4` のような開発版になる。
|
|
54
|
+
|
|
55
|
+
1. `develop` → `main` の PR を作る。**タイトルでバージョンの上げ方を決める**:
|
|
56
|
+
- `release(major): ...` / `release(minor): ...` / `release(patch): ...`
|
|
57
|
+
- PR は**マージコミット**でマージする(`main` のルールセットはマージコミットだけを許可)。
|
|
58
|
+
2. マージされると `.github/workflows/release.yml` が動く:
|
|
59
|
+
1. `plan` ジョブ: PR タイトルと最新の `vX.Y.Z` タグから次のバージョンを決める。
|
|
60
|
+
2. `publish` ジョブ: **承認を待たずに動く**(`release` 環境。`main` からしかデプロイしない)。`main` に
|
|
61
|
+
タグ `vX.Y.Z` を打ってビルドし(`uv build`)、GitHub Release を作成する(wheel / sdist 添付、
|
|
62
|
+
リリースノート自動生成)。このリリースに含まれる fix PR が `Closes` していた issue を閉じる。
|
|
63
|
+
3. `pypi` ジョブ: **`pypi` 環境の承認待ちになる**。オーナーが Actions 画面で承認すると、同じ wheel / sdist を
|
|
64
|
+
PyPI に公開する(Trusted Publishing。API トークンは使わない)。
|
|
65
|
+
4. 同じ `main` への push で `.github/workflows/docs.yml` がドキュメントサイトを GitHub Pages に公開する。
|
|
66
|
+
3. **最初のリリース**(`v*` タグがまだない)は、タイトルの上げ方に関係なく **v0.0.1**。
|
|
67
|
+
4. 手動実行(`workflow_dispatch`)は dry run 専用で、次のバージョンの計算とビルドだけを行う。
|
|
68
|
+
5. **リリースの前に、依存の範囲に入る flexpyctt が PyPI にあること**(`publish` ジョブは、ビルドした wheel を
|
|
69
|
+
PyPI の flexpyctt と一緒にインストールして確かめる)。
|
|
70
|
+
|
|
71
|
+
`main` へのマージコミットは `develop` に戻さない(`develop` は保護されていて、ボットは push できない)。
|
|
72
|
+
このため `develop` 上の開発版の番号は直前のリリースタグを参照しないことがあるが、リリースには影響しない。
|
|
73
|
+
|
|
74
|
+
バージョンは [Semantic Versioning](https://semver.org/lang/ja/) に従う。1.0.0 までは公開 API が変わりうる。
|
|
75
|
+
|
|
76
|
+
## セキュリティ(誰がリリースできるか)
|
|
77
|
+
|
|
78
|
+
- **`main` を更新できるのはリポジトリ管理者だけ**(ルールセット `main-release-gate`)。PR と CI の要件
|
|
79
|
+
(ルールセット `main`)は管理者にも適用される。リリースを起こせるのは develop → main を
|
|
80
|
+
マージできる管理者だけ。
|
|
81
|
+
- **`publish` ジョブは `release` 環境で動く**。環境は `main` からしかデプロイできないので、他のブランチや
|
|
82
|
+
フォークからはタグも Release も作れない。必須レビュアーは付けていない。リリース PR のマージが、タグを打つ
|
|
83
|
+
判断である。
|
|
84
|
+
- **`pypi` ジョブは `pypi` 環境で動き、指定レビュアー(オーナー)の承認が必要**。承認なしに PyPI に出る
|
|
85
|
+
ことはない。
|
|
86
|
+
- **PyPI への公開は Trusted Publishing**(OIDC)。PyPI のプロジェクト `flexpyirt` は
|
|
87
|
+
「リポジトリ `takuizum/flexpyirt`、ワークフロー `release.yml`、環境 `pypi`」という publisher だけを信頼するので、
|
|
88
|
+
API トークンはリポジトリに置かない。`pypi` 環境もデプロイ元を `main` に限定しておく。PyPI に一度上げた番号は
|
|
89
|
+
削除しても再利用できない。
|
|
90
|
+
- ワークフローの `GITHUB_TOKEN` は既定で読み取り専用(`permissions: contents: read`)。書き込みは
|
|
91
|
+
`publish` ジョブだけ。フォークからの PR は読み取り専用トークンで CI と PR rules だけが走る。
|
|
92
|
+
- 協力者を追加するときは write 権限にとどめる。管理者を増やすとリリースできる人が増える。
|
|
93
|
+
|
|
94
|
+
## ローカル開発
|
|
95
|
+
|
|
96
|
+
Python 環境は `uv` だけで管理する(pip は使わない)。
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uv sync --all-extras --dev
|
|
100
|
+
uv run ruff check . && uv run ruff format --check . && uv run mypy && uv run pytest
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### テスト
|
|
104
|
+
|
|
105
|
+
テストは pytest-xdist で並列に走る(`-n auto`、1 モジュールを 1 ワーカーで実行)。直列にしたいときは `-n 0` を付ける。
|
|
106
|
+
テストは 2 層に分かれる。
|
|
107
|
+
|
|
108
|
+
| 層 | 内容 | 実行するタイミング |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| fast | `-m "not slow"`:単体テスト、ドキュメント、M1 の mirt スモークテスト。Python ごとに 3 シャードに分割(CI で数分) | すべての PR、`develop`/`main` へのすべての push |
|
|
111
|
+
| full | mirt 参照値との照合をすべて含む全テスト。Python ごとに 4 シャードに分割 | `develop` の夜間実行、リリース PR(`develop` → `main`)、手動実行(*Run workflow*) |
|
|
112
|
+
|
|
113
|
+
mirt 参照値との照合は、full 層(夜間実行またはリリース PR)が通って初めて完了とする。ROADMAP の項目にチェックを付ける前に夜間実行の結果を確認する。
|
|
114
|
+
|
|
115
|
+
- 約 5 秒を超えるテストには `@pytest.mark.slow` を付ける。`functools.cache` で共有するフィッティングの時間も含める(そのフィッティングを最初に使うテストが時間を払う)。
|
|
116
|
+
fast 層の結果の最後に、`slow` なしで 5 秒を超えたテストが一覧される("tests over 5 s not marked slow")。
|
|
117
|
+
- `tests/test_mirt_*.py` はモジュールごと slow にする(`pytestmark = pytest.mark.slow`)。`test_mirt_m1.py` だけは例外。
|
|
118
|
+
- 1 モジュールは 1 ワーカーで走るので、数分かかるフィッティングは専用のモジュールに分ける(`tests/_mirt_multigroup.py` と `tests/test_mirt_m4_multigroup_*.py` を参照)。
|
|
119
|
+
- CI は JAX の永続コンパイルキャッシュ(`JAX_COMPILATION_CACHE_DIR`)を実行間で引き継ぐ。
|
|
120
|
+
- full 層のシャードは `tests/durations.json`、fast 層のシャードは `tests/durations-fast.json`(`--durations-file`)に記録したモジュールごとの秒数で均等に分ける。重いモジュールを足したり分けたりしたら更新する:
|
|
121
|
+
`uv run pytest --write-durations tests/durations.json` と `uv run pytest -m "not slow" -n 4 --write-durations tests/durations-fast.json`(または CI 実行が残す `durations-*` アーティファクトをまとめる)。ファイルにないモジュールは 1 テスト 1 秒として扱う。
|
|
122
|
+
- CI の required check `test (3.12)` と `test (3.13)` は、`checks` ジョブ(ruff・mypy)と `fast` の全シャードが通ったときに通る。
|
|
123
|
+
|
|
124
|
+
手元で素早く確かめるなら `uv run pytest -m "not slow"`。CI と同じ full 層の 1 シャードだけ走らせるなら `uv run pytest --shard 2/4`(fast 層なら `uv run pytest -m "not slow" --shard 2/3 --durations-file tests/durations-fast.json`)。
|
|
125
|
+
|
|
126
|
+
mirt の参照値を作り直すとき(R 4.4+ が必要。mirt は GitHub の `philchalmers/mirt` からユーザーライブラリか
|
|
127
|
+
`FLEXPYIRT_R_LIB` に入れる。[VALIDATION.ja.md](docs/dev/VALIDATION.ja.md)「R と mirt の版」):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
Rscript validation/r/install_mirt.R
|
|
131
|
+
validation/r/run_references.sh
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
1 本だけ作り直すなら `validation/r/run_references.sh m1 m2`。mirt を使うスクリプトを新しく足すときは
|
|
135
|
+
`validation/r/setup.R` を `source` し、`run_references.sh` の段のリストに加える。
|
|
136
|
+
|
|
137
|
+
flexpyctt と flexpyequate の参照値のスクリプトは、それぞれのリポジトリの `validation/r/` にある。
|
|
138
|
+
|
|
139
|
+
R `mirt` との wall time ベンチマークを再実行するとき(詳細と `--quick` モードは
|
|
140
|
+
[benchmarks/README.ja.md](benchmarks/README.ja.md) を参照):
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
uv run python benchmarks/data.py
|
|
144
|
+
uv run python benchmarks/run_flexpyirt.py
|
|
145
|
+
Rscript benchmarks/run_mirt.R
|
|
146
|
+
uv run python benchmarks/report.py
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 命名
|
|
150
|
+
|
|
151
|
+
名前は PEP 8 に従い、R ではなく Python として読めるものにする(DESIGN.md §15.46)。`ruff` が `N` 規則を検査する。
|
|
152
|
+
|
|
153
|
+
- 関数・メソッド・引数・変数は `snake_case`、クラスは `CapWords`、モジュール定数は `UPPER_SNAKE_CASE`。
|
|
154
|
+
- R/mirt の引数名をそのまま使わない。Python の綴りにし、対応する mirt の名前は docstring に書く:
|
|
155
|
+
`n_categories`(`n_cat` ではない)、`min_cell`(mirt の `mincell`)、`mean_log`/`sd_log`(R の `meanlog`/`sdlog`)、
|
|
156
|
+
`bounds=(lower, upper)`(mirt の `theta_lim`)。
|
|
157
|
+
- 公開名は略さない(`is_eh` ではなく `is_empirical_histogram`)。定着した略語は使ってよい: モデル名(`TwoPL`, `GRM`,
|
|
158
|
+
`GPCM`)、個数を表す接頭辞 `n_`、`se`, `vcov`, `loglik`, `theta`, `eta`。よく使う別名とぶつかる略語は避ける
|
|
159
|
+
(`pd` は pandas、`df` は自由度と DataFrame で紛らわしい)。
|
|
160
|
+
- 同じ概念には API 全体で同じ名前を使う(`n_points`, `n_factors`, `n_categories`)。同じ系統のクラスは接尾辞を揃える
|
|
161
|
+
(`NormalPrior`, `LogNormalPrior`, `BetaPrior`)。
|
|
162
|
+
- `Literal` の文字列の選択肢は小文字の `snake_case`(`"slope_intercept"`, `"stocking_lord"`)。定着した頭字語は大文字のまま
|
|
163
|
+
(`"EAP"`, `"MAP"`, `"BH"`)。
|
|
164
|
+
- DESIGN.md の数式に対応する場所では数式記号を使ってよい: jit されるカーネル内の大文字の記号(`G`, `Q`, `D`, `K_f`。
|
|
165
|
+
このため ruff の `N803`/`N806` は無視している)や、`LinkResult.A`/`B` のような標準的な定数。
|
|
166
|
+
- ローカルのクロージャは役割で名付ける(`objective`, `backtrack_body`, `interp_weights`。`obj` や `tmp` は使わない)。
|
|
167
|
+
mirt のコードを行ごとに移植した箇所(例: `_itemfit.collapse_cells`)は照合のため mirt の局所変数名を残してよく、
|
|
168
|
+
その旨をコメントに書く。
|
|
169
|
+
- `FitResult` の JSON に保存される名前を変えるときは `schema_version` を上げ、古いファイルも読めるようにする
|
|
170
|
+
(読み込み時に旧キーを置き換える)。
|
|
171
|
+
|
|
172
|
+
## ドキュメント
|
|
173
|
+
|
|
174
|
+
すべての文書は英語版(`*.md`)と日本語版(`*.ja.md`)があり、内容は同じ。片方を変えたら両方を直す。
|
|
175
|
+
`.github/` の PR・issue テンプレートは、GitHub が既定のテンプレートを 1 つしか使わないため、英日を併記した
|
|
176
|
+
1 つのファイルにしている。
|
|
177
|
+
|
|
178
|
+
`docs/` の文書はそのまま英日 2 言語のサイト(<https://takuizum.github.io/flexpyirt/>、日本語は `/ja/`)
|
|
179
|
+
にもなる(MkDocs、`mkdocs.yml`)。サイトは `main` から公開されるので、リリース済みの状態を表す。
|
|
180
|
+
ローカルでの確認:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
uv run --group docs mkdocs serve # プレビュー
|
|
184
|
+
uv run --group docs mkdocs build --strict # CI と同じ検査(リンク切れ・アンカー切れで失敗)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
- 文書内のリンクは相対リンクで書く(GitHub でもサイトでも動く)。`docs/` の外を指すリンクは、サイトでは
|
|
188
|
+
GitHub 上のファイルに書き換わる(`scripts/mkdocs_hooks.py`)。
|
|
189
|
+
- `README.md` / `README.ja.md` は PyPI のプロジェクトページにも表示されるので、リンクは絶対 URL で書く
|
|
190
|
+
(文書はサイトの URL、それ以外は GitHub の URL)。README はパッケージ利用者だけに向けたもので、開発環境の
|
|
191
|
+
準備、テストや CI の詳細、ブランチ運用、マイルストーン、CONTRIBUTING や `docs/dev/` へのリンクは書かない。
|
|
192
|
+
- `docs/` に文書を足したら `mkdocs.yml` の `nav`(と日本語の `nav_translations`)にも足す。
|
|
193
|
+
- サイトはパッケージ利用者向け: 使い方(`guide`, `reference`)、理論(`theory`)、結果の検証方法
|
|
194
|
+
(`accuracy`)。開発者向けの文書は `docs/dev/` に置く([設計](docs/dev/DESIGN.ja.md)、
|
|
195
|
+
[API スケッチ](docs/dev/API.ja.md)、[検証計画](docs/dev/VALIDATION.ja.md)、
|
|
196
|
+
[ロードマップ](docs/dev/ROADMAP.ja.md))。これらはサイトから除外されるので、サイトのページから相対リンクで
|
|
197
|
+
指さない(必要なら GitHub の URL)。マイルストーン、設計書の節番号、照合ケース ID は利用者向けページに書かない。
|
|
198
|
+
- `examples/` のケーススタディのノートブック(`docs/case-studies.ja.md` からリンク)は `X.ipynb` と `X.ja.ipynb` の
|
|
199
|
+
組で、コードは同じ。最初のセルは `main` の Colab を指し、インストールのセルは PyPI から flexpyirt を入れるので、
|
|
200
|
+
リリース済みの機能だけを使う。出力ごとコミットするので、変えたら両言語とも実行し直す:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
uv run --with nbconvert --with ipykernel jupyter nbconvert --to notebook --execute --inplace examples/*.ipynb
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
`tests/test_examples.py` が組と保存された出力を確かめ(fast)、コードを実行する(slow。`bfi` はデータを
|
|
207
|
+
ダウンロードする)。
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
English | [日本語](CONTRIBUTING.ja.md)
|
|
4
|
+
|
|
5
|
+
## Related packages
|
|
6
|
+
|
|
7
|
+
Three related packages each have their own repository and version (DESIGN.md §16.18, §16.24).
|
|
8
|
+
This repository holds flexpyirt only.
|
|
9
|
+
|
|
10
|
+
| Package | Repository | Contents |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| `flexpyirt` | [takuizum/flexpyirt](https://github.com/takuizum/flexpyirt) (here) | Estimation and everything that uses a fitted model. Depends on JAX and on flexpyctt |
|
|
13
|
+
| `flexpyctt` | [takuizum/flexpyctt](https://github.com/takuizum/flexpyctt) | Item and test analysis that needs no fitted model. NumPy, SciPy and pandas only |
|
|
14
|
+
| `flexpyequate` | [takuizum/flexpyequate](https://github.com/takuizum/flexpyequate) | Equating of score distributions. NumPy, SciPy and pandas only; independent of the other two |
|
|
15
|
+
|
|
16
|
+
- **flexpyirt requires `flexpyctt>=0.X,<0.(X+1)`** (`pyproject.toml`). Before 1.0, flexpyctt's
|
|
17
|
+
minor version is the unit of compatibility: a flexpyctt patch release keeps the public API. When
|
|
18
|
+
flexpyctt's minor version goes up, open a PR here that raises the range and check that CI passes
|
|
19
|
+
(`tests/test_packaging.py` checks the form of the range).
|
|
20
|
+
- A tool that needs a `FitResult` belongs in flexpyirt; one that needs only data belongs in
|
|
21
|
+
flexpyctt. flexpyirt re-exports flexpyctt's public names (listed explicitly in
|
|
22
|
+
`src/flexpyirt/__init__.py`).
|
|
23
|
+
- flexpyirt imports four private helpers of flexpyctt (`_coerce_ordinal`,
|
|
24
|
+
`_observed_correlation`, `_eigenvalues`, `_descending_eigenvalues`). A test in flexpyctt guards
|
|
25
|
+
their signatures.
|
|
26
|
+
- **A change that spans both**: change and release flexpyctt in its repository first, then raise
|
|
27
|
+
the range here.
|
|
28
|
+
- `tests/reference/flexpyctt/v24_polychoric.json` and `v27_detect.json` are copies of flexpyctt's reference
|
|
29
|
+
values. Copy them again when they are regenerated in flexpyctt.
|
|
30
|
+
- Equating that needs item parameters belongs in flexpyirt. flexpyirt does not depend on
|
|
31
|
+
flexpyequate (it is in the `dev` dependency group only: `tests/test_equating.py` uses it as
|
|
32
|
+
an independent implementation to compare with).
|
|
33
|
+
|
|
34
|
+
## Branches
|
|
35
|
+
|
|
36
|
+
| Branch | Role | Created from / merged into |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `main` | Released states only. No direct pushes | Accepts release PRs from `develop` only |
|
|
39
|
+
| `develop` | Integration branch; collects what goes into the next release | Accepts PRs from `feature/*` and `fix/*` |
|
|
40
|
+
| `feature/<slug>` | Features, documentation, refactoring and so on | From `develop`, PR into `develop` |
|
|
41
|
+
| `fix/<issue number>-<slug>` | Bug fixes. **Always tied to an issue** | From `develop`, PR into `develop` |
|
|
42
|
+
|
|
43
|
+
- `<slug>` uses lowercase letters, digits, `.`, `_` and `-` only (e.g. `feature/grm-docs`,
|
|
44
|
+
`fix/12-oakes-se`).
|
|
45
|
+
- A fix branch's PR description contains `Closes #<issue number>`, and the issue must be open.
|
|
46
|
+
(`develop` is not the default branch, so the workflow closes the issue **at release time**, not at
|
|
47
|
+
merge time.)
|
|
48
|
+
- The `PR rules` check (`scripts/check_pr.py`) enforces these on every PR.
|
|
49
|
+
|
|
50
|
+
## PRs and reviews
|
|
51
|
+
|
|
52
|
+
- Every change goes in through a PR. `main` and `develop` are protected by rulesets and cannot be
|
|
53
|
+
merged into until CI (`test (3.12/3.13)`) and `pr-rules` pass.
|
|
54
|
+
- The repository owner reviews PRs before merging them (no automatic merging).
|
|
55
|
+
- Changes to numerical code must pass the agreement tests against R mirt
|
|
56
|
+
([docs/dev/VALIDATION.md](docs/dev/VALIDATION.md)).
|
|
57
|
+
|
|
58
|
+
## Releases
|
|
59
|
+
|
|
60
|
+
The version comes from **git tags** (`vX.Y.Z`, via hatch-vcs). `pyproject.toml` holds no version;
|
|
61
|
+
releasing means tagging. Untagged development commits get versions like `0.0.2.dev3+g1a2b3c4`.
|
|
62
|
+
|
|
63
|
+
1. Open a PR from `develop` into `main`. **Its title decides the version bump**:
|
|
64
|
+
- `release(major): ...` / `release(minor): ...` / `release(patch): ...`
|
|
65
|
+
- Merge it with a **merge commit** (the `main` ruleset allows merge commits only).
|
|
66
|
+
2. The merge runs `.github/workflows/release.yml`:
|
|
67
|
+
1. `plan` job: computes the next version from the PR title and the latest `vX.Y.Z` tag.
|
|
68
|
+
2. `publish` job: runs **without waiting for approval** (`release` environment, which deploys
|
|
69
|
+
from `main` only). It tags `main` with `vX.Y.Z`, builds (`uv build`) and creates a GitHub
|
|
70
|
+
Release (wheel and sdist attached, release notes generated). It then closes the issues
|
|
71
|
+
that fix PRs in this release `Closes`d.
|
|
72
|
+
3. `pypi` job: **waits for approval in the `pypi` environment**. Once the owner approves it on
|
|
73
|
+
the Actions page, it publishes the same wheel and sdist to PyPI (Trusted Publishing; no
|
|
74
|
+
API token).
|
|
75
|
+
4. The same push to `main` runs `.github/workflows/docs.yml`, which deploys the documentation
|
|
76
|
+
site to GitHub Pages.
|
|
77
|
+
3. **The first release** (no `v*` tag yet) is **v0.0.1**, whatever bump the title asks for.
|
|
78
|
+
4. Manual runs (`workflow_dispatch`) are dry runs only: they compute the next version and build.
|
|
79
|
+
5. **Before a release, a flexpyctt version inside the required range must be on PyPI** (the
|
|
80
|
+
`publish` job installs the built wheel together with flexpyctt from PyPI to check it).
|
|
81
|
+
|
|
82
|
+
Merge commits on `main` are not merged back into `develop` (`develop` is protected and the bot
|
|
83
|
+
cannot push to it). So development version numbers on `develop` may not refer to the latest release
|
|
84
|
+
tag; releases are not affected.
|
|
85
|
+
|
|
86
|
+
Versions follow [Semantic Versioning](https://semver.org/). The public API may change before 1.0.0.
|
|
87
|
+
|
|
88
|
+
## Security (who can release)
|
|
89
|
+
|
|
90
|
+
- **Only repository admins can update `main`** (ruleset `main-release-gate`). The PR and CI
|
|
91
|
+
requirements (ruleset `main`) apply to admins too. Only an admin who can merge develop into main
|
|
92
|
+
can start a release.
|
|
93
|
+
- **The `publish` job runs in the `release` environment**, which deploys from `main` only, so
|
|
94
|
+
other branches and forks cannot create tags or Releases. It has no required reviewer: merging
|
|
95
|
+
the release PR is the decision to tag.
|
|
96
|
+
- **The `pypi` job needs the designated reviewer's (the owner's) approval** in the `pypi`
|
|
97
|
+
environment. Nothing reaches PyPI without it.
|
|
98
|
+
- **PyPI uploads use Trusted Publishing** (OIDC). The PyPI project `flexpyirt`
|
|
99
|
+
trusts only the publisher "repository `takuizum/flexpyirt`, workflow `release.yml`, environment
|
|
100
|
+
`pypi`", so no API token lives in the repository. Restrict the `pypi` environment to deployments from `main` as well. A version
|
|
101
|
+
number uploaded to PyPI can never be reused, even after deleting it.
|
|
102
|
+
- Workflow `GITHUB_TOKEN`s are read-only by default (`permissions: contents: read`); only the
|
|
103
|
+
`publish` job writes. PRs from forks get a read-only token and run only CI and PR rules.
|
|
104
|
+
- Give new collaborators write access only. Every additional admin is another person who can
|
|
105
|
+
release.
|
|
106
|
+
|
|
107
|
+
## Local development
|
|
108
|
+
|
|
109
|
+
Manage Python environments with `uv` only (no pip).
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
uv sync --all-extras --dev
|
|
113
|
+
uv run ruff check . && uv run ruff format --check . && uv run mypy && uv run pytest
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Tests
|
|
117
|
+
|
|
118
|
+
Tests run in parallel (pytest-xdist, `-n auto`, one module per worker); pass `-n 0` to run
|
|
119
|
+
serially. They come in two tiers:
|
|
120
|
+
|
|
121
|
+
| Tier | What | Where it runs |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| fast | `-m "not slow"`: unit tests, docs, the M1 mirt smoke test, split into 3 shards per Python (a few minutes on CI) | every PR, every push to `develop`/`main` |
|
|
124
|
+
| full | everything, including all mirt reference comparisons, split into 4 shards per Python | nightly on `develop`, release PRs (`develop` → `main`), manual runs (*Run workflow*) |
|
|
125
|
+
|
|
126
|
+
A mirt reference comparison is complete only when the full tier passes (nightly or on the
|
|
127
|
+
release PR); check the nightly run before ticking a ROADMAP item.
|
|
128
|
+
|
|
129
|
+
- Mark a test `@pytest.mark.slow` when it takes more than ~5 s, counting its share of a fit it
|
|
130
|
+
caches with `functools.cache` (the first test that needs the fit pays for it). The fast-tier
|
|
131
|
+
summary lists unmarked tests over 5 s ("tests over 5 s not marked slow").
|
|
132
|
+
- `tests/test_mirt_*.py` modules are slow as a whole (`pytestmark = pytest.mark.slow`), except
|
|
133
|
+
`test_mirt_m1.py`.
|
|
134
|
+
- A module runs on one worker, so a fit that takes minutes goes in a module of its own (see
|
|
135
|
+
`tests/_mirt_multigroup.py` and `tests/test_mirt_m4_multigroup_*.py`).
|
|
136
|
+
- CI keeps a persistent JAX compilation cache between runs (`JAX_COMPILATION_CACHE_DIR`).
|
|
137
|
+
- Full-tier shards are balanced by the seconds per module in `tests/durations.json`, fast-tier
|
|
138
|
+
shards by those in `tests/durations-fast.json` (`--durations-file`). After adding or splitting
|
|
139
|
+
heavy modules, refresh them: `uv run pytest --write-durations tests/durations.json` and
|
|
140
|
+
`uv run pytest -m "not slow" -n 4 --write-durations tests/durations-fast.json` (or merge the
|
|
141
|
+
`durations-*` artifacts of a CI run). A module missing from a file counts as 1 s per test.
|
|
142
|
+
- On CI the required checks `test (3.12)` and `test (3.13)` pass when the `checks` job (ruff,
|
|
143
|
+
mypy) and every `fast` shard passed.
|
|
144
|
+
|
|
145
|
+
Run `uv run pytest -m "not slow"` locally for a quick check, and `uv run pytest --shard 2/4` to
|
|
146
|
+
run one full-tier shard as CI does
|
|
147
|
+
(`uv run pytest -m "not slow" --shard 2/3 --durations-file tests/durations-fast.json` for a fast-tier
|
|
148
|
+
one).
|
|
149
|
+
|
|
150
|
+
To regenerate the mirt reference values (needs R 4.4+; mirt is installed from GitHub,
|
|
151
|
+
`philchalmers/mirt`, into the user library or `FLEXPYIRT_R_LIB`; see
|
|
152
|
+
[VALIDATION.md](docs/dev/VALIDATION.md), "R and mirt versions"):
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
Rscript validation/r/install_mirt.R
|
|
156
|
+
validation/r/run_references.sh
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`validation/r/run_references.sh m1 m2` reruns single scripts; a new script that uses mirt sources
|
|
160
|
+
`validation/r/setup.R` and is added to the stage lists of `run_references.sh`.
|
|
161
|
+
|
|
162
|
+
The reference scripts of flexpyctt and flexpyequate are in `validation/r/` of their own
|
|
163
|
+
repositories.
|
|
164
|
+
|
|
165
|
+
To rerun the wall-time benchmarks against R `mirt` (see [benchmarks/README.md](benchmarks/README.md)
|
|
166
|
+
for details and `--quick` mode):
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
uv run python benchmarks/data.py
|
|
170
|
+
uv run python benchmarks/run_flexpyirt.py
|
|
171
|
+
Rscript benchmarks/run_mirt.R
|
|
172
|
+
uv run python benchmarks/report.py
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Naming
|
|
176
|
+
|
|
177
|
+
Names follow PEP 8 and read as Python, not as R (DESIGN.md §15.46). `ruff` checks the `N` rules.
|
|
178
|
+
|
|
179
|
+
- `snake_case` for functions, methods, arguments and variables; `CapWords` for classes;
|
|
180
|
+
`UPPER_SNAKE_CASE` for module constants.
|
|
181
|
+
- Do not copy R/mirt argument names. Use the Python spelling and mention mirt's name in the
|
|
182
|
+
docstring: `n_categories` (not `n_cat`), `min_cell` (mirt `mincell`), `mean_log`/`sd_log` (R
|
|
183
|
+
`meanlog`/`sdlog`), `bounds=(lower, upper)` (mirt `theta_lim`).
|
|
184
|
+
- Spell public names out (`is_empirical_histogram`, not `is_eh`). Well-known abbreviations are
|
|
185
|
+
fine: model names (`TwoPL`, `GRM`, `GPCM`), the `n_` prefix for counts, and `se`, `vcov`,
|
|
186
|
+
`loglik`, `theta`, `eta`. Avoid abbreviations that collide with common aliases, such as `pd`
|
|
187
|
+
(pandas) or `df` (degrees of freedom vs DataFrame).
|
|
188
|
+
- Use one name for one concept across the whole API (`n_points`, `n_factors`, `n_categories`).
|
|
189
|
+
Members of a family share a suffix (`NormalPrior`, `LogNormalPrior`, `BetaPrior`).
|
|
190
|
+
- `Literal` string options are lowercase `snake_case` (`"slope_intercept"`, `"stocking_lord"`).
|
|
191
|
+
Established acronyms stay upper case (`"EAP"`, `"MAP"`, `"BH"`).
|
|
192
|
+
- Mathematical notation is allowed where it mirrors the formulas in DESIGN.md: upper-case symbols
|
|
193
|
+
inside jitted kernels (`G`, `Q`, `D`, `K_f`; ruff `N803`/`N806` are ignored for this) and
|
|
194
|
+
standard constants such as `LinkResult.A`/`B`.
|
|
195
|
+
- Name local closures by their role (`objective`, `backtrack_body`, `interp_weights`), not `obj`
|
|
196
|
+
or `tmp`. Line-by-line ports of mirt code (e.g. `_itemfit.collapse_cells`) may keep mirt's local
|
|
197
|
+
names so they can be compared; say so in a comment.
|
|
198
|
+
- Renaming anything that is stored in `FitResult` JSON needs a new `schema_version`, and older
|
|
199
|
+
files must still load (rename the old keys on read).
|
|
200
|
+
|
|
201
|
+
## Documentation
|
|
202
|
+
|
|
203
|
+
Every document exists in English (`*.md`) and Japanese (`*.ja.md`) with the same content. Update
|
|
204
|
+
both when you change one. The PR and issue templates under `.github/` are single bilingual files
|
|
205
|
+
(English and Japanese side by side), because GitHub uses one default template.
|
|
206
|
+
|
|
207
|
+
The files in `docs/` also make up the bilingual documentation site
|
|
208
|
+
(<https://takuizum.github.io/flexpyirt/>, Japanese under `/ja/`; MkDocs, `mkdocs.yml`). The site is
|
|
209
|
+
deployed from `main`, so it shows the released state. To check it locally:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
uv run --group docs mkdocs serve # preview
|
|
213
|
+
uv run --group docs mkdocs build --strict # the CI check (fails on broken links and anchors)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
- Write links between documents as relative links (they work on GitHub and on the site). On the
|
|
217
|
+
site, links that leave `docs/` point to the file on GitHub (`scripts/mkdocs_hooks.py`).
|
|
218
|
+
- `README.md` / `README.ja.md` are also shown on the PyPI project page, so their links are absolute
|
|
219
|
+
(site URLs for documents, GitHub URLs for everything else). The README is for package users
|
|
220
|
+
only: no development setup, test or CI details, branch flow, milestones, or links to
|
|
221
|
+
CONTRIBUTING and `docs/dev/`.
|
|
222
|
+
- When you add a document to `docs/`, add it to `nav` in `mkdocs.yml` (and to the Japanese
|
|
223
|
+
`nav_translations`).
|
|
224
|
+
- The site is for package users: how to use flexpyirt (`guide`, `reference`), the theory behind it
|
|
225
|
+
(`theory`) and how its results are checked (`accuracy`). Developer documents live in `docs/dev/`
|
|
226
|
+
([design](docs/dev/DESIGN.md), [API sketch](docs/dev/API.md),
|
|
227
|
+
[validation plan](docs/dev/VALIDATION.md), [roadmap](docs/dev/ROADMAP.md)); they are excluded from
|
|
228
|
+
the site, so site pages must not link to them with relative links (use a GitHub URL if needed).
|
|
229
|
+
Keep milestones, design-section numbers and validation case IDs out of user pages.
|
|
230
|
+
- The case-study notebooks in `examples/` (linked from `docs/case-studies.md`) come in pairs,
|
|
231
|
+
`X.ipynb` and `X.ja.ipynb`, with the same code. Their first cell links to Colab on `main` and the
|
|
232
|
+
install cell installs flexpyirt from PyPI, so they may use only released features. They are
|
|
233
|
+
committed with their outputs; after changing one, run both languages again:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
uv run --with nbconvert --with ipykernel jupyter nbconvert --to notebook --execute --inplace examples/*.ipynb
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
`tests/test_examples.py` checks the pairs and the stored outputs (fast tier) and runs the code
|
|
240
|
+
(slow tier; the `bfi` notebook downloads its data).
|