greta-dev / greta-dev/greta

greta in "imports" of a targets workflow

Open
#599 2 comments 0 reactions 0 assignees View on GitHub
Up Next
Dominant language
C++
Stars
607
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
1

Description

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](https://github.com/idem-lab/example-greta-targets/issues/1) and [here](https://github.com/greta-dev/greta/issues/595).

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](https://books.ropensci.org/targets/packages.html#package-based-invalidation).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.