From 1b80fb74dfc8e36491c44ea2c705da057cb7efa1 Mon Sep 17 00:00:00 2001 From: Mollie Brooks Date: Tue, 4 Jun 2024 11:58:05 +0200 Subject: [PATCH 1/3] ranef in dispformula also There is another part to `ranef` because we added random effects to the dispformula here, https://github.com/glmmTMB/glmmTMB/pull/997 Signed-off-by: Mollie Brooks --- tests/testthat/test-mtscr_model.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-mtscr_model.R b/tests/testthat/test-mtscr_model.R index 98d443a..1a48eb0 100644 --- a/tests/testthat/test-mtscr_model.R +++ b/tests/testthat/test-mtscr_model.R @@ -9,7 +9,7 @@ test_that("mtscr_model() works as expected", { # Test that the function returns the expected number of fixed and random effects expect_equal(length(glmmTMB::fixef(model)), 3) - expect_equal(length(glmmTMB::ranef(model)), 2) + expect_equal(length(glmmTMB::ranef(model)), 3) }) # Test that `prepared` argument works as expected From f55a96ab08c78630d34285aa2b91b658e5a48cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20J=C4=99drusiak?= Date: Thu, 26 Sep 2024 19:26:21 +0200 Subject: [PATCH 2/3] update workflows --- .github/workflows/R-CMD-check.yaml | 7 +++++-- .github/workflows/test-coverage.yaml | 28 ++++++++++++++++++---------- README.Rmd | 3 ++- README.md | 9 +++++++-- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index a3ac618..d46a617 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -6,7 +6,9 @@ on: pull_request: branches: [main, master] -name: R-CMD-check +name: R-CMD-check.yaml + +permissions: read-all jobs: R-CMD-check: @@ -29,7 +31,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -47,3 +49,4 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 672790e..9882260 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -6,17 +6,18 @@ on: pull_request: branches: [main, master] -name: test-coverage +name: test-coverage.yaml + +permissions: read-all jobs: test-coverage: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -24,30 +25,37 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::covr + extra-packages: any::covr, any::xml2 needs: coverage - name: Test coverage run: | - covr::codecov( + cov <- covr::package_coverage( quiet = FALSE, clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) + covr::to_cobertura(cov) shell: Rscript {0} + - uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} + file: ./cobertura.xml + plugin: noop + disable_search: true + token: ${{ secrets.CODECOV_TOKEN }} + - name: Show testthat output if: always() run: | ## -------------------------------------------------------------------- - find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true shell: bash - name: Upload test results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-test-failures path: ${{ runner.temp }}/package - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 diff --git a/README.Rmd b/README.Rmd index 3ff8880..dc80441 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,9 +17,10 @@ knitr::opts_chunk$set( -[![codecov](https://codecov.io/gh/jakub-jedrusiak/mtscr/branch/main/graph/badge.svg?token=N3UGHFK5QN)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) [![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![CRAN/METACRAN](https://img.shields.io/cran/v/mtscr)](https://CRAN.R-project.org/package=mtscr) +[![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/jakub-jedrusiak/mtscr/graph/badge.svg)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) An R adaptation of Multidimensional Top Scoring method presented by Forthmann, Karwowski and Beaty ([2023](https://doi.org/10.1037/aca0000571)) using the code from the [OSF database](https://osf.io/7rgsp/). The code was adapted to use the [tidyverse](https://www.tidyverse.org/) framework for greater flexibility. diff --git a/README.md b/README.md index b22b31a..32f659a 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,12 @@ -[![codecov](https://codecov.io/gh/jakub-jedrusiak/mtscr/branch/main/graph/badge.svg?token=N3UGHFK5QN)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) -[![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![CRAN/METACRAN](https://img.shields.io/cran/v/mtscr)](https://CRAN.R-project.org/package=mtscr) +[![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) +[![Codecov test +coverage](https://codecov.io/gh/jakub-jedrusiak/mtscr/graph/badge.svg)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) An R adaptation of Multidimensional Top Scoring method presented by @@ -57,6 +58,10 @@ library("mtscr") data("mtscr_creativity", package = "mtscr") mtscr_score(mtscr_creativity, id, item, SemDis_MEAN, top = 1:2) +#> Warning in checkDepPackageVersion(dep_pkg = "TMB"): Package version inconsistency detected. +#> glmmTMB was built with TMB version 1.9.11 +#> Current TMB version is 1.9.15 +#> Please re-install glmmTMB from source or restore original 'TMB' package (see '?reinstalling' for more information) #> # A tibble: 149 × 3 #> id .creativity_score_top1 .creativity_score_top2 #> From 32baef6a0ddeefdab7ea7debf8914d96d7f8c3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20J=C4=99drusiak?= Date: Thu, 26 Sep 2024 19:29:56 +0200 Subject: [PATCH 3/3] Revert "update workflows" This reverts commit f55a96ab08c78630d34285aa2b91b658e5a48cb5. --- .github/workflows/R-CMD-check.yaml | 7 ++----- .github/workflows/test-coverage.yaml | 28 ++++++++++------------------ README.Rmd | 3 +-- README.md | 9 ++------- 4 files changed, 15 insertions(+), 32 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index d46a617..a3ac618 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -6,9 +6,7 @@ on: pull_request: branches: [main, master] -name: R-CMD-check.yaml - -permissions: read-all +name: R-CMD-check jobs: R-CMD-check: @@ -31,7 +29,7 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - uses: r-lib/actions/setup-pandoc@v2 @@ -49,4 +47,3 @@ jobs: - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 9882260..672790e 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -6,18 +6,17 @@ on: pull_request: branches: [main, master] -name: test-coverage.yaml - -permissions: read-all +name: test-coverage jobs: test-coverage: runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - uses: r-lib/actions/setup-r@v2 with: @@ -25,37 +24,30 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::covr, any::xml2 + extra-packages: any::covr needs: coverage - name: Test coverage run: | - cov <- covr::package_coverage( + covr::codecov( quiet = FALSE, clean = FALSE, - install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") ) - covr::to_cobertura(cov) shell: Rscript {0} - - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} - file: ./cobertura.xml - plugin: noop - disable_search: true - token: ${{ secrets.CODECOV_TOKEN }} - - name: Show testthat output if: always() run: | ## -------------------------------------------------------------------- - find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true shell: bash - name: Upload test results if: failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: coverage-test-failures path: ${{ runner.temp }}/package + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 diff --git a/README.Rmd b/README.Rmd index dc80441..3ff8880 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,10 +17,9 @@ knitr::opts_chunk$set( +[![codecov](https://codecov.io/gh/jakub-jedrusiak/mtscr/branch/main/graph/badge.svg?token=N3UGHFK5QN)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) [![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![CRAN/METACRAN](https://img.shields.io/cran/v/mtscr)](https://CRAN.R-project.org/package=mtscr) -[![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) -[![Codecov test coverage](https://codecov.io/gh/jakub-jedrusiak/mtscr/graph/badge.svg)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) An R adaptation of Multidimensional Top Scoring method presented by Forthmann, Karwowski and Beaty ([2023](https://doi.org/10.1037/aca0000571)) using the code from the [OSF database](https://osf.io/7rgsp/). The code was adapted to use the [tidyverse](https://www.tidyverse.org/) framework for greater flexibility. diff --git a/README.md b/README.md index 32f659a..b22b31a 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,11 @@ +[![codecov](https://codecov.io/gh/jakub-jedrusiak/mtscr/branch/main/graph/badge.svg?token=N3UGHFK5QN)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) +[![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![CRAN/METACRAN](https://img.shields.io/cran/v/mtscr)](https://CRAN.R-project.org/package=mtscr) -[![R-CMD-check](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jakub-jedrusiak/mtscr/actions/workflows/R-CMD-check.yaml) -[![Codecov test -coverage](https://codecov.io/gh/jakub-jedrusiak/mtscr/graph/badge.svg)](https://app.codecov.io/gh/jakub-jedrusiak/mtscr) An R adaptation of Multidimensional Top Scoring method presented by @@ -58,10 +57,6 @@ library("mtscr") data("mtscr_creativity", package = "mtscr") mtscr_score(mtscr_creativity, id, item, SemDis_MEAN, top = 1:2) -#> Warning in checkDepPackageVersion(dep_pkg = "TMB"): Package version inconsistency detected. -#> glmmTMB was built with TMB version 1.9.11 -#> Current TMB version is 1.9.15 -#> Please re-install glmmTMB from source or restore original 'TMB' package (see '?reinstalling' for more information) #> # A tibble: 149 × 3 #> id .creativity_score_top1 .creativity_score_top2 #>