Conversation
kevinushey
left a comment
There was a problem hiding this comment.
Do these handle NAs? Or would these only ever be invoked for the "not NA" cases?
|
In principle, sugar functions already handle NAs, so these will be invoked for non-NA cases. But I haven't triaged all the cases yet, so we'll see. If this implementation looks good so far, I'll continue with that. |
|
BTW @eddelbuettel I don't see the sugar directory listed in Codecov. Isn't the covr workflow running all the tests? |
|
I don't think we exclude Sugar from tests or coverage. There is a specific entry point |
|
Yes, and it requires RunAllRcppTests set to yes, so I was wondering if the covr task is not setting it? |
|
BTW I was 'this month old' when I heard about the boo-boo with > Rcpp::evalCpp("std::numeric_limits<int>::min()") # normal
[1] NA
> Rcpp::evalCpp("std::numeric_limits<int>::max()") # normal
[1] 2147483647
> Rcpp::evalCpp("std::numeric_limits<int>::min() * 1.0") # also normal
[1] -2147483648
> Rcpp::evalCpp("std::numeric_limits<int>::min()") # R special
[1] NA
>
>
> Rcpp::evalCpp("std::numeric_limits<double>::min()") # WTF: positive number
[1] 2.22507e-308
> Rcpp::evalCpp("std::numeric_limits<double>::lowest()") # normal
[1] -1.79769e+308
>
> Rcpp::evalCpp("std::numeric_limits<int>::lowest()")
[1] NA
> Rcpp::evalCpp("std::numeric_limits<int>::lowest() * 1.0")
[1] -2147483648
> Mind you we are not running overflow for |
|
|
No, we are not. The overflow checks are enabled only for integral types. Because doubles do not overflow, they become |
So |
|
I validated the assumptions in |
Correct. |
I think that the coverage we see is just what calls into But anyway, this is another matter. We can discuss this further in another issue. |
|
Good thinking. Sounds like a testing / coverage package having all the tests in I never know what to of coverage. It's a metric, and as Goodhart told us decades ago, of course it is being gamed. |
Closes #1454
Work in progress.
Checklist
R CMD checkstill passes all tests