Bugfix/random initialisation - #147
Merged
Merged
Conversation
A shuffle moved plots holding no treatment, and permuted plots at a `swap_all` level where the search exchanges whole label sets, so a random start could relocate a design's gaps or break up its wholeplots and strips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A plot missing at one level still carries the other levels' treatments, so holding it back at every level split a treatment's plot set on a `swap_all` level, leaving a wholeplot holding two treatments - the layout the shuffle was meant to protect. Each level now masks on its own swap column. Also stops `speed()` failing with "supplied seed is not a valid integer" when `seed` is unset in a session that has not yet used the RNG. Renames `shuffle_plots` and `shuffle_labels` to `shuffle_single_items` and `shuffle_item_sets`, and collects the random-initialisation tests in `test-random_initialise.R`, adding regression cover for the split label set, reproducibility across restarts, and `linked_cols` through a random start. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rogerssam
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #141,
speed/tests/testthat/test-random_initialise.R
Lines 333 to 442 in 44e0385
Fix 1, 3, and 4 in #142.
Fix #143,
speed/R/speed.R
Lines 317 to 319 in 44e0385
Random initialization tests also moved to its own file.