Swarchal / platetools

An R package for plotting microtitre plates
Other
54 stars 15 forks source link

Changes to matrix() in r-devel 2021-05-31 r80430 causing test failure #29

Closed Swarchal closed 3 years ago

Swarchal commented 3 years ago

\item \code{matrix(x, n, m)} now warns in more cases where \code{length(x)} differs from than \code{n * m}; suggested by Abby Spurdle and Wolfgang Huber in Feb 2021 on the R-devel mailing list.

This warning can be turned into an error by setting environment variable \env{_R_CHECK_MATRIXDATA} to \samp{TRUE}: \command{R CMD check --as-cran} does so unless it is already set.

in current r-devel, where the Debian-based checks are now performed with _R_CHECK_MATRIXDATA=TRUE.

 Version: 0.1.3
Check: tests
Result: ERROR
     Running 'testthat.R' [11s/12s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(platetools)
     >
     > test_check("platetools")
     == Skipped tests ===============================================================
     * empty test (4)

     == Failed tests ================================================================
     -- Error (test-basic_plots.R:44:9): return ggplot object -----------------------
     Error: data length differs from size of matrix: [1536 != 32 x 24]
     Backtrace:
     x
     1. +-testthat::expect_is(...) test-basic_plots.R:44:8
     2. | \-testthat::quasi_label(enquo(object), label, arg = "object")
     3. | \-rlang::eval_bare(expr, quo_get_env(quo))
     4. \-platetools::bhit_map(data = vals1536, well = wells1536, plate = 1536)
     5. \-base::matrix(data, nrow = 32, ncol = 24, byrow = TRUE)
     -- Error (test-basic_plots.R:104:5): returns error when incorrect plate is passed --
     Error: data length differs from size of matrix: [384 != 8 x 12]
     Backtrace:
     x
     1. +-testthat::expect_warning(...) test-basic_plots.R:104:4
     2. | \-testthat:::quasi_capture(enquo(object), label, capture_warnings)
     3. | +-testthat:::.capture(...)
     4. | | \-base::withCallingHandlers(...)
     5. | \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     6. \-platetools::b_map(data = vals384, well = wells384, plate = 96)
     7. \-platetools::med_smooth(...)
     8. \-base::matrix(platemap$values, nrow = 8, ncol = 12, byrow = TRUE)

     [ FAIL 2 | WARN 0 | SKIP 4 | PASS 156 ]
     Error: Test failures
     Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 0.1.3
Check: tests
Result: ERROR
     Running ‘testthat.R’ [8s/13s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(platetools)
     >
     > test_check("platetools")
     ══ Skipped tests ═══════════════════════════════════════════════════════════════
     • empty test (4)

     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Error (test-basic_plots.R:44:9): return ggplot object ───────────────────────
     Error: data length differs from size of matrix: [1536 != 32 x 24]
     Backtrace:
     █
     1. ├─testthat::expect_is(...) test-basic_plots.R:44:8
     2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
     3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
     4. └─platetools::bhit_map(data = vals1536, well = wells1536, plate = 1536)
     5. └─base::matrix(data, nrow = 32, ncol = 24, byrow = TRUE)
     ── Error (test-basic_plots.R:104:5): returns error when incorrect plate is passed ──
     Error: data length differs from size of matrix: [384 != 8 x 12]
     Backtrace:
     █
     1. ├─testthat::expect_warning(...) test-basic_plots.R:104:4
     2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
     3. │ ├─testthat:::.capture(...)
     4. │ │ └─base::withCallingHandlers(...)
     5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     6. └─platetools::b_map(data = vals384, well = wells384, plate = 96)
     7. └─platetools::med_smooth(...)
     8. └─base::matrix(platemap$values, nrow = 8, ncol = 12, byrow = TRUE)

     [ FAIL 2 | WARN 0 | SKIP 4 | PASS 156 ]
     Error: Test failures
     Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 0.1.3
Check: tests
Result: ERROR
     Running ‘testthat.R’ [13s/41s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(platetools)
     >
     > test_check("platetools")
     ══ Skipped tests ═══════════════════════════════════════════════════════════════
     • empty test (4)

     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Error (test-basic_plots.R:44:9): return ggplot object ───────────────────────
     Error: data length differs from size of matrix: [1536 != 32 x 24]
     Backtrace:
     █
     1. ├─testthat::expect_is(...) test-basic_plots.R:44:8
     2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
     3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
     4. └─platetools::bhit_map(data = vals1536, well = wells1536, plate = 1536)
     5. └─base::matrix(data, nrow = 32, ncol = 24, byrow = TRUE)
     ── Error (test-basic_plots.R:104:5): returns error when incorrect plate is passed ──
     Error: data length differs from size of matrix: [384 != 8 x 12]
     Backtrace:
     █
     1. ├─testthat::expect_warning(...) test-basic_plots.R:104:4
     2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
     3. │ ├─testthat:::.capture(...)
     4. │ │ └─base::withCallingHandlers(...)
     5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     6. └─platetools::b_map(data = vals384, well = wells384, plate = 96)
     7. └─platetools::med_smooth(...)
     8. └─base::matrix(platemap$values, nrow = 8, ncol = 12, byrow = TRUE)

     [ FAIL 2 | WARN 0 | SKIP 4 | PASS 156 ]
     Error: Test failures
     Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 0.1.3
Check: tests
Result: ERROR
     Running ‘testthat.R’ [13s/15s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(platetools)
     >
     > test_check("platetools")
     ══ Skipped tests ═══════════════════════════════════════════════════════════════
     • empty test (4)

     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Error (test-basic_plots.R:44:9): return ggplot object ───────────────────────
     Error: data length differs from size of matrix: [1536 != 32 x 24]
     Backtrace:
     █
     1. ├─testthat::expect_is(...) test-basic_plots.R:44:8
     2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
     3. │ └─rlang::eval_bare(expr, quo_get_env(quo))
     4. └─platetools::bhit_map(data = vals1536, well = wells1536, plate = 1536)
     5. └─base::matrix(data, nrow = 32, ncol = 24, byrow = TRUE)
     ── Error (test-basic_plots.R:104:5): returns error when incorrect plate is passed ──
     Error: data length differs from size of matrix: [384 != 8 x 12]
     Backtrace:
     █
     1. ├─testthat::expect_warning(...) test-basic_plots.R:104:4
     2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
     3. │ ├─testthat:::.capture(...)
     4. │ │ └─base::withCallingHandlers(...)
     5. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     6. └─platetools::b_map(data = vals384, well = wells384, plate = 96)
     7. └─platetools::med_smooth(...)
     8. └─base::matrix(platemap$values, nrow = 8, ncol = 12, byrow = TRUE)

     [ FAIL 2 | WARN 0 | SKIP 4 | PASS 156 ]
     Error: Test failures
     Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc