Skip to content

Commit

Permalink
version 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
japilo committed Sep 19, 2024
1 parent a757d1f commit e30c7ed
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: poems
Type: Package
Title: Pattern-Oriented Ensemble Modeling System
Version: 1.3.0
Version: 1.3.1
Authors@R: c(
person("Sean", "Haythorne", email = "[email protected]", role = "aut"),
person("Damien", "Fordham", email = "[email protected]", role = "aut"),
Expand All @@ -22,14 +22,14 @@ Imports:
abc (>= 2.1),
doParallel (>= 1.0.16),
foreach (>= 1.5.1),
geosphere (>= 1.5.10),
fossil (>= 0.4.0),
lhs (>= 1.1.1),
metRology (>= 0.9.28.1),
R6 (>= 2.5.0),
raster (>= 3.6),
trend (>= 1.1.4),
truncnorm (>= 1.0),
gdistance,
qs
Collate:
'GenericClass.R'
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ importFrom(doParallel,registerDoParallel)
importFrom(doParallel,stopImplicitCluster)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(fossil,earth.dist)
importFrom(gdistance,costDistance)
importFrom(gdistance,geoCorrection)
importFrom(gdistance,transition)
importFrom(fossil,earth.dist)
importFrom(lhs,randomLHS)
importFrom(metRology,qtri)
importFrom(qs,qread)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# version 1.3.1

## Bug fixes
- `poems` no longer depends on `geosphere`. I am hopeful that this will clear up the test failures on CRAN's m1mac.

# version 1.3.0

Every update is an enhancement this time around:
Expand Down
6 changes: 3 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
## Test environments
* local macOS (13.5) install, Intel chip, R 4.3.3
* local macOS 15 install, Intel chip, R 4.4.1
* Windows, R-devel (via win-builder)
* macOS, Apple Silicon chip, R 4.3.3 (via mac-builder)
* macOS, Apple Silicon chip, R 4.4.1 (via mac-builder)

## R CMD check results

0 ERRORs, 0 WARNINGs, 1 NOTE.

## Past R CMD check results

Previously, `poems` was archived due to some tests failing on certain Apple Silicon systems due to a dependency on `geosphere`. We have revised those tests so they will pass on Apple Silicon. Tests on CRAN's mac-builder are passing.
Previously, `poems` was archived due to some tests failing on certain Apple Silicon systems due to a dependency on `geosphere`. We have removed the dependency on `geosphere` altogether. Tests on CRAN's mac-builder are passing.

`poems` has also been turned away from CRAN due to long vignette runtimes. I have cut down vignette runtime to a third of what it was previously, which should hopefully solve this issue.

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test_dispersal_friction.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test_that("distance multiplier calculation errors", {
"Distance multipliers calculation requires region/coordinates to be set first"
)
# Dispersal indices incorrect or not consistent with coordinates
distance_matrix <- geosphere::distm(coordinates, coordinates, fun = geosphere::distGeo)
distance_matrix <- fossil::earth.dist(coordinates, dist = FALSE)*1000
dispersal_indices <- which(distance_matrix > 0 & distance_matrix <= 350000, arr.ind = TRUE)
colnames(dispersal_indices) <- c("target_pop", "source_pop")
dispersal_friction <- DispersalFriction$new(
Expand Down Expand Up @@ -130,7 +130,7 @@ test_that("distance multiplier calculation errors", {

test_that("distance multiplier calculations", {
coordinates <- data.frame(x = rep(1:4, 4), y = rep(1:4, each = 4))
distance_matrix <- fossil::earth.dist(coordinates) / 1000
distance_matrix <- fossil::earth.dist(coordinates, dist = FALSE)
dispersal_indices <- which(distance_matrix > 1 & distance_matrix <= 350, arr.ind = TRUE)
colnames(dispersal_indices) <- c("target_pop", "source_pop")
conductance_matrix <- array(1, c(16, 10))
Expand Down Expand Up @@ -209,7 +209,7 @@ test_that("distance multiplier calculations", {
# No conductance values uses region raster set to 1 for non-NA values
coordinates <- coordinates[-c(2, 5, 6), ] # isolate (1, 1)
region <- Region$new(coordinates = coordinates)
distance_matrix <- geosphere::distm(coordinates, coordinates, fun = geosphere::distGeo) / 1000
distance_matrix <- fossil::earth.dist(coordinates, dist = FALSE)
dispersal_indices <- which(distance_matrix > 0 & distance_matrix <= 350, arr.ind = TRUE)
colnames(dispersal_indices) <- c("target_pop", "source_pop")
dispersal_friction <- DispersalFriction$new(region = region)
Expand Down
5 changes: 2 additions & 3 deletions tests/testthat/test_dispersal_generator.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ test_that("calculate distance data with dispersal friction object", {
breaks = c(1, seq(100, 400, 20), Inf)
))
}
distance_data_changes[[2]] <- distance_data_changes[[2]][-c(13, 179), ] # > Dmax in both t = 1 and 2
for (i in c(3, 5)) { # reverse changes
distance_data_changes[[i]] <- distance_data_base[which(distance_multipliers[[i - 1]] != 1), ]
}
Expand Down Expand Up @@ -333,7 +332,7 @@ test_that("calculate dispersals with dispersal friction", {
region = region, distance_classes = seq(100, 400, 20),
proportion = 0.4, breadth = 110, max_distance = 300
)
distance_matrix <- fossil::earth.dist(coordinates, dist = F) # km
distance_matrix <- fossil::earth.dist(coordinates[-c(2, 5, 6), ], dist = F) # km
distance_matrix[which(distance_matrix < 1)] <- 0 # ensure actual zero distance for self-referenced cells
dispersal_gen$calculate_distance_data(distance_matrix = distance_matrix)
dispersal_gen$calculate_dispersals()
Expand Down Expand Up @@ -383,7 +382,7 @@ test_that("cloning and generation", {
dispersal_clone <- dispersal_gen$new_clone(breadth = 120)
expect_true(dispersal_clone$generative_requirements_satisfied()[[1]])
expect_is(dispersal_clone$dispersal_data[[1]], "data.frame") # generated
expect_equal(dim(dispersal_clone$dispersal_data[[1]]), c(228, 5))
expect_equal(dim(dispersal_clone$dispersal_data[[1]]), c(220, 5))
expect_null(dispersal_clone$error_messages)
# Generation
expect_equal(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_population_dispersal_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ test_that("density dependent dispersal", {
distance_scale = 1000,
distance_classes = seq(100, 400, 20)
)
distance_matrix <- fossil::earth.dist(coordinates, dist = F)
distance_matrix <- fossil::earth.dist(region$coordinates, dist = F)
distance_matrix[which(distance_matrix < 1)] <- 0 # ensure actual zero distance for self-referenced cells
dispersal_gen$calculate_distance_data(distance_matrix = distance_matrix)
dispersal_gen$calculate_dispersals(type = "matrix")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_spatial_correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test_that("initialization and parameter setting", {
test_that("calculate distance matrix", {
# Latitude/longitude coordinates
coordinates1 <- array(c(1:4, 4:1), c(7, 2))
distance_matrix1 <- fossil::earth.dist(coordinates, dist = FALSE)*1000
distance_matrix1 <- fossil::earth.dist(coordinates1, dist = FALSE)*1000
spatial_correlation <- SpatialCorrelation$new()
expect_error(
spatial_correlation$calculate_distance_matrix(),
Expand Down

0 comments on commit e30c7ed

Please sign in to comment.