PredictiveEcology/SpaDES.core: v0.1.1
Authors/Creators
- 1. Canadian Forest Service, Government of Canada
Description
Known issues: https://github.com/PredictiveEcology/SpaDES.core/issues
version 0.1.1- uses reproducible::Require instead of SpaDES.core::loadPackages to load required packages. Currently, does not use version control for packages, but does use installing (from CRAN or GitHub), and loading (via require). This means a module can indicate a github package, e.g,.
achubaty/amc@development environments in modules are now as follows:
- Functions defined in a module are sourced into an environment located here:
sim@.envir$<moduleName>, and it is a is a child ofsim@.envir. Functions can be found in this environment, but prefixing functions is not necessary, because modules functions are within this environment already. sim@.enviris a child ofSpaDES.core
- Functions defined in a module are sourced into an environment located here:
scoping from within a function that is defined in a module is thus:
sim@.envir$<moduleName>-->sim@.envir-->SpaDES.core--> all imported packages includingbase-->.GlobalEnv-->search()
speed improvements:
- the core DES is now built around lists, rather than data.table. For small objects (e.g., the eventQueue) that have fewer than 200 objects, lists are faster. Accessors (e.g.,
events(sim),completed(sim)) of the event queues still showdata.tableobjects, but these are made on the fly. .parseModuleand.parseModuePartialnow put their parsed content into a temporary environment (sim@.envir$.parsedFiles$<Full Filename>)during thesimInit, which gets re-used. Previously, files were parsed multiple times in a givensimInitcall. Several functions now haveenvirargument to pass this through (includingmoduleVersion,packages,checkParams)
- the core DES is now built around lists, rather than data.table. For small objects (e.g., the eventQueue) that have fewer than 200 objects, lists are faster. Accessors (e.g.,
parsing of modules is now more intelligent, allowing for modules to contain functions (the current norm) and but they can also create objects at the module level. These can use the sim object in their definition. These objects can, for example, be used to help define parameters, for example, e.g.,
startSimPlus1 <- start(sim) + 1can be defined in the module and used indefineModule- remove
grDevicesfrom Imports as it was not used (#1) - remove
chronandCircStatsdependencies - remove functions
dwrpnorm2and move to packageSpaDES.tools - remove unused function
F()due to conflicts withF/FALSE. - improved download of module data: added new
quickCheckargument - improved download of modules: use fuzzy matching
- new option:
spades.switchPkgNamespaceswhich allows the user to turn off theSpaDESfeature that loads and unloads libraries specific to each module. While useful, it slows down computations, in some cases, by a lot. bug fixes:
- in
zipModulethat omitted the checksum file from being included whendata = FALSE(#3) - caching of
.inputObjectsfunctions was evaluating outputObjects instead of inputObjects. Now corrected.
- in
If
.inputObjectscontains arguments other than just sim, these will be evaluated as function inputs by the Cache mechanism (via .useCache), therefore correctly assessing when those inputs changed, e.g., if they are files and the arg is wrapped inasPath, then any change to the underlying file will cause a re-cache. e.g.,.inputObjects <- function(sim, importantFile = asPath(file.path(inputPath(sim), "theFile.rdata"))) { ... }- default
debugoption inspades()now uses the package optionspades.debugand default is set toFALSE(#5) - various other speed improvements and bug fixes
- convert
Pto a function, rather than S4 generic and method, for speed. - importFrom only used functions from
utilsdue to name conflicts withraster::stackandutils::stack - new function
remoteFileSizeto check the size of remote files - new namespaced function
dataPathwill returnfile.path(modulePath(sim), currentModule(sim), "data"), which will return a different path, depending on which module it is placed inside. - add crayon to imports -- now messages are more colour coded
- bug fix in 'inputs' for the case of loading objects from the global environment, either from the same object to the same object, or from different global objects overwriting on the same simList object
Files
PredictiveEcology/SpaDES.core-v0.1.1.zip
Files
(2.4 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:afce604ded482a0eb5e9dac35aec2996
|
2.4 MB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/PredictiveEcology/SpaDES.core/tree/v0.1.1 (URL)