Skip to content

Commit 66f6407

Browse files
committed
Changed cran-comments.md
1 parent d4a29d5 commit 66f6407

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

cran-comments.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Changes and notes
2-
* Added a more descriptive _Description_ field in DESCRIPTION, as requested by Uwe Ligges.
2+
* fixed DOI format in description, as requested by Uwe Ligges.
3+
* this upload also addresses the problem reported by Brian Ripley: the offending test was changed so that integers are compared instead of doubles, and the values compared are much smaller (without compromising the validity of the test).
34

45
## Test environments
56
* local OS X install, R 3.3.1

tests/testthat/test_decomposition.R

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,22 @@ correct_dimensions <- function(W, rows, cols) {
1919
# 1: SLD decomposition
2020
decomp.sld1 <- list(name = "sld", H = 99)
2121
m1 <- 2
22+
tr1 <- choose(decomp.sld1$H + m1 - 1, m1 - 1)
23+
W1 <- generate_weights(decomp.sld1, m1)
24+
2225
decomp.sld2 <- list(name = "sld", H = 2)
2326
m2 <- 10
27+
tr2 <- choose(decomp.sld2$H + m2 - 1, m2 - 1)
28+
W2 <- generate_weights(decomp.sld2, m2)
2429

2530
testthat::test_that("SLD decomposition returns correct sizes", {
26-
27-
testthat::expect_true(correct_dimensions(generate_weights(decomp.sld1, m1),
28-
rows = choose(decomp.sld1$H + m1 - 1,
29-
m1 - 1),
30-
cols = m1))
31-
32-
testthat::expect_true(correct_dimensions(generate_weights(decomp.sld2, m2),
33-
rows = choose(decomp.sld2$H + m2 - 1,
34-
m2 - 1),
35-
cols = m2))
31+
testthat::expect_true(correct_dimensions(W1, tr1, m1))
32+
testthat::expect_true(correct_dimensions(W2, tr2, m2))
3633
})
3734

3835
testthat::test_that("SLD decomposition returns unitary weight vectors", {
39-
40-
testthat::expect_true(rows_sum_one(generate_weights(decomp.sld1, m1)))
41-
testthat::expect_true(rows_sum_one(generate_weights(decomp.sld2, m2)))
36+
testthat::expect_true(rows_sum_one(W1))
37+
testthat::expect_true(rows_sum_one(W2))
4238
})
4339

4440
# 2: MSLD decomposition
@@ -56,7 +52,7 @@ testthat::test_that("MSDL rejects invalid inputs", {
5652
})
5753
testthat::test_that("MSDL returns correct size", {
5854
testthat::expect_equal(dim(generate_weights(decomp.msld2, msld2)),
59-
c(34,4))
55+
c(34, 4))
6056
})
6157
testthat::test_that("MSDL returns correct values", {
6258
testthat::expect_equal(generate_weights(decomp.msld3, msld3),
@@ -76,7 +72,6 @@ unif_obj <- 4
7672

7773
testthat::test_that("Uniform returns unitary weight vectors", {
7874
testthat::expect_true(rows_sum_one(generate_weights(decomp.unif1, unif_obj)))
79-
# testthat::expect_true(is_valid_decomposition(generate_weights(decomp.unif2, unif_obj)))
8075
testthat::expect_true(rows_sum_one(generate_weights(decomp.unif3, unif_obj)))
8176
})
8277

0 commit comments

Comments
 (0)