Skip to content
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 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: gen3sis
Type: Package
Title: General Engine for Eco-Evolutionary Simulations
Version: 1.5.11
Version: 1.5.15
Date: 2023-11-21
Authors@R: c(
person("ETH Zürich", role=c("cph")),
Expand Down
2 changes: 1 addition & 1 deletion R/simulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ setup_distance_matrix <- function(config, data, vars) {
update_extinction_times <- function(config, data, vars) {
for (sp in data$all_species) {
if(length(sp[["abundance"]])) {
data$phy$"Extinction.Time"[as.integer(sp[["id"]])] <- vars$ti
data$phy$"Extinction.Time"[as.integer(sp[["id"]])] <- vars$ti - 1
}
}
return(list(config = config, data = data, vars = vars))
Expand Down
9 changes: 7 additions & 2 deletions R/skeleton_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
# empty skeleton config
# internal helper: returns a single compiled string used by write_config_skeleton()

#' create a skeleton config string from scratch
#' @details create a skeleton config string from scratch
#'
#' @return a string containing the skeleton config
#' @noRd
skeleton_config <- function(){
paste0(c('
paste0(c('
######################################
### METADATA ###
######################################
Expand All @@ -15,7 +20,7 @@ paste0(c('
# Version: 1.0
#
# Author:
#', paste0("# Date: ", format(Sys.Date(), format="%d.%m.%Y")),
# ', paste0("# Date: ", format(Sys.Date(), format="%d.%m.%Y")),
'#
# Landscape:
#
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/CaseStudy1/reference_saves/phy.nex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#NEXUS
begin trees;
Tree tree = (((species1:5,species4:1):0,species3:5):0,species2:2):0;
Tree tree = (((species1:5,species4:2):0,species3:5):0,species2:3):0;
end;
[!Tree generated with the gen3sis R package, following convention of TreeSim and TreeSimGM r-packages]
Binary file modified inst/extdata/CaseStudy1/reference_saves/sgen3sis_summary.rds
Binary file not shown.
11 changes: 0 additions & 11 deletions man/skeleton_config.Rd

This file was deleted.

1 change: 1 addition & 0 deletions tests/testthat/test-gen3sis_main.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ test_that("run_simulation works", {
ref_summary <- readRDS(file.path(datapath, "reference_saves", "sgen3sis_summary.rds"))
expect_true(all.equal(ref_summary, s$summary))
expect_true(tools::md5sum(file.path(s$parameters$directories$output, "phy.nex")) == tools::md5sum(file.path(datapath, "reference_saves", "phy.nex")))
expect_true(tools::md5sum(file.path(s$parameters$directories$output, "phy.txt")) == tools::md5sum(file.path(datapath, "reference_saves", "phy.txt")))
})
Loading