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

Rename subregions [patch] #111

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,528 changes: 1,264 additions & 1,264 deletions Counts/maxcounts_under40.csv

Large diffs are not rendered by default.

606 changes: 303 additions & 303 deletions SiteandMethods/colonies.csv

Large diffs are not rendered by default.

Binary file modified SiteandMethods/regions/subregions.dbf
Binary file not shown.
18 changes: 9 additions & 9 deletions SiteandMethods/regions/subregions.geojson

Large diffs are not rendered by default.

Binary file modified SiteandMethods/regions/subregions.gpkg
Binary file not shown.
Binary file added SiteandMethods/regions/subregions.gpkg-shm
Binary file not shown.
Empty file.
192 changes: 96 additions & 96 deletions Water/eden_covariates.csv

Large diffs are not rendered by default.

72,378 changes: 36,189 additions & 36,189 deletions Water/eden_depth.csv

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions testthat/test-counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,39 @@ colonies <- read.csv("../SiteandMethods/colonies.csv")
species <- read.csv("../SiteandMethods/species_list.csv")
counts <- read.csv("../Counts/maxcounts.csv")
counts_cols <- colnames(counts)
counts_under40 <- read.csv("../Counts/maxcounts_under40.csv")
counts_under40_cols <- colnames(counts_under40)

test_that("required column names in counts df", {

expect_identical(counts_cols,
c("group_id","year","colony","colony_old","latitude","longitude",
"species","count","notes"))
expect_identical(counts_under40_cols,
c("group_id","year","colony","colony_old", "latitude","longitude","wca","greg",
"whib","wost","gbhe","rosp","sneg","anhi","trhe","bcnh","lbhe","ycnh","glib",
"caeg","dcco","grhe","smhe","lawh","lada","smda","smwh","notes","total"))
})

test_that("Lat and long valid", {

expect_true(all((counts$latitude <= 27 | counts$latitude > 25)))
expect_true(all((counts$longitude <= -80 | counts$longitude > -81.3)))
expect_true(all((counts_under40$latitude <= 27 | counts_under40$latitude > 25)))
expect_true(all((counts_under40$longitude <= -80 | counts_under40$longitude > -81.3)))
})

test_that("Colony and species valid", {

expect_true(all(counts$colony %in% colonies$colony))
expect_true(all(counts$species %in% species$species))
expect_true(all(counts_under40$wca %in% c(colonies$region,colonies$subregion,"3a","")))
})

test_that("Year valid", {

expect_false(any(is.na(counts$year)))
expect_false(any(is.na(counts_under40$year)))
})

test_that("Counts valid", {
Expand Down
7 changes: 7 additions & 0 deletions testthat/test-water.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ depth <- read.csv(file = "../Water/eden_depth.csv",header=T) %>%
depth_names <- colnames(depth)
covariates <- read.csv(file = "../Water/eden_covariates.csv",header=T)
covariates_names <- colnames(covariates)
colonies <- read.csv("../SiteandMethods/colonies.csv")

test_that("required column names in new water df", {

Expand All @@ -15,6 +16,12 @@ test_that("required column names in new water df", {
"pre_recession","post_recession","dry_days","reversals"))
})

test_that("Subregions valid", {

expect_true(all(depth$region %in% c(colonies$subregion,"all","wcas","enp")))
expect_true(all(covariates$region %in% c(colonies$subregion,"all","wcas","enp")))
})

test_that("Dates valid", {

expect_false(any(is.na(depth$date)))
Expand Down
Loading