diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 27eaa75..012f9f0 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -36,7 +36,10 @@ jobs: - name: Install dependencies uses: r-lib/actions/setup-r-dependencies@v2 with: + # TEMPORARY: barry (>= 0.2.2) is not on CRAN yet; pull it from + # barryr's main branch. Remove once barry 0.2.2 is on CRAN. extra-packages: | any::rcmdcheck any::tinytest + USCbiostats/barryr needs: check diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 8807b99..b993515 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -20,8 +20,11 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: + # TEMPORARY: barry (>= 0.2.2) is not on CRAN yet; pull it from + # barryr's main branch. Remove once barry 0.2.2 is on CRAN. extra-packages: | any::covr + USCbiostats/barryr needs: check - name: Running coverage diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 68c1a7b..50a5d65 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -41,9 +41,12 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: + # TEMPORARY: barry (>= 0.2.2) is not on CRAN yet; pull it from + # barryr's main branch. Remove once barry 0.2.2 is on CRAN. extra-packages: | any::pkgdown local::. + USCbiostats/barryr needs: website - name: Build site diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 1412d0d..d6af285 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -25,6 +25,13 @@ jobs: use-public-rspm: true - uses: r-lib/actions/setup-r-dependencies@v2 + with: + # TEMPORARY: barry (>= 0.2.2) is not on CRAN yet; pull it from + # barryr's main branch. Remove once barry 0.2.2 is on CRAN. + # (The DESCRIPTION Remotes field is not honored by pak's + # `deps::.`, so the source must be listed here.) + extra-packages: | + USCbiostats/barryr - name: Build package run: R CMD build . @@ -73,8 +80,11 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: + # TEMPORARY: barry (>= 0.2.2) is not on CRAN yet; pull it from + # barryr's main branch. Remove once barry 0.2.2 is on CRAN. extra-packages: | any::rcmdcheck + USCbiostats/barryr needs: check - uses: r-lib/actions/check-r-package@v2 diff --git a/DESCRIPTION b/DESCRIPTION index f2016f6..05a730c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: defm Type: Package Title: Estimation and Simulation of Multi-Binary Response Models -Version: 0.2.1.0 +Version: 0.2.2.0 Authors@R: c( person("George", "Vega Yon", role=c("aut", "cre"), email="g.vegayon@gmail.com", comment = c(ORCID = "0000-0002-3171-0844")), @@ -23,7 +23,7 @@ Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.3 -LinkingTo: Rcpp, barry +LinkingTo: Rcpp, barry (>= 0.2.2) Imports: Rcpp, stats @@ -32,3 +32,5 @@ Depends: stats4 Suggests: texreg, tinytest, barry +Remotes: + USCbiostats/barryr diff --git a/NEWS.md b/NEWS.md index 910594c..a5f11d7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,16 @@ +# defm 0.2.2.0 + +* Requires `barry` (>= 0.2.2), which fixes a hash-collision bug that made + `init_defm()` appear to hang for models with many outcome columns + (USCbiostats/barry#24). A 16-outcome model that previously never finished + initializing now takes seconds. + +* Long-running computations (e.g., the support enumeration in `init_defm()`) + can now be interrupted from R with Ctrl-C. Note that a model interrupted + mid-initialization is left partially initialized and should be rebuilt + with `new_defm()` before further use. + + # defm 0.2.1.0 * Returning to CRAN. diff --git a/src/counters.cpp b/src/counters.cpp index 194d796..92779d3 100644 --- a/src/counters.cpp +++ b/src/counters.cpp @@ -1,4 +1,9 @@ #include + +// Lets barry check for user interrupts (Ctrl-C) during long-running +// computations such as the support enumeration in init_defm(). +#define BARRY_USER_INTERRUPT Rcpp::checkUserInterrupt(); + #include #include diff --git a/src/defm-object.cpp b/src/defm-object.cpp index f1075ad..4a35956 100644 --- a/src/defm-object.cpp +++ b/src/defm-object.cpp @@ -1,4 +1,9 @@ #include + +// Lets barry check for user interrupts (Ctrl-C) during long-running +// computations such as the support enumeration in init_defm(). +#define BARRY_USER_INTERRUPT Rcpp::checkUserInterrupt(); + #include #include diff --git a/src/terms.cpp b/src/terms.cpp index 73b8452..4d5aa22 100644 --- a/src/terms.cpp +++ b/src/terms.cpp @@ -1,4 +1,9 @@ #include + +// Lets barry check for user interrupts (Ctrl-C) during long-running +// computations such as the support enumeration in init_defm(). +#define BARRY_USER_INTERRUPT Rcpp::checkUserInterrupt(); + #include "barry/barry.hpp" #include "barry/models/defm.hpp" #include "defm-common.h"