Closed SteveCumming closed 6 years ago
There is no space in the metadata to provide a custom way to do "whatever it is you need to do for every input object". Instead, there is a section in your module, a function called: .inputObjects
. In that, you can give default values, and even sophisticated default ways of downloading, unzipping, cropping, whatever.
For this latter, See development version of SpaDES.core ... prepInputs function.
Where a good strategy is:
if (is.null(sim$yourObject)) {
sim$yourObject <- somethingDefault
}
### or use prepInputs, but that is somewhat advanced at the moment
if (is.null(sim$yourObject)) {
sim$yourObject <- Cache(prepInputs, archive = ..., etc.)
}
If you don't want to set any defaults, you can ignore the Module Code Checking about that.
I see. I missed that it was so specific as to ask for a default in
All is now clear.
in my Silvertown.R, mapDim is provided only as en element in the object list, not as a parameter.
spiffyInit asks for a default value but I see no way of providing one in a expectsInput() call.
Running .inputObjects for Silvertown
Module Code Checking
Silvertown: module code: mapDim is declared in inputObjects, but no default(s) is provided in .inputObjects
Module Code Checking