Skip to content

Commit 0f90614

Browse files
BUG FIX: Fix RNG assertion thinko reported in #271 (#272)
* BUG FIX: Fix assertion thinko reported in #271 * NEWS bullet --------- Co-authored-by: Davis Vaughan <[email protected]>
1 parent ac71d25 commit 0f90614

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

NEWS.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# furrr (development version)
22

3+
* Fixed an issue where generating random seeds could sporadically fail (#271,
4+
@HenrikBengtsson).
5+
36
# furrr 0.3.1
47

58
* Redocumented the package with roxygen2 7.2.1 to fix invalid HTML5 issues
@@ -64,15 +67,15 @@
6467

6568
* Updated documentation examples to explicitly set the seed on the workers
6669
when random numbers are generated (#175).
67-
70+
6871
* Removed an internal call to `future:::supportsMulticore()` since it is no
6972
longer internal (#174).
7073

7174
# furrr 0.2.0
7275

7376
## Breaking changes:
7477

75-
* All furrr functions now enforce tidyverse recycling rules (for example,
78+
* All furrr functions now enforce tidyverse recycling rules (for example,
7679
between `.x` and `.y` in `future_map2()`). Previously this was mostly the
7780
case, except with size zero input. Recycling between input of size 0 and
7881
input of size >1 no longer recycles to size 0, and is instead an error.
@@ -82,9 +85,9 @@
8285
Calling `future_options()` will still work, but will trigger a once per
8386
session warning and will eventually be removed. This change was made to
8487
free up this function name in case the future package ever wants to use it.
85-
88+
8689
* In a future version of furrr, the `.progress` argument will be deprecated
87-
and removed in favor of the
90+
and removed in favor of the
8891
[progressr](https://CRAN.R-project.org/package=progressr)
8992
package. The progress bar has not yet been removed in furrr 0.2.0, however
9093
I would encourage you to please start using progressr if possible. It uses
@@ -139,15 +142,15 @@
139142

140143
* All `*_raw()` variants from purrr have been added, such as
141144
`future_map_raw()` (#122).
142-
145+
143146
* All furrr functions gained a new argument, `.env_globals`, which determines
144147
the environment in which globals for `.x` and `...` are
145148
looked up. It defaults to the caller environment, which is different than
146149
what was previously used, but should be more correct in some edge cases.
147150
Most of the time, you should not have to touch this argument. Additionally,
148151
globals for `.f` are now looked up in the function environment of `.f`
149152
(HenrikBengtsson/future.apply#62, #153).
150-
153+
151154
* The future specific global option `future.globals.maxSize` now scales with
152155
the number of elements of `.x` that get exported to each worker. This
153156
helps prevent some false positives about exporting objects that are too large,
@@ -167,7 +170,7 @@
167170

168171
* `future_invoke_map()` and its variants have been marked as retired to match
169172
`purrr::invoke_map()`.
170-
173+
171174
* The internals of furrr have been overhauled to unify the implementations of
172175
`future_map()`, `future_map2()`, `future_pmap()` and all of their variants.
173176
This should make furrr much easier to maintain going forward (#44).
@@ -182,7 +185,7 @@
182185
* future >= 1.19.1 is now required to be able to use `future::value()` instead
183186
of the soon to be deprecated `future::values()` and to access a few bug
184187
fixes (#108).
185-
188+
186189
* purrr >= 0.3.0 is now required to gain access to various new features and
187190
breaking changes. For example, `map_if()` gained an `.else` argument, which
188191
has been added to `future_map_if()`.
@@ -197,16 +200,16 @@ Features:
197200

198201
* `future_pmap_*()` functions have been added to mirror `pmap()`.
199202

200-
* The `future.*` arguments to each function have been replaced with an
203+
* The `future.*` arguments to each function have been replaced with an
201204
overarching `.options` argument. Use `future_options()` to create a set of options
202-
suitable to be passed to `.options`. This change streamlines the interface
205+
suitable to be passed to `.options`. This change streamlines the interface
203206
greatly, and simplifies documentation (#8, @hadley).
204-
207+
205208
* `future_invoke_map_*()` functions have been added to mirror `invoke_map()`.
206-
209+
207210
* More documentation and examples have been added.
208-
209-
* Added the ability to use a progress bar with `.progress = TRUE` for
211+
212+
* Added the ability to use a progress bar with `.progress = TRUE` for
210213
multicore, multiprocess, and multisession `plan()`s.
211214

212215
Bug Fixes:
@@ -217,4 +220,4 @@ Bug Fixes:
217220

218221
# furrr 0.0.0
219222

220-
* Original GitHub release of `furrr` on 2018-04-13.
223+
* Original GitHub release of `furrr` on 2018-04-13.

R/seed.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ next_random_seed <- function(seed = get_random_seed()) {
6767
sample.int(n = 1L, size = 1L, replace = FALSE)
6868
seed_next <- get_random_seed()
6969

70-
stopifnot(!any(seed_next != seed))
70+
stopifnot(identical(seed_next, seed))
7171

7272
invisible(seed_next)
7373
}

0 commit comments

Comments
 (0)