You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make greta models available to downstream targets we need to "awaken" the model using a tar_hook_before() per the examples and discussion here and here.
Although these short-term fixes have worked fine, they fail to work if greta is added to the imports argument of tar_option_set() per below example. There is no issue with having greta listed in the packages argument.
tar_option_set(
# packages that your targets need to run
packages = c('greta'),
imports = c('greta')
)
@njtierney has suggested this may have to do with making the entire namespace of greta available in the global environment.
It would be helpful to solve this issue because having the package in the imports argument means your targets pipeline is checking changes in the internal code of package and rerunning the workflow accordingly, per these guidelines about package invalidation.
The text was updated successfully, but these errors were encountered:
This is something that is good to know about, as it could definitely trip people up!
However, I think I would not recommend putting greta in the "imports" argument of tar_option_set as a general rule, although I can imagine there might be exceptions.
Usually, local package libraries do not need to change very often, and it is best to maintain a reproducible project library using renv.
Rather than loading greta locally on your machine and installing from there. The situation I am imagining where greta is required to be in imports is when you are developing specific functions within greta and are working on it locally and also using a targets pipeline. I'm not sure if that will come up very often?
I'd be curious if this issue arises if putting greta.gp inside of imports as well.
Also a note that perhaps functions that import, e.g., greta::normal, inside a local package that is imported in targets import, might be causing an issue here as well.
Re: seamless integration of greta into targets
To make greta models available to downstream targets we need to "awaken" the model using a
tar_hook_before()
per the examples and discussion here and here.Although these short-term fixes have worked fine, they fail to work if greta is added to the imports argument of
tar_option_set()
per below example. There is no issue with having greta listed in the packages argument.@njtierney has suggested this may have to do with making the entire namespace of greta available in the global environment.
It would be helpful to solve this issue because having the package in the imports argument means your targets pipeline is checking changes in the internal code of package and rerunning the workflow accordingly, per these guidelines about package invalidation.
The text was updated successfully, but these errors were encountered: