DOI-USGS / loadflex

Models and Tools for Watershed Flux Estimates
http://dx.doi.org/10.1890/ES14-00517.1
Other
14 stars 17 forks source link

create reusable, minimal example objects #214

Closed aappling-usgs closed 7 years ago

aappling-usgs commented 7 years ago

Create reusable, minimal example objects (resolves #209)

aappling-usgs commented 7 years ago

Note that the travis issue is nearly identical to issues raised in the build of rloadest, as at https://travis-ci.org/USGS-R/rloadest/jobs/258615900#L4002:

*** caught segfault ***
address 0x3, cause 'memory not mapped'
Traceback:
 1: .Fortran("evalaml", NOBSC = as.integer(NOBSC), NPAR = as.integer(NPAR),     XLCAL = as.matrix(X), YLCAL = Y@.Data[, 1L], YD = Y@.Data[,         2L], CENSFLAG = Y@censor.codes, PARMLE = double(NPAR +         1L), PARAML = double(NPAR + 1L), BIAS = double(NPAR +         1L), CV = matrix(0, NPAR + 1L, NPAR + 1L), SBIAS = double(NPAR +         1L), SCV = matrix(0, NPAR + 1L, NPAR + 1L), STDDEV = double(NPAR +         1L), PVAL = double(NPAR + 1L), COV = matrix(0, NPAR +         1L, NPAR + 1L), RESID = double(NOBSC), RSQ = double(1L),     LLR = double(1L), SCORR = double(1L), LLRAML = double(1L),     PLEVAML = double(1L), DF = integer(1L), LogNorm = dist ==         "lognormal", YPRED = double(NOBSC), AIC = double(1L),     SPPC = double(1L), IERR = integer(1L))
 2: censReg_AMLE.fit(Y, X, "lognormal")
 3: loadReg(Phosphorus ~ model(1), data = app1.calib, flow = "FLOW",     dates = "DATES", conc.units = "mg/L", station = "Illinois River at Marseilles, Ill.")
 4: eval(expr, .GlobalEnv)
 5: eval(expr, .GlobalEnv)
 6: withVisible(eval(expr, .GlobalEnv))
 7: doTryCatch(return(expr), name, parentenv, handler)
 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 9: tryCatchList(expr, classes, parentenv, handlers)
10: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <- conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
11: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
12: evalFunc(ce, options)
13: tryCatchList(expr, classes, parentenv, handlers)
14: tryCatch(evalFunc(ce, options), finally = {    cat("\n")    sink()})
15: driver$runcode(drobj, chunk, chunkopts)
16: utils::Sweave(...)
17: engine$weave(file, quiet = quiet, encoding = enc)
18: doTryCatch(return(expr), name, parentenv, handler)
19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
20: tryCatchList(expr, classes, parentenv, handlers)
21: tryCatch({    engine$weave(file, quiet = quiet, encoding = enc)    setwd(startdir)    find_vignette_product(name, by = "weave", engine = engine)}, error = function(e) {    stop(gettextf("processing vignette '%s' failed with diagnostics:\n%s",         file, conditionMessage(e)), domain = NA, call. = FALSE)})
22: tools::buildVignettes(dir = ".", tangle = TRUE)
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault (core dumped)
aappling-usgs commented 7 years ago

I used :point_up: as an opportunity to add a test to rloadest to document the problem, but I don't expect to fix the rloadest segfault on Travis/Linux anytime soon and would rather keep that test in the package. So @wdwatkins , when you think the code changes make sense, I'm comfortable merging even though travis is failing.