Merck / simtrial

Clinical trial simulation for time-to-event endpoints
https://merck.github.io/simtrial/
GNU General Public License v3.0
18 stars 8 forks source link

Use function factory pattern to pass cutting functions to `sim_gs_n()` #201

Closed jdblischak closed 8 months ago

jdblischak commented 8 months ago

Follow-up to #195. Closes #196.

This PR makes the following updates:

Note that I didn't fully convert maxcombo(). I don't think I fully understand the purpose of this function. Its arguments are quoted functions, but they are never evaluated. Instead their arguments for rho and gamma are extracted and passed to fh_weight(). Is there any reason that maxcombo() couldn't instead just receive the vectors of rho and gamma directly? And why is maxcombo() needed when fh_weight() already exists?

LittleBeannie commented 8 months ago

Thanks for applying the function factory, @jdblischak ! Before the merge, could you please introduce us to the changes and new syntax tomorrow?

nanxstats commented 8 months ago

Overall looking good. Let's try follow the testing best practices in designing your test suite:

jdblischak commented 8 months ago

Before the merge, could you please introduce us to the changes and new syntax tomorrow?

@LittleBeannie Yes, of course. I'll explain everything in today's meeting. Also note that this morning I also converted the maxcombo() interface to accept vectors instead of quoted function expressions.

jdblischak commented 8 months ago

Overall looking good. Let's try follow the testing best practices in designing your test suite:

@nanxstats I switched to gsDesign2:: and created helper functions defined in a separate helper file. Please let me know if you'd like me to make any further modifications.