Skip to content
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

Quick assessment of objects missing and suggest which other modules might be useful #130

Open
cboisvenue opened this issue Sep 24, 2020 · 1 comment

Comments

@cboisvenue
Copy link

Working with @eliotmcintire , this is likely a useful function:

suggestModules <- function(sim, suggestedModules) {
io <- inputObjects(sim, currentModule(sim))
  objectNamesExpected <- io$objectName
  available <- objectNamesExpected %in% ls(sim)
  if (any(!available)) stop("The inputObjects for spadesCBMcore are not all available:",
                            "These are missing:", paste(objectNamesExpected[!available], collapse = ", "),
                            ". \n\nHave you run ", 
                            suggestedModules,
                            "?")
}
@achubaty
Copy link
Contributor

suggestModules <- function(sim, suggestedModules) {
  io <- inputObjects(sim, currentModule(sim))
  objectNamesExpected <- io$objectName
  available <- objectNamesExpected %in% ls(sim)
  if (any(!available))
    stop("The inputObjects for ", currentModule(sim), " are not all available:",
         "These are missing:", paste(objectNamesExpected[!available], collapse = ", "),
         ". \n\nHave you run ",  suggestedModules, "?")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants