Closed diazrenata closed 1 year ago
Another one, in test_cpp_08_speciation_local_meta.R
:
test_that("update_speciation_local_meta sets the indv that was birthed or immigrated to the new species", {
# create a test model and get data from a step and the params
m <- quickModel()
d <- m@modelSteps[[1]]
p <- m@params
# duplicate the data for comparison after the call_birth method
d_start <- rlang::duplicate(d)
# update_speciation_local_meta, making the individual at dead_index 0 the new species
out <- cFun(type="data",fun_name="update_speciation_local_meta",data=d,params=p,i=1,
dead_index=0, dispersed_this_iter = TRUE,speciation_sp=0)
# compare these two - the species of the new individual should equal the number of tips (as it is the newest tip)
expect_true(d@localComm@indSpecies[1] == d@phylo@n)
})
Failure is that d@localComm@indSpecies[1]
is not equal to d@phylo@n
.
re. test_that("env filtering outputs a vector of the right length") - this was a typo, niter must have been an accident as the length of the env filtering probs should actually be compared to the number of individuals in the local community - fixed and test passes
re. test_that("update_speciation_local_meta") - this was also a typo - "out" should actually be named "d" - d the object that was check was not getting updated by the function - fixed and test passes
I also finished test_that("update_speciation_local_meta updates the species last origin step") which was unfinished and now passes.
I will close this issue but please let me know of any other weird test failures.
@jidec, can you take a look at this test failure? I am not familiar enough with the expected behavior of the C functions to know what to fix here!
From test_cpp_02_death_probs.R:
Failure is that
m@params@niter
does not equallength(out)
.Note that I changed the
niter
inquickParams
to 200 (in order to get species diversity to emerge for some of the tests).Thanks!