PredictiveEcology / CBM_core

Other
0 stars 2 forks source link

replace current check of other modules run with suggestModule() package function #8

Open cboisvenue opened 3 years ago

cboisvenue commented 3 years ago

Eliot and Celine built a function is intended to check in certain modules were run before the current module. Not sure where with function went (suggestModule()) in the SpaDES world, but it needs to replace line 270-281 in the CBM_core.R.

cboisvenue commented 3 years ago
  io <- inputObjects(sim, currentModule(sim))
  objectNamesExpected <- io$objectName
  available <- objectNamesExpected %in% ls(sim)
  if (any(!available)) {
    stop(
      "The inputObjects for CBM_core are not all available:",
      "These are missing:", paste(objectNamesExpected[!available], collapse = ", "),
      ". \n\nHave you run ",
      paste0("spadesCBM", c("defaults", "inputs", "m3ToBiomass"), collapse = ", "),
      "?"
    )
  }