Closed ChristopherEeles closed 1 year ago
It also seems that deleting the option in the global environment doesn't work. Maybe because the spawned processes are reloading gDR or gDRcore?
Nevermind deleting the option does work but there are nested calls to parallelize inside of map_df
(which is also a NAMESPACE clash with purrr:::map_df
making it kind of confusing).
Hi @ChristopherEeles,
setting global options was removed in #27.
In
zzz.R
you have set a global option for the defaultBiocParallel
back-end. This breaks the the normal mechanism for mutating theBiocParallel
back-end viaBiocParallel::register
.If you need to register a default back-end, use:
But IMO
BiocParallel
does a pretty good job of picking appropriate defaults so this is probably unnecessary.It is also idomatic to allow users to pass
BPPARAM
into any function which is being parallelized viaBiocParallel
. This (1) documents that the function is parallelized and (2) allows setting a runtime back-end without mutating global state. This can be done explictly with aBPPARAM
argument or via passing...
to the BiocParallel calls (which is probably preferable since there are other options you can set).Also a general FYI that if you are submitting to Bioconductor (or CRAN) they do not like it when you mutate a users global state. You can work around this by setting your options inside the appropriate package namespace (i.e. via
assign
) instead of the global environment or by setting the variable temporarily inside your functions and resetting viaon.exit
when they finish executing.If you absolutely need global options, at least prepend the variables with your package name to ensure they do not override any user or other package defaults.
REPREX