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

Enhancement for doFuture implementation and stable parallel RNG in sim_gs_n #230

Closed
wants to merge 0 commits into from

Conversation

cmansch
Copy link
Collaborator

@cmansch cmansch commented Apr 19, 2024

Implementation for sim_gs_n() to have a parallel adaptor similar to sim_fixed_n() (xref: #110).
A seed is now set prior to the function call instead of passed as an argument.
Function now uses %douture% to run iterations of n_sim in parallel.

Addresses open issue (xref: #205).

Sequential backend still available (and default) to avoid any delays in development.

Please update "Remove seed argument from sim_gs_n() in (xref: Merck/gsDesign2#288) as part of the implementation.

PR will be updated again following approval of PR (xref: #229) as it will need to combine updates to sim_gs_n from that PR.

Copy link
Collaborator

@jdblischak jdblischak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cmansch! Looking forward to this!

R/sim_gs_n.R Outdated
# test = wlr,
# cut = list(ia1 = ia1, ia2 = ia2, fa = fa),
# weight = fh(rho = 0, gamma = 0)
# )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add back the apostrophe (#') as this removed this example from the documentation. Also note that if you are using RStudio, you can execute this code with Ctrl-Enter without having to uncomment it.

@@ -4,14 +4,14 @@
# See helper-sim_gs_n.R for helper functions

test_that("Test 1: regular logrank test", {
# set.seed(2024)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unfortunate timing as all the sim_gs_n() tests were commented out. Once #229 is merged, you can rebase on top of that, and then the tests will run.

# ),
# "If you want to run different tests at each cutting"
# )
expect_equal(1 + 1, 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, instead of commenting out a test, please add skip("The reason the test needs to be skipped"). This keeps the git diff's nicer. In other words, it is easier to see what needed to be change to fix a test if it wasn't completely commented out previously.

@jdblischak jdblischak mentioned this pull request Apr 23, 2024
15 tasks
@jdblischak
Copy link
Collaborator

My PR #229 has been merged. @cmansch could you please update your PR? I recommend fixing the roxygen2 comments first since that should reduce the number of merge conflicts you'll have to address manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants