Skip to content

Commit ef69ace

Browse files
committed
do not accidentally set seed on package load.
1 parent 2ae5741 commit ef69ace

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: poppr
22
Type: Package
33
Title: Genetic Analysis of Populations with Mixed Reproduction
4-
Version: 2.9.5
4+
Version: 2.9.6
55
Authors@R: c(person(c("Zhian", "N."), "Kamvar", role = c("cre", "aut"),
66
email = "zkamvar@gmail.com", comment = c(ORCID = "0000-0003-1458-7108")),
77
person(c("Javier", "F."), "Tabima", role = "aut",

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
poppr 2.9.6
2+
3+
MISC
4+
----
5+
6+
* Poppr itself will no longer accidentally modify the random seed when it is
7+
attached (found by @timtaylor,
8+
https://github.com/grunwaldlab/poppr/issues/259)
9+
110
poppr 2.9.5
211
===========
312

R/zzz.r

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@
5454
paralltype <- ifelse(poppr::poppr_has_parallel(), "available", "unavailable")
5555
startupmsg <- paste0(startupmsg, "\nOMP parallel support: ", paralltype, appendix)
5656
packageStartupMessage(startupmsg)
57-
if (!interactive() || stats::runif(1) > 0.1) return()
57+
if (!interactive()) return()
58+
59+
msec <- floor(as.POSIXlt(Sys.time())$sec*1000)
60+
if (msec %% 10 > 0) return()
5861

5962
tips <- c(
6063
"\nNeed help? Try the poppr mailing list: http://groups.google.com/d/forum/poppr.\n",
6164
"\nUse suppressPackageStartupMessages(library(\"poppr\")) to eliminate package startup messages.\n"
6265
)
63-
64-
tip <- sample(tips, 1)
65-
packageStartupMessage(tip)
66+
msec <- floor(as.POSIXlt(Sys.time())$sec*1000)
67+
packageStartupMessage(tips[1 + (msec %% length(n))])
6668
}
6769

6870
.onLoad <- function(...){

0 commit comments

Comments
 (0)