Skip to content
Snippets Groups Projects
Commit cdb04fb5 authored by Blodgett, David L.'s avatar Blodgett, David L.
Browse files

get aggregate and non-dend working with single vpu

parent a938439a
No related branches found
No related tags found
1 merge request!184Subdomain
......@@ -72,7 +72,9 @@ list(
tar_target(vpu_codes, if(length(domain) == 1 && grepl("^[0-1]", domain))
unique(rpu_vpu$vpuid[grepl(domain, rpu_vpu$vpuid)]) else
unique(rpu_vpu$vpuid)),
tar_target(all_rpu_codes, unique(rpu_vpu$rpuid)),
tar_target(rpu_codes, if(length(domain) == 1 && grepl("^[0-1]", domain))
unique(rpu_vpu$rpuid[grepl(domain, rpu_vpu$rpuid)]) else
unique(rpu_vpu$rpuid)),
tar_target(full_cat_file, data_paths$fullcats_table, format = "file"),
tar_target(full_cat_table, readRDS(full_cat_file)),
......
......@@ -16,7 +16,7 @@ prep_path <- ".targets_stores/01_prep/objects/"
list(tar_target(data_paths_file, "cache/data_paths.json", format = "file"),
tar_target(data_paths, jsonlite::read_json(data_paths_file)),
tar_target(rpu_codes_file, file.path(prep_path, "all_rpu_codes"), format = "file"),
tar_target(rpu_codes_file, file.path(prep_path, "rpu_codes"), format = "file"),
tar_target(rpu_codes, readRDS(rpu_codes_file)),
tar_target(rpu_vpu_file, file.path(prep_path, "rpu_vpu"), format = "file"),
tar_target(rpu_vpu, readRDS(rpu_vpu_file)),
......
......@@ -15,7 +15,7 @@ source("R/04_aggregate_functions.R")
prep_path <- ".targets_stores/01_prep/objects/"
list(tar_target(rpu_codes_file, file.path(prep_path, "all_rpu_codes"), format = "file"),
list(tar_target(rpu_codes_file, file.path(prep_path, "rpu_codes"), format = "file"),
tar_target(rpu_codes, readRDS(rpu_codes_file)),
tar_target(rpu_gpkg, file.path("cache", paste0(rpu_codes, "_refactor.gpkg")),
pattern = map(rpu_codes), deployment = "worker"),
......
......@@ -21,6 +21,8 @@ tar_make(gage_selection_map_report)
tar_make(vpu_codes)
tar_load(vpu_codes)
tar_make(rpu_codes)
########## Debug help ################
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:
......@@ -67,6 +69,7 @@ tar_make(vpu_gpkg)
# the POI creation workflow loops over these
tar_read(vpu_gpkg)
# if running many, each can be run independently.
tar_make_future(huc12_poi, workers = workers)
tar_make_future(gage_pois, workers = workers)
tar_make_future(te_pois, workers = workers)
......@@ -89,20 +92,50 @@ tar_make_future(poi_lookup, workers = workers)
tar_make_future(draft_segments, workers = workers)
tar_make_future(write_poi_, workers = workers)
# Otherwise, just run all with
tar_make()
Sys.setenv(TAR_PROJECT = "03_refactor")
# iterate of "raster processing units"
tar_make(rpu_gpkg)
tar_make(vpu_gpkg) # need to track the vpu for each
tar_read(rpu_gpkg)
tar_read(vpu_gpkg)
workers = 6
# now make all the rpus that we need
tar_make_future(workers = workers)
Sys.setenv(TAR_PROJECT = "04_aggregate")
# iterate of "raster processing units"
tar_make(rpu_gpkg)
tar_make(agg_gpkg) # need to track the vpu for each
tar_read(rpu_gpkg)
tar_read(agg_gpkg) # output to "aggregate" rpu gpkgs
workers = 6
tar_make_future(workers = workers)
Sys.setenv(TAR_PROJECT = "05_non_dendritic")
# now we combine raster units back to vector processing units
tar_make(vpu_gpkg)
tar_read(vpu_gpkg)
# outputs will be written to a refactor and final "GF" gpkg
tar_make(rfc_gpkg)
tar_read(rfc_gpkg)
tar_make(gf_gpkg)
tar_read(gf_gpkg)
tar_make()
workers = 6
tar_make_future(workers = workers)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment