pik-piam / madrat

R package | May All Data be Reproducible and Transparent (MADRaT)
https://cran.r-project.org/web/packages/madrat/index.html
Other
14 stars 37 forks source link

prepExtendedComment() breaks REMIND input data generation #226

Open 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q opened 1 week ago

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q commented 1 week ago

See /p/tmp/lavinia/MO/REMIND_pre-processing/pre-processing/log-2024-11-04-1388968.out:

<callr_error/rlib_error_3_0/rlib_error/error>
Error: 
! in callr subprocess.
Caused by error in `get(as.character(cl[[1]]), mode = "function", sys.frame(-n - …`:
! object 'readSource' of mode 'function' was not found
Subprocess backtrace:
 1. base::do.call(madrat::retrieveData, c(cfg$args, list(renv = FALSE)))
 2. (function (model, rev = 0, dev = "", cachetype = "def", puc = identical(de…
 3. withr::with_dir(outputfolder, { …
 4. base::force(code)
 5. madrat:::withMadratLogging(do.call(cfg$functionCode, cfg$fullNow))
 6. base::withCallingHandlers(expr, message = messageHandler, warning = warningHandl…
 7. base::do.call(cfg$functionCode, cfg$fullNow)
 8. (function () …
 9. madrat::calcOutput(type = "Steel_Projections", subtype = "secondary.steel.max.shar… at fullREMIND.R:37:3
10. readSource(type = "ExpertGuess", subtype = "Chinese_Steel_Production", … at fullREMIND.R:37:3
11. quitte::madrat_mule(.)
12. madrat::readSource(type = "ExpertGuess", subtype = "Chinese_Steel_Production", … at madrat_mule.R:24:5
13. local .getData(type, subtype, subset, args, prefix)
14. madrat:::prepExtendedComment(xList, type, n = 2, warn = FALSE)
15. base::get(as.character(cl[[1]]), mode = "function", sys.frame(-n - …
16. base::.handleSimpleError(function (e) …
17. global h(simpleError(msg, call))
Error: retrieveData stopped due to an error. Search the logfile for 'Error'
Execution halted
LaviniaBaumstark commented 3 days ago

@tscheypidi it is still an issue for REMIND input data generation. Could you or @pascal-sauer please have a look? Thanks

pascal-sauer commented 3 days ago

229 might fix this. I was able to reproduce a related but different error like this:

library(mrremind)
madrat::setConfig(ignorecache = TRUE)
madrat::readSource(type = "ExpertGuess", subtype = "Chinese_Steel_Production", convert = FALSE)

this produces

Error in `get()`:
! first argument has length > 1

The PR fixes that. However, in the log we have

! object 'readSource' of mode 'function' was not found

Do you have a reproducible example for that?

pascal-sauer commented 3 days ago

I just realized the github action produces the error from the log when running my new test, so that is a hint :thinking:

pascal-sauer commented 3 days ago

I can reproduce the error from the log by simply running madrat:::testPrepExtendedComment() with my new madrat version :+1:

pascal-sauer commented 2 days ago

@LaviniaBaumstark or @0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q could you please check if the madrat version on my fork fixes the problem here? I'd merge the PR if it actually helped.