--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/E04E6D01-49BE-46EE-AAB5-D5A97ED5F6A3%40biology.nmsu.edu.
nimble in Depends (rather than in Imports) in NAMESPACE. The result is that nimble
is attached when the nimble-relying package is loaded, and therefore
all objects in the nimble namespace can be found at the user level.
[CRAN doesn't encourage this, but it is allowed] (https://cran.r-project.org/doc/manuals/R-exts.html#Package-Dependencies).This is needed because the node functions (i.e., simulate, calculate,
etc.) for model nodes are part of generated reference classes that
don't live in the nimble namespace, but those node functions use
functions in the nimble namespace such as nimSwitch and distributions that are not native R distributions (such as dinvgamma). Such functions can't be found unless the nimble package is actually loaded, for which Depends rather than Imports is needed in NAMESPACE.
"""
What could go wrong for certain models is that calls to `calculate` and `simulate` on the uncompiled model will give an error. E.g., it would occur if a model has a `dinvgamma` declaration, since the model is created as part of the user's objects and `dinvgamma` can only be found in the nimble namespace but the call to `dinvgamma` in the code we generate doesn't have "nimble::dinvgamma' (having that "nimble::" be inserted would be a much larger project in the nimble compiler). Things should work fine for compiled operation, so I think whether the tweaks would work for you depends on what you end up doing with nimble in your package. We are in the middle of rewriting the nimble compiler, and I think that considerations like this may be handled differently with the rewrite.
I think we probably want to make the tweaks anyway, but I wanted to let you know of the larger context and that you may still need to use `Depends` even with the tweaks.
-chris