Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zoonproject/zoon
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.6.4
Choose a base ref
...
head repository: zoonproject/zoon
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 12 commits
  • 10 files changed
  • 1 contributor

Commits on Nov 14, 2019

  1. Fixes to CRAN issues:

    - Remotes removed from description
    - packageVersion added to NAMESPACE
    AugustT committed Nov 14, 2019
    Copy the full SHA
    3ff8856 View commit details

Commits on Feb 10, 2020

  1. Updates to address the archiving of SDMTools. This packaged is moved …

    …to suggests, tests that use it are skipped if it is not installed
    AugustT committed Feb 10, 2020
    3
    Copy the full SHA
    4ccd34c View commit details

Commits on Feb 21, 2020

  1. Date updated

    AugustT committed Feb 21, 2020
    Copy the full SHA
    a1126b3 View commit details
  2. Copy the full SHA
    8aef848 View commit details
  3. Correct typo in Description

    AugustT committed Feb 21, 2020
    Copy the full SHA
    fca171b View commit details

Commits on Feb 24, 2020

  1. Copy the full SHA
    deaf304 View commit details
  2. Mix typo in Description

    AugustT committed Feb 24, 2020
    Copy the full SHA
    7d510c5 View commit details
  3. Copy the full SHA
    ce1a3ac View commit details
  4. Corect SDMtools > SDMTools

    AugustT committed Feb 24, 2020
    Copy the full SHA
    a9858df View commit details

Commits on Feb 26, 2020

  1. 1
    Copy the full SHA
    b337cee View commit details

Commits on Feb 27, 2020

  1. Copy the full SHA
    6958fe6 View commit details

Commits on Feb 28, 2020

  1. enclose URL in "<>"

    AugustT committed Feb 28, 2020
    Copy the full SHA
    4f31c0a View commit details
Showing with 198 additions and 163 deletions.
  1. +1 −0 .travis.yml
  2. +14 −9 DESCRIPTION
  3. +1 −2 NAMESPACE
  4. +1 −0 R/ZoonModuleParse.R
  5. +114 −101 R/test_outputs.R
  6. +44 −39 tests/testthat/testChangeWorkflow.R
  7. +3 −0 tests/testthat/testcall_path.R
  8. +3 −0 tests/testthat/testsummary.zoonWorkflow.R
  9. +14 −10 tests/testthat/testtestModule.R
  10. +3 −2 zoon_package.Rproj
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ r_packages:
r_github_packages:
- rstudio/rmarkdown
- hadley/pkgdown
- cran/SDMTools

## After success update the code coverage and deploy the pkgdown to gh-pages
after_success:
23 changes: 14 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
Package: zoon
Type: Package
Title: Reproducible, Accessible & Shareable Species Distribution Modelling
Version: 0.6.4
Date: 2019-11-13
Version: 0.6.5
Date: 2020-02-27
Authors@R: c(person("Tom", "August", role = c("aut", "cre"),
email = "tomaug@ceh.ac.uk"),
person("Tim", "Lucas", role = "aut", comment = c(ORCID = "0000-0003-4694-8107")),
person("Nick", "Golding", role = "aut"),
person("Emiel", "van Loon", role = "ctb"),
person("Greg", "McInerny", role = "aut"))
Maintainer: Tom August <tomaug@ceh.ac.uk>
Description: Reproducible and remixable species distribution modelling. The
package reads user submitted modules from an online repository, runs full
SDM workflows and returns output that is fully reproducible.
Description: Reproducible and remixable species distribution modelling.
The package reads user submitted modules from an online repository, runs
full species distribution modelling workflows and returns output that is
fully reproducible. For examples and detailed discussion refer to: N.Golding
et al. (2017) 'The zoon r package for reproducible and shareable species
distribution modelling'. Methods in Ecology and Evolution.
<doi:10.1111/2041-210X.12858>. The package 'SDMTools' is used for testing
and, though this package is archived, you can access it here if
needed, <https://cran.r-project.org/src/contrib/Archive/SDMTools/>.
License: BSD_3_clause + file LICENSE
Imports:
dismo,
@@ -24,18 +30,17 @@ Imports:
rgdal,
roxygen2,
rworldmap,
SDMTools,
sp,
testthat
Remotes: cran/rgdal@1.3-9
Depends:
raster (>= 2.4-20),
R (>= 3.2.0)
Suggests:
knitr,
maxlike
maxlike,
SDMTools
VignetteBuilder: knitr
LazyData: TRUE
URL: https://github.com/zoonproject/zoon
BugReports: https://github.com/zoonproject/zoon/issues
RoxygenNote: 7.0.0
RoxygenNote: 7.0.2
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -45,8 +45,6 @@ import(sp)
import(testthat)
importFrom(RCurl,getURL)
importFrom(RCurl,url.exists)
importFrom(SDMTools,auc)
importFrom(SDMTools,confusion.matrix)
importFrom(grDevices,dev.off)
importFrom(grDevices,grey)
importFrom(grDevices,png)
@@ -65,4 +63,5 @@ importFrom(utils,download.file)
importFrom(utils,install.packages)
importFrom(utils,installed.packages)
importFrom(utils,methods)
importFrom(utils,packageVersion)
importFrom(utils,sessionInfo)
1 change: 1 addition & 0 deletions R/ZoonModuleParse.R
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
#' @name ZoonModuleParse
#' @export
#' @import roxygen2
#' @importFrom utils packageVersion


ZoonModuleParse <- function(modulePath) {
215 changes: 114 additions & 101 deletions R/test_outputs.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#' @importFrom SDMTools auc confusion.matrix
#' @import randomForest
#'
# A function for testing the outputs conform to the expected
@@ -171,36 +170,38 @@ test_occurrence_outputs <- function (roxy_parse, modulePath, en) {
"when chained in a workflow")
)


# test list + crossvalidation
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = list(
OccurrenceModule,
OccurrenceModule
),
covariate = NaiveRandomRaster(
extent = myExtent,
res = 0.5,
seed = 123
),
process = BackgroundAndCrossvalid,
model = LogisticRegression,
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "OccurrenceModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)

expect_is(
w, "zoonWorkflow",
info = paste("The occurrence module did not work",
"when listed in a workflow with crossvalidation")
)
SDMTools_check <- requireNamespace('SDMTools', quietly = TRUE)
if(SDMTools_check){
# test list + crossvalidation
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = list(
OccurrenceModule,
OccurrenceModule
),
covariate = NaiveRandomRaster(
extent = myExtent,
res = 0.5,
seed = 123
),
process = BackgroundAndCrossvalid,
model = LogisticRegression,
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "OccurrenceModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)

expect_is(
w, "zoonWorkflow",
info = paste("The occurrence module did not work",
"when listed in a workflow with crossvalidation")
)
}
} else if (data_type == "presence/absence") {

# test normal
@@ -259,35 +260,39 @@ test_occurrence_outputs <- function (roxy_parse, modulePath, en) {
"when chained in a workflow")
)

# test list + crossvalidation
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = list(
OccurrenceModule,
OccurrenceModule
),
covariate = NaiveRandomRaster(
extent = myExtent,
res = 0.5,
seed = 123
),
process = Crossvalidate,
model = LogisticRegression,
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "OccurrenceModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)

expect_is(
w, "zoonWorkflow",
info = paste("The occurrence module did not work",
"when listed in a workflow with crossvalidation")
)
SDMTools_check <- requireNamespace('SDMTools', quietly = TRUE)
if(SDMTools_check){

# test list + crossvalidation
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = list(
OccurrenceModule,
OccurrenceModule
),
covariate = NaiveRandomRaster(
extent = myExtent,
res = 0.5,
seed = 123
),
process = Crossvalidate,
model = LogisticRegression,
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "OccurrenceModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)

expect_is(
w, "zoonWorkflow",
info = paste("The occurrence module did not work",
"when listed in a workflow with crossvalidation")
)
}
} ## Add tests for proportion and abundance ##
}
}
@@ -987,28 +992,32 @@ test_model_outputs <- function (roxy_parse, modulePath, en) {
info = "The model module did not work in a list workflow"
)

# crossvalidate
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = NaiveRandomPresenceAbsence(n = 1000,
seed = 123),
covariate = NaiveRandomRaster,
process = Crossvalidate,
model = list(ModelModule, ModelModule),
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "ModelModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)
SDMTools_check <- requireNamespace('SDMTools', quietly = TRUE)
if(SDMTools_check){

expect_is(
w, "zoonWorkflow",
info = paste("The process module did not work in a",
"crossvalidation workflow"))
# crossvalidate
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = NaiveRandomPresenceAbsence(n = 1000,
seed = 123),
covariate = NaiveRandomRaster,
process = Crossvalidate,
model = list(ModelModule, ModelModule),
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "ModelModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)

expect_is(
w, "zoonWorkflow",
info = paste("The process module did not work in a",
"crossvalidation workflow"))
}

} else if (data_type == "presence/background") {

@@ -1081,26 +1090,30 @@ test_model_outputs <- function (roxy_parse, modulePath, en) {
info = "The model module did not work in a list workflow"
)

# crossvalidate
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = UKAnophelesPlumbeus,
covariate = UKAir,
process = Chain(Background(n = 70), Crossvalidate),
model = ModelModule,
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "ModelModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)

expect_is(w, "zoonWorkflow",
info = paste("The model module did not work",
"in a crossvalidation workflow"))
SDMTools_check <- requireNamespace('SDMTools', quietly = TRUE)
if(SDMTools_check){

# crossvalidate
w <- tryCatchWorkflow(
expr = {
w <- workflow(
occurrence = UKAnophelesPlumbeus,
covariate = UKAir,
process = Chain(Background(n = 70), Crossvalidate),
model = ModelModule,
output = PerformanceMeasures,
forceReproducible = FALSE
)
},
placeholder = "ModelModule",
fun = roxy_parse$name
)
if (inherits(w, what = "moduleError")) stop(w)

expect_is(w, "zoonWorkflow",
info = paste("The model module did not work",
"in a crossvalidation workflow"))
}
}
}
}
Loading