For reasons discussed here, nimble-using packages need nimble in requires.
A related issue is that if a 3rd package wants to use nimbleHMC, it cannot use nimbleHMC::configureHMC based on suggests and requireNamespace(nimbleHMC) because sampler_NUTS cannot be found from within nimbles MCMC configuration steps.
A work-around might be that in nimbleHMC, when we invoke addSampler we do so with nimbleHMC::sampler_NUTS (e.g.) rather than "NUTS". We do in places in nimble use nimble::, so I think this can pass CRAN but not entirely sure.
I suspect similar issues would arise with addHMC, buildHMC, nimbleHMC.
And more generally, once we have a proposed solution, it would be good to exercise all of nimbleHMC functionality from a 3rd package with nimbleHMC in suggests to test things.
Now if a 3rd package has nimbleHMC in imports, it might work if configureHMC and sampler_NUTS are tagged with importFrom in NAMESPACE. I haven't checked but this would be worth an experiment.
I am happy to investigate, but also raising this for @danielturek to consider/weigh in on.
Tagging @kenkellner given this arose from a nimbleEcology issue.
For reasons discussed here, nimble-using packages need
nimbleinrequires.A related issue is that if a 3rd package wants to use
nimbleHMC, it cannot usenimbleHMC::configureHMCbased onsuggestsandrequireNamespace(nimbleHMC)becausesampler_NUTScannot be found from withinnimbles MCMC configuration steps.A work-around might be that in
nimbleHMC, when we invokeaddSamplerwe do so withnimbleHMC::sampler_NUTS(e.g.) rather than "NUTS". We do in places in nimble usenimble::, so I think this can pass CRAN but not entirely sure.I suspect similar issues would arise with
addHMC,buildHMC,nimbleHMC.And more generally, once we have a proposed solution, it would be good to exercise all of
nimbleHMCfunctionality from a 3rd package withnimbleHMCinsuggeststo test things.Now if a 3rd package has
nimbleHMCinimports, it might work ifconfigureHMCandsampler_NUTSare tagged withimportFrominNAMESPACE. I haven't checked but this would be worth an experiment.I am happy to investigate, but also raising this for @danielturek to consider/weigh in on.
Tagging @kenkellner given this arose from a nimbleEcology issue.