Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not accidentally set seed on package load #260

Merged
merged 2 commits into from
Mar 15, 2024
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
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 = "[email protected]", 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
Loading