DOI-USGS / lake-temperature-model-prep

Pipeline #1
Other
6 stars 13 forks source link

Fix out skipnc feather #315

Closed hcorson-dosch-usgs closed 2 years ago

hcorson-dosch-usgs commented 2 years ago

Make the glm_ready_gcm_data_feather back into a branched target so that the out_skipnc_feather target can map over it to build the intermediary feather files.

lindsayplatt commented 2 years ago

BTW, here is the error that you get when you run the previous version. It is because We are trying to branch over a file target that wasn't created with a pattern. Hayley's fix here was the simplest way to fix it. You can also do it in a two-step pattern as shown in the targets documentation here or using a different function tarchetypes::tar_files(). Putting this here so that it shows up if we try to search the error in the future :)

Error : Target out_skipnc_feather tried to branch over glm_ready_gcm_data_feather, which is illegal. 
Patterns must only branch over explicitly declared targets in the pipeline. Stems and patterns are fine, 
but you cannot branch over branches or global objects. Also, if you branch over a target with format = "file", 
then that target must also be a pattern. 
jordansread commented 2 years ago

wow, this seems important, complicated, and confusing! I'm not sure I fully understand this gotcha, but perhaps it is something we'll want to work into the training?

lindsayplatt commented 2 years ago

Good idea, @jread-usgs! See https://github.com/USGS-R/ds-pipelines-targets-3-course/issues/15