DOI-USGS / DOI-USGS/scipiper

simplest use of create_task_step needs ind_dir

Open
#97 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
R
Stars
10
Forks
12
PR merge metrics
No merged PRs in 30d

Description

```r
task_config <- data.frame(
id=c('AZ','CO','CA'),
capital=c('Phoeniz','Denver','Sacramento')
)
step1 <- create_task_step(
step_name = 'prep',
target = function(task_name, step_name, ...) {
sprintf('%s_%s', task_name, step_name)
},
depends = c('A','B'),
command = "process(target_name, I('C'))"
)
step2 <- create_task_step(
step_name = 'plot',
command = function(target_name, task_name, ...) {
capital <- task_config[task_config$id == task_name, 'capital']
sprintf('visualize(\'%s\', \'%s\')', task_name, capital)
}
)
step3 <- create_task_step('report')
task_plan <- create_task_plan(c('AZ','CA','CO'), list(step1, step2, step3),
final_steps='report', ind_dir='states/log')
create_task_makefile(task_plan, 'indbug.yml')
```
works as expected. Snippet of remake:
```yaml
states/log/CA.ind:
command: sc_indicate(target_name)
depends:
- CA_report
...
states/log/CO.ind:
command: sc_indicate(target_name)
depends:
- CO_report
```
but leaving out the `ind_dir` creates bad target names for `sc_indicate`:
```r
task_plan <- create_task_plan(c('AZ','CA','CO'), list(step1, step2, step3),
final_steps='report')
create_task_makefile(task_plan, 'indbug.yml')
```
```yaml
# --- CA --- #
...
.ind:
command: sc_indicate(target_name)
depends:
- CA_report

# --- CO --- #
...
.ind:
command: sc_indicate(target_name)
depends:
- CO_report
```
I think in this case, we'd want it to just name those ind targets `CA.ind` and `CO.ind`

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.