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

pathing and other tweaks for Docker

parent bc78a301
No related branches found
No related tags found
1 merge request!93pathing and other tweaks for Docker
......@@ -23,7 +23,6 @@ knitr::opts_chunk$set(
Load functions and configuration.
See `hyRefactory_config.R` for all constants.
```{r setup}
source("../hyfabric/R/utils.R")
source("R/utils.R")
source("R/hyRefactor_funs.R")
source("R/config.R")
......
......@@ -20,7 +20,6 @@ knitr::opts_chunk$set(
Load functions and configuration.
See `hyRefactory_config.R` for all constants.
```{r setup}
source("../hyfabric/R/utils.R")
source("R/utils.R")
source("R/config.R")
source("R/NHD_navigate.R")
......@@ -71,7 +70,7 @@ if(needs_layer(out_agg_gpkg, mapped_outlets_layer)) {
# Map non-event outlets ID into one dataset here with reconciled ID
outlets_POI <- map_outlet_ids(select(st_drop_geometry(outlets), COMID, type),
reconciled_sub) %>%
left_join(mutate(outlets, COMID = as.character(COMID)) %>% select(-type), by = "COMID") %>%
left_join(outlets %>% select(-type), by = "COMID") %>%
st_sf()
# Get the end of the reconciled flowlines and bind with data frame
......
......@@ -15,10 +15,10 @@ if(!exists("VPU")) {
VPU <- get_rpu_dependent_vars(rpu_code)$v
}
if(!nchar(out_gpkg <- Sys.getenv("OUT_GPKG")) > 5)
if(!nchar(out_agg_gpkg <- Sys.getenv("OUT_GPKG")) > 5)
out_agg_gpkg <- file.path("cache", paste0(rpu_code, "_aggregate.gpkg"))
if(!nchar(out_refactor_gpkg <- Sys.getenv("OUT_REFACTOR_GPKG")) > 5)
if(!nchar(out_refac_gpkg <- Sys.getenv("OUT_REFACTOR_GPKG")) > 5)
out_refac_gpkg <- file.path("cache", paste0(rpu_code, "_refactor.gpkg"))
if(!nchar(cache_split <- Sys.getenv("CACHE_SPLIT")) > 5)
......
......@@ -23,7 +23,10 @@ e1 <- "--env HYDREG=z!z"
command <- paste("R -e \"rmarkdown::render('/jupyter/02_NHD_navigate.Rmd', output_file='/jupyter/reports/02_NHD_navigate_z!z.html')\" \n")
hus <- c(paste0("0", c(1:9)), paste0("1", c(1:8)), "10U", "10L")
hus <- c(paste0("0", c(1:2, 4:9)),
"03S", "03W", "03L",
"10U", "10L",
paste0("1", c(1:8)))
calls <- sapply(hus, function(hu) gsub("z!z", hu, paste(call, mount, e1, docker_image, command)))
......@@ -73,13 +76,15 @@ The txt file can be used with GNU parallel like:
```{r}
out_script <- "hyRefactor_calls.txt"
e1 <- "--env OUT_GPKG=/jupyter/cache/z!z.gpkg"
e1 <- "--env OUT_GPKG=/jupyter/cache/z!z_aggregate.gpkg"
e11 <- "--env OUT_REFACTOR_GPKG=/jupyter/cache/z!z_refactor.gpkg"
e2 <- "--env RPU_CODE=z!z"
e3 <- "--env SPLIT_CACHE=/jupyter/temp/z!z_split.rda"
e4 <- "--env LOOKUP_TABLE=/jupyter/cache/z!z_lookup.csv"
command <- paste("R -e \"rmarkdown::render('/jupyter/05_hyRefactor_flines.Rmd', output_file='/jupyter/reports/05_hyRefactor_flines_z!z.html')\"",
"-e \"rmarkdown::render('/jupyter/07_hyRefactor_cats.Rmd', output_file='/jupyter/reports/07_hyRefactor_cats_z!z.html')\" \n")
"-e \"rmarkdown::render('/jupyter/07-1_hyRefactor_cats.Rmd', output_file='/jupyter/reports/07-1_hyRefactor_cats_z!z.html')\"",
"-e \"rmarkdown::render('/jupyter/07-2_aggregate_cats.Rmd', output_file='/jupyter/reports/07-2_aggregate_cats_z!z.html')\" \n")
all_hus <- gsub("rpu_", "", names(data_paths$fdr))
......@@ -88,7 +93,7 @@ errors <- gsub(".rda", "", gsub("temp/", "", errors))
hus <- all_hus[!all_hus %in% errors]
calls <- sapply(hus, function(hu) gsub("z!z", hu, paste(call, mount, e1, e2, e3, e4, docker_image, command)))
calls <- sapply(hus, function(hu) gsub("z!z", hu, paste(call, mount, e1, e11, e2, e3, e4, docker_image, command)))
cat("", file = out_script, append = FALSE)
for(i in 1:length(calls)) {
......
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