Skip to content

Commit

Permalink
Merge pull request #260 from grunwaldlab/seedless
Browse files Browse the repository at this point in the history
do not accidentally set seed on package load
  • Loading branch information
zkamvar authored Mar 15, 2024
2 parents 2ae5741 + 66dc031 commit 6c1a993
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.9.5
Date: 2024-01-15 13:20:49 UTC
SHA: 963d5f60cda1447ce150d78c12c2cd2d38f58d80
Version: 2.9.6
Date: 2024-03-15 16:50:51 UTC
SHA: ef69ace403850e8149c4c1728de6190d36195bd3
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: poppr
Type: Package
Title: Genetic Analysis of Populations with Mixed Reproduction
Version: 2.9.5
Version: 2.9.6
Authors@R: c(person(c("Zhian", "N."), "Kamvar", role = c("cre", "aut"),
email = "zkamvar@gmail.com", comment = c(ORCID = "0000-0003-1458-7108")),
person(c("Javier", "F."), "Tabima", role = "aut",
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
poppr 2.9.6

MISC
----

* Poppr itself will no longer accidentally modify the random seed when it is
attached (found by @timtaylor,
https://github.com/grunwaldlab/poppr/issues/259)

poppr 2.9.5
===========

Expand Down
10 changes: 6 additions & 4 deletions R/zzz.r
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@
paralltype <- ifelse(poppr::poppr_has_parallel(), "available", "unavailable")
startupmsg <- paste0(startupmsg, "\nOMP parallel support: ", paralltype, appendix)
packageStartupMessage(startupmsg)
if (!interactive() || stats::runif(1) > 0.1) return()
if (!interactive()) return()

msec <- floor(as.POSIXlt(Sys.time())$sec*1000)
if (msec %% 10 > 0) return()

tips <- c(
"\nNeed help? Try the poppr mailing list: http://groups.google.com/d/forum/poppr.\n",
"\nUse suppressPackageStartupMessages(library(\"poppr\")) to eliminate package startup messages.\n"
)

tip <- sample(tips, 1)
packageStartupMessage(tip)
msec <- floor(as.POSIXlt(Sys.time())$sec*1000)
packageStartupMessage(tips[1 + (msec %% length(n))])
}

.onLoad <- function(...){
Expand Down

0 comments on commit 6c1a993

Please sign in to comment.