Skip to content

Commit f958388

Browse files
committed
moves data to app_data folder from inst
1 parent f375922 commit f958388

7 files changed

Lines changed: 9 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ inputs_selection_app/
1919
.cache/
2020
tmp/
2121

22-
inst/app/data/
22+
app_data/

R/ZZZ.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ encrypt_filename <- function(
8787
}
8888

8989
download_params_schema <- function(
90-
data_path = app_sys("app", "data"),
90+
data_path = "app_data",
9191
app_version = Sys.getenv("INPUTS_DATA_VERSION", "dev")
9292
) {
9393
file_path <- file.path(data_path, "params-schema.json")
@@ -109,7 +109,7 @@ get_params_schema <- function(
109109
app_version = Sys.getenv("INPUTS_DATA_VERSION", "dev")
110110
) {
111111
if (!exists("schema", envir = .schema_cache)) {
112-
.schema_cache[["schema"]] <- app_sys("app", "data", "params-schema.json") |>
112+
.schema_cache[["schema"]] <- file.path("app_data", "params-schema.json") |>
113113
readr::read_file() |>
114114
jsonvalidate::json_schema$new()
115115
}

R/fct_azure_storage.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @return The path to the downloaded file.
1212
download_provider_data <- function(
1313
file,
14-
data_path = app_sys("app", "data"),
14+
data_path = file.path("app_data"),
1515
inputs_data_version = Sys.getenv("NHP_INPUTS_DATA_VERSION", "dev"),
1616
...
1717
) {
@@ -48,7 +48,7 @@ get_adls_fs <- function() {
4848
get_all_data_files <- function(
4949
inputs_data_version = Sys.getenv("NHP_INPUTS_DATA_VERSION", "dev")
5050
) {
51-
data_path <- file.path("inst", "app", "data")
51+
data_path <- file.path("app_data")
5252
if (!dir.exists(data_path)) {
5353
dir.create(data_path, recursive = TRUE)
5454
}

R/fct_load_provider_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' @param file The name of the file to read.
88
#' @param inputs_data_version The version of the inputs data to use.
99
#' @return A tibble.
10-
load_provider_data <- function(file, data_path = app_sys("app", "data")) {
10+
load_provider_data <- function(file, data_path = file.path("app_data")) {
1111
if (!exists(file, envir = .data_cache)) {
1212
.data_cache[[file]] <- file.path(data_path, glue::glue("{file}.parquet")) |>
1313
arrow::read_parquet() |>

R/run_app.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ run_app <- function(
2424

2525
# check files exist before starting app
2626
# TODO: consider more rigorous checks, e.g. specific files exist, or number of files
27-
if (!dir.exists(file.path(app_sys("app"), "data"))) {
27+
if (!dir.exists(file.path("app_data"))) {
2828
cat("Initialising data directory...\n")
2929
get_all_data_files()
3030
}

man/download_provider_data.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/load_provider_data.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)