-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revdep scoringutils (.optmean) errors after non-ascii by fix #6284
Comments
@MichaelChirico can you please try to figure this one out? |
Filed epiforecasts/scoringutils#862 With that PR (and epiforecasts/scoringutils#863 and epiforecasts/scoringutils#864, which are unrelated to data.table per se), I get a clean Note that it's nothing to do with #4711, so something seems wrong with the bisect logic there, otherwise we're seeing issues already fixed in the dev version of {scoringutils} |
thanks! from epiforecasts/scoringutils#862 it looks like the fix was an updated expectation in a test. |
yes the two versions of scoringutils give different check results with data.table dev (there is no issue with revdep bisect)
|
in scoringutils CRAN version, the error occurs here scores <- scores[, lapply(.SD, base::mean, ...),
by = c(unique(c(forecast_unit, by))),
.SDcols = colnames(scores) %like% cols_to_summarise
] Traceback is > traceback()
6: startsWith(names(expr)[3L], "na")
5: FUN(X[[i]], ...)
4: lapply(jsub[w], .optmean)
3: `[.data.table`(scores, , lapply(.SD, base::mean, ...), by = c(unique(c(forecast_unit,
by))), .SDcols = colnames(scores) %like% cols_to_summarise) at summarise_scores.R#146
2: scores[, lapply(.SD, base::mean, ...), by = c(unique(c(forecast_unit,
by))), .SDcols = colnames(scores) %like% cols_to_summarise] at summarise_scores.R#146
1: summarise_scores(scores) The startsWith call comes from this function in data.table.R .optmean = function(expr) { # called by optimization of j inside [.data.table only. Outside for a small speed advantage.
if (length(expr)==2L) # no parameters passed to mean, so defaults of trim=0 and na.rm=FALSE
return(call(".External",quote(Cfastmean),expr[[2L]], FALSE))
# return(call(".Internal",expr)) # slightly faster than .External, but R now blocks .Internal in coerce.c from apx Sep 2012
if (length(expr)==3L && startsWith(names(expr)[3L], "na")) # one parameter passed to mean()
return(call(".External",quote(Cfastmean),expr[[2L]], expr[[3L]])) # faster than .Call
assign("nomeanopt",TRUE,parent.frame())
expr # e.g. trim is not optimized, just na.rm
} |
ok, #6232 makes sense as the culprit since our version of startsWith was removed in that PR, and startsWith caused the error in the revdep. |
could it have something to do with changing %iscall% in #4711 ? 40758c9#diff-60bef5af43a1bd541299ce9bceeb226afb23deaa5e637b145c85e05ffd552b0cR152 |
I suppose it's possible downstream code wound up in a different branch due to the change, where before #4711 |
Informed downstream that we'll release in August & to expect a required CRAN update (their dev version is already fixed); closing here. |
#4711 broke revdep scoringutils https://rcdata.nau.edu/genomic-ml/data.table-revdeps/analyze/2024-07-16/
The text was updated successfully, but these errors were encountered: