Skip to content

test(n, identical(...)) in froll.Rraw #3371

Description

@mattdowle

Follow up to #3364.
2 of the 24 tests using identical() have been relaxed. Can the other 22 be relaxed similarly @jangorecki ?

$ grep "test.*identical" froll.Rraw
test(9999.120, identical(frollmean(x, n), ma(x, n, nf.rm=TRUE)))
test(9999.121, identical(frollmean(x, n, algo="exact"), ma(x, n)))
test(9999.122, identical(frollmean(x, n), ma(x, n, nf.rm=TRUE)))
test(9999.123, frollmean(x, n, algo="exact"), ma(x, n)) # use do not use identical as NaN-NA behaviour is platform/compiler specific #3353
test(9999.124, identical(frollmean(x, n), ma(x, n, nf.rm=TRUE)))
test(9999.125, identical(frollmean(x, n, algo="exact"), ma(x, n)))
test(9999.126, identical(frollmean(x, n), ma(x, n, nf.rm=TRUE)))
test(9999.127, identical(frollmean(x, n, algo="exact"), ma(x, n)))
test(9999.128, identical(frollmean(x, n), ma(x, n, nf.rm=TRUE)))
test(9999.129, identical(frollmean(x, n, algo="exact"), ma(x, n)))
test(9999.130, identical(frollmean(x, n), ma(x, n, nf.rm=TRUE)))
test(9999.131, identical(frollmean(x, n, algo="exact"), ma(x, n)))
test(9999.159, identical(frollmean(x, n, adaptive=TRUE), ama(x, n, nf.rm=TRUE)))
test(9999.160, identical(frollmean(x, n, algo="exact", adaptive=TRUE), ama(x, n)))
test(9999.161, identical(frollmean(x, n, adaptive=TRUE), ama(x, n, nf.rm=TRUE)))
test(9999.162, frollmean(x, n, algo="exact", adaptive=TRUE), ama(x, n)) # use do not use identical as NaN-NA behaviour is platform/compiler specific #3353
test(9999.163, identical(frollmean(x, n, adaptive=TRUE), ama(x, n, nf.rm=TRUE)))
test(9999.164, identical(frollmean(x, n, algo="exact", adaptive=TRUE), ama(x, n)))
test(9999.165, identical(frollmean(x, n, adaptive=TRUE), ama(x, n, nf.rm=TRUE)))
test(9999.166, identical(frollmean(x, n, algo="exact", adaptive=TRUE), ama(x, n)))
test(9999.167, identical(frollmean(x, n, adaptive=TRUE), ama(x, n, nf.rm=TRUE)))
test(9999.168, identical(frollmean(x, n, algo="exact", adaptive=TRUE), ama(x, n)))
test(9999.169, identical(frollmean(x, n, adaptive=TRUE), ama(x, n, nf.rm=TRUE)))
test(9999.170, identical(frollmean(x, n, algo="exact", adaptive=TRUE), ama(x, n)))

Activity

  1. added this to the 1.12.2 milestone on Feb 7, 2019
  2. jangorecki commented on Feb 8, 2019

    @jangorecki
    Member

    There are two cases where identical is being used.

    • algo="exact" - testing rounding error correction and testing NaN-NA consistency - I don't think we should change that to all.equal, as those features will not be tested anymore.
    • algo="fast" testing against base R using nf.rm=TRUE (non-finite replace to NA) - the assumption of algo="fast" is that we treat non-finite values as NA, changing that to all.equal would not let us to test that assumption.

    R-exts you quoted is sounds convincing, but still would be useful to test those features, if possible, and on most platforms should be possible.


    After some off-gh discussion I tend to agree it is better to align to R-exts/CRAN recommendations to avoid extra loops in adjusting platform/compiler specifics. PR is ready.

  3. added a commit that references this issue on Feb 9, 2019
    2cadaea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions