From 7eef331d38cbd40d68b8a5847b2a27c692713e50 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 12 Sep 2026 01:38:37 +0900 Subject: [PATCH 1/3] test: pin runtime banner to package metadata --- tests/testthat/test-package-version-banner.R | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/testthat/test-package-version-banner.R diff --git a/tests/testthat/test-package-version-banner.R b/tests/testthat/test-package-version-banner.R new file mode 100644 index 00000000..5ce05809 --- /dev/null +++ b/tests/testthat/test-package-version-banner.R @@ -0,0 +1,28 @@ +test_that("autoFIPC banner reports the installed package version", { + messages <- character() + + expect_error( + withCallingHandlers( + aFIPC::autoFIPC( + newformXData = NULL, + oldformYData = NULL, + newformCommonItemNames = character(), + oldformCommonItemNames = character() + ), + message = function(condition) { + messages <<- c(messages, conditionMessage(condition)) + invokeRestart("muffleMessage") + } + ), + "newformXData must be a data.frame, matrix, or a valid fitted mirt model" + ) + + expect_gte(length(messages), 1L) + expect_identical( + messages[[1]], + paste0( + "automated Fixed Item Parameter Calibration: aFIPC ", + as.character(utils::packageVersion("aFIPC")) + ) + ) +}) From 2f0f7a53f9717b97dc3308ab90a083de168bd5ab Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 12 Sep 2026 01:43:12 +0900 Subject: [PATCH 2/3] fix: derive runtime banner from package metadata --- R/aFIPC.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/R/aFIPC.R b/R/aFIPC.R index 62546519..aee5cb98 100644 --- a/R/aFIPC.R +++ b/R/aFIPC.R @@ -5,7 +5,7 @@ #' @param newformXData new form data X #' @param oldformYData old form (base form) data Y #' @param newformCommonItemNames Common item variable names in new form data -#' @param oldformCommonItemNames Common item variable names in old (base) form data +#' @param oldformCommonItemNames Common item variable names in old (base form) data #' @param itemtype itemtype of calibration #' @param newformBILOGprior using BILOG-MG prior when try to calibrate 3PL model? if you want, set the this to TRUE #' @param oldformBILOGprior using BILOG-MG prior when try to calibrate 3PL model? if you want, set the this to TRUE @@ -54,7 +54,12 @@ autoFIPC <- ... ) { # print credits - message('automated Fixed Item Parameter Calibration: aFIPC 0.2') + message( + paste0( + 'automated Fixed Item Parameter Calibration: aFIPC ', + as.character(utils::packageVersion('aFIPC')) + ) + ) message('Seongho Bae (seongho@kw.ac.kr)\n') try(invisible(gc()), silent = T) # garbage cleaning @@ -597,7 +602,6 @@ autoFIPC <- # Preserve mirt's structural estimability flags. Forcing every row TRUE # frees boundary parameters such as 2PL g/u and makes the Hessian unstable. - NewScaleParms[NewScaleParms$item == 'GROUP', "est"] <- FALSE OldScaleParms[OldScaleParms$item == 'GROUP', "est"] <- FALSE @@ -1051,4 +1055,4 @@ autoFIPC <- } return(as.list(modelReturn)) - } + } \ No newline at end of file From 3e21ef336e140b36b0a51c956995dbe982050aa6 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 12 Sep 2026 01:45:11 +0900 Subject: [PATCH 3/3] chore: restore exact source context around version fix --- R/aFIPC.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/aFIPC.R b/R/aFIPC.R index aee5cb98..764017eb 100644 --- a/R/aFIPC.R +++ b/R/aFIPC.R @@ -5,7 +5,7 @@ #' @param newformXData new form data X #' @param oldformYData old form (base form) data Y #' @param newformCommonItemNames Common item variable names in new form data -#' @param oldformCommonItemNames Common item variable names in old (base form) data +#' @param oldformCommonItemNames Common item variable names in old (base) form data #' @param itemtype itemtype of calibration #' @param newformBILOGprior using BILOG-MG prior when try to calibrate 3PL model? if you want, set the this to TRUE #' @param oldformBILOGprior using BILOG-MG prior when try to calibrate 3PL model? if you want, set the this to TRUE @@ -602,6 +602,7 @@ autoFIPC <- # Preserve mirt's structural estimability flags. Forcing every row TRUE # frees boundary parameters such as 2PL g/u and makes the Hessian unstable. + NewScaleParms[NewScaleParms$item == 'GROUP', "est"] <- FALSE OldScaleParms[OldScaleParms$item == 'GROUP', "est"] <- FALSE @@ -1055,4 +1056,4 @@ autoFIPC <- } return(as.list(modelReturn)) - } \ No newline at end of file + }