Open LTLA opened 5 years ago
a simple mechanism that allows my packages to save to a different slot of the existing registry.
Wouldn't this effectively just be reimplementing options
with maybe slightly different semantics? What would be the advantage register
over options
here?
BiocNeighbors and BiocSingular follow BiocParallel's paradigm of using
*Param
objects to specify the algorithm and parameters to use for NN searching and SVD, respectively.I have recently added a
BiocSingular::bsparam()
function that returns a "default" Param object, in much the same way thatBiocParallel::bpparam()
works. The idea is that developers can specifybsparam()
in their functions/scripts and it will use a global default value that can be changed by the user. This is more convenient than passing the new Param explicitly to each function.Currently, I am using a global
options()
to handle this, but it would be nice to use theBiocParallel::register()
interface (and its internal machinery) to manage the setting and getting of the global default. One could imagine makingregister()
an S4 generic, or even better, adding a simple mechanism that allows my packages to save to a different slot of the existing registry.