Skip to content

Commit

Permalink
update yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
tonygard-indecon committed Sep 19, 2023
1 parent 0ecab48 commit 29961cf
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 49 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/fredi_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Render documents and upload

on:
push:
paths:
- 'inst/extdata/**'

jobs:
render_document:
Expand Down
47 changes: 0 additions & 47 deletions createSystemData_main.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,52 +206,5 @@ list_systemData <- list_reshapeData %>% createSystemData(save=T, silent=T)



####################### CREATE SV DATA ############################################

c_sv_sectors <- try(get_sv_sectorInfo())
if("try-error" %in% class(c_sv_sectors)){c_sv_sectors <- NULL}


### Screening


list_screening <- list(
save = TRUE, ### Save SV
sv = TRUE, ### Update SV demographic data
pop = TRUE, ### Update SV population data
format = TRUE, ### Update formats
impacts = FALSE, ### Update impact lists
sectors = c_sv_sectors
)



## Uncomment following six lines to create and save data and check the outputs
for(name_i in codeNames){ source(paste(codePath, name_i, sep="/")) }
time1 <- Sys.time()
test_svData <- createSVData(
save = list_screening$save,
sv = list_screening$sv,
pop = list_screening$pop,
format = list_screening$format,
impacts = list_screening$impacts,
sectors = list_screening$sectors,
return = TRUE
)


# Use the following code to update the FrEDI system data with the SV configuration data.
for(name_i in codeNames){ source(paste(codePath, name_i, sep="/")) }; codeNames
time3 <- Sys.time()
update_sysdata(
save = TRUE,
sv = TRUE,
impacts = FALSE,
outPath = dataOutPath
)






48 changes: 48 additions & 0 deletions createSystemData_sv.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,54 @@ require(tidyverse)
require(openxlsx)
require(devtools)

mostRecentDate <- "20230503"# Sys.Date()

projectPath <- "."
today <- format(Sys.Date(), "%Y%m%d")


### Project configuration
configPath <- projectPath %>% file.path("config")
# configFiles <- configPath %>% list.files(".R")
configFiles <- "frediConfig.R"
### Code path
codePath <- projectPath %>% file.path("R")
codeNames <- codePath %>% list.files(".R")
configLogPath <- codePath %>% file.path("configLog")

### Names for archive and use versions
configFileName <- "fredi_config"
configArchName <- configLogPath %>% file.path(configFileName) %>% paste(today, sep="_") %>% paste0(".rda")
configUseName <- codePath %>% file.path(configFileName) %>% paste0(".rda")

### Output path
dataOutPath <- projectPath %>% file.path("data")
dataOutLog <- dataOutPath %>% file.path("dataLog")
sysFileName <- "sysdata"
sysArchName <- dataOutLog %>% file.path(sysFileName) %>% paste(today, sep="_") %>% paste0(".rda")
excelFileName <- mostRecentDate %>% paste("FrEDI_config.xlsx", sep="_")
sysUseName <- dataOutPath %>% file.path(sysFileName) %>% paste0(".rda")

### Name of most recent sysdata.rda file in archive
dataOutLogFiles <- dataOutLog %>% list.files %>% sort(decreasing = T); dataOutLogFiles %>% head
sysFileRef <- dataOutLog %>% file.path(dataOutLogFiles[1]); sysFileRef
# sysFileRef <- dataOutLog %>% file.path("sysdata_20221021.rda"); sysFileRef


# Configuration Files -->
##Load all configuration functions


### Load all functions

for(i in configFiles){ source(paste(configPath, i, sep="/")) }
for(i in codeNames){ source(paste(codePath, i, sep="/")) }



#List configuration files

configLogPath %>% list.files("rda") %>% sort(decreasing=FALSE) %>% head

c_sv_sectors <- try(get_sv_sectorInfo())
if("try-error" %in% class(c_sv_sectors)){c_sv_sectors <- NULL}
Expand Down

0 comments on commit 29961cf

Please sign in to comment.