From ef69ace403850e8149c4c1728de6190d36195bd3 Mon Sep 17 00:00:00 2001 From: "Zhian N. Kamvar" Date: Wed, 13 Mar 2024 11:02:54 -0700 Subject: [PATCH 1/2] do not accidentally set seed on package load. --- DESCRIPTION | 2 +- NEWS.md | 9 +++++++++ R/zzz.r | 10 ++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f06d77ad..738d0008 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", diff --git a/NEWS.md b/NEWS.md index 40f30d6f..442fcd69 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 =========== diff --git a/R/zzz.r b/R/zzz.r index c8500bc9..98b1c1e1 100644 --- a/R/zzz.r +++ b/R/zzz.r @@ -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(...){ From 66dc03113ffc97d373b0b17cb66d96fb827ccc10 Mon Sep 17 00:00:00 2001 From: "Zhian N. Kamvar" Date: Fri, 15 Mar 2024 09:53:39 -0700 Subject: [PATCH 2/2] submit to cran --- CRAN-SUBMISSION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 4508be73..4485a617 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -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