Skip to content
Snippets Groups Projects
workflow_runner.R 1.5 KiB
Newer Older
  • Learn to ignore specific revisions
  • # running in one global workflow for now.
    
    Blodgett, David L.'s avatar
    Blodgett, David L. committed
    
    
    # clear dropped gages file
    
    file.remove("cache/dropped_gages.csv")
    
    Blodgett, David L.'s avatar
    Blodgett, David L. committed
    # checks from SWIM prep
    file.remove("temp/GagestoCheck_GAGESIII.csv")
    
    
    # checks from nhdplusv2 gageloc prep
    file.remove("temp/GagestoCheck_GageLoc.csv")
    
    
    Sys.setenv(TAR_PROJECT = "01_prep")
    
    
    # step 1: gage selection 
    tar_make(gage_selection_map_report)
    
    # step 2: vpu prep
    # iterates over vpus
    tar_load(vpu_codes)
    
    if(FALSE) { # this won't run if you just bang through this file
      # To debug a given vpu, first run all to get the dynamic branches established:
      tar_make(vpu_base)
      
      # if any error, you can rerun them as shown below.
      
      # Then find the branch in question and add it to tar_options_set in the workflow file:
      
      (branch <- tar_branch_names(vpu_base, which(vpu_codes == "01")))
      vpu_codes[tar_branch_index(branch)]
      
      cat('debug = "', branch, '", cue = tar_cue(mode = "never")', sep = "")
      
      # now we run with callr_function = NULL to get the debug to hit on the desired branch.
      # note that any other failed branches may try to run first -- it's best to debug the firt
      # errored branch then work down the list.
      
      tar_make(callr_function = NULL)
    }
    
    # run branches for a given target in parallel if you have enough memory
    # note this will only work for targets with 'deployment = "worker"'
    
    tar_make_future(rpu_vpu_out_list, workers = 8)
    tar_make(rpu_vpu_out)
    
    Sys.setenv(TAR_PROJECT = "02_POI_creation")
    
    
    tar_make_future(hilarri_pois, workers = 8)