dpc10ster / RJafroc

Artificial Intelligence: Evaluating AI, optimizing AI
19 stars 8 forks source link

Test warning in test-StCompare2Iowa.R #79

Closed pwep closed 2 years ago

pwep commented 2 years ago

I'm getting a warning for lines 501-502 in test-StCompare2Iowa.R

Unlike other tests in this file, the test on line 501 is checking there is no equality - comparing the first 2 values of theirs and mine. The previous tests compare all values in theirs and mine.

https://github.com/dpc10ster/RJafroc/blob/d9149e8c83e86d53aeceb68758b9b2bbc85620ea/tests/testthat/test-StCompare2Iowa.R#L501

...with values 3:6 compared for equality on line 502.

https://github.com/dpc10ster/RJafroc/blob/d9149e8c83e86d53aeceb68758b9b2bbc85620ea/tests/testthat/test-StCompare2Iowa.R#L502

My warning is:

Warning (test-StCompare2Iowa.R:502:3): StSignificanceTesting: Compare to Iowa Franken dataset
longer object length is not a multiple of shorter object length
Backtrace:
 1. testthat::expect_equal(...)
      at test-StCompare2Iowa.R:502:2
 3. testthat:::compare.numeric(act$val, exp$val, ..., tolerance = tolerance)
 5. base::all.equal.numeric(...)

This is coming from the scale argument. All values are being passed for in the scale, but only 2 values are compared for line 501, and 4 for line 502.

The fix is to pass only the values of interest in mine into the scale argument.

expect_error(expect_equal(theirs[1:2], mine[1:2], tolerance = 0.00001, scale = abs(mine[1:2]))) 
expect_equal(theirs[3:6], mine[3:6], tolerance = 0.00001, scale = abs(mine[3:6]))
dpc10ster commented 2 years ago

I saw this warning yesterday and thought I fixed it but your fix is the correct way. I have incorporated your fix in the master and developer branches: 7ef8b780aff67968958572faf38c010843b95e92

These have seen considerable changes in last few days, so once I am done I will redo the steps of of going from the master branch to a CRAN branch cran210.

I will delete the 2 vignettes, as they are better handled in the other packages (RJafrocQuickStart and RJafrocFrocBook) which I am publishing independent of CRAN using bookdown. Also this will get rid of the package size warning that I am seeing on some platforms.

So you can delete the 2 vignettes at your end and see if it passes all platforms. That way I can focus on redoing the CRAN branch and writing up the cran comments.md file and doing a final test on all platforms.

dpc10ster commented 2 years ago

I figured out how to get all the changes from cran4 branch onto cran210; my git skills are improving!