Skip to content

Commit a5c7698

Browse files
committed
Merge branch 'main' into add-inequalities-module
2 parents f066e45 + 49e7124 commit a5c7698

File tree

5 files changed

+54
-56
lines changed

5 files changed

+54
-56
lines changed

.Rbuildignore

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
^CODEOWNERS$
2-
^remove_files_from_manifest.js$
3-
^update_manifest.js$
2+
^remove_files_from_manifest\.js$
43
^.*\.Rproj$
54
^\.Rproj\.user$
65
^data-raw$
7-
dev_history.R
6+
^dev_history\.R$
87
^dev$
98
$run_dev.*
109
^LICENSE\.md$
1110
^README\.Rmd$
1211
^app\.R$
1312
^rsconnect$
1413

15-
.lintr
16-
.github
17-
.vscode
14+
^\.lintr$
15+
^\.github$
16+
^\.vscode$
1817

1918
^_targets$
2019
^targets$
21-
^_targets.R$
20+
^_targets\.R$
2221
^\.github$
2322

24-
^params/$
25-
^update_manifest.js$
26-
^manifest.json$
23+
^\.cache/
24+
^params/
25+
^update_manifest\.js$
26+
^manifest\.json$
27+
28+
^inputs_selection_app/
29+
30+
^\.Renviron\.example$
31+
^\.git-blame-ignore-revs$
2732

28-
^inputs_selection_app/

.gitignore

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
.Rproj.user
2-
.Rhistory
3-
.Rdata
4-
.httr-oauth
5-
.DS_Store
6-
7-
_targets/
8-
_targets.yaml
9-
10-
.Renviron
11-
12-
rsconnect/
13-
14-
params/
15-
16-
# worktrees
17-
inputs_selection_app/
1+
.Rproj.user
2+
.Rhistory
3+
.Rdata
4+
.httr-oauth
5+
.DS_Store
6+
7+
_targets/
8+
_targets.yaml
9+
10+
.Renviron
11+
12+
rsconnect/
13+
14+
params/
15+
16+
# worktrees
17+
inputs_selection_app/
18+
19+
.cache/
20+
tmp/

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Imports:
3434
gt,
3535
htmltools,
3636
httr2,
37-
janitor,
3837
jsonlite,
3938
jsonvalidate,
4039
leaflet,

R/fct_azure_storage.R

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,33 @@
1-
#' azure_storage
2-
#'
3-
#' @description A fct function
1+
#' Get Provider Data
42
#'
5-
#' @return The return value, if any, from executing the function.
3+
#' Read the parquet file containing a selected type of provider data.
64
#'
7-
#' @noRd
8-
load_rds_from_adls <- function(
5+
#' @param file The name of the file to read.
6+
#' @param inputs_data_version The version of the inputs data to use.
7+
#' @return A tibble.
8+
load_provider_data <- function(
99
file,
1010
inputs_data_version = Sys.getenv("NHP_INPUTS_DATA_VERSION", "dev")
1111
) {
12-
fs <- get_adls_fs()
13-
AzureStor::storage_load_rds(fs, glue::glue("{inputs_data_version}/{file}"))
14-
}
15-
16-
#' Get inequalities data
17-
#'
18-
#' Read the parquet file for inequalities
19-
#' @return A tibble.
20-
load_inequalities_data <- function() {
21-
2212
fs <- get_adls_fs()
2313
fs |>
2414
AzureStor::download_adls_file(
25-
glue::glue("dev/inequalities.parquet"),
15+
glue::glue("{inputs_data_version}/{file}.parquet"),
2616
dest = NULL
2717
) |>
2818
arrow::read_parquet() |>
2919
tibble::as_tibble()
3020
}
3121

32-
#' Get Provider Data
33-
#'
34-
#' Read the parquet file containing a selected type of provider data.
22+
#' Get inequalities data
3523
#'
36-
#' @param file The name of the file to read.
37-
#' @param inputs_data_version The version of the inputs data to use.
24+
#' Read the parquet file for inequalities
3825
#' @return A tibble.
39-
load_provider_data <- function(
40-
file,
41-
inputs_data_version = Sys.getenv("NHP_INPUTS_DATA_VERSION", "dev")
42-
) {
26+
load_inequalities_data <- function() {
4327
fs <- get_adls_fs()
4428
fs |>
4529
AzureStor::download_adls_file(
46-
glue::glue("{inputs_data_version}/{file}.parquet"),
30+
glue::glue("dev/inequalities.parquet"),
4731
dest = NULL
4832
) |>
4933
arrow::read_parquet() |>

R/mod_mitigators_server.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,14 @@ mod_mitigators_server <- function(
567567
readr::read_csv(col_types = "cddd") |>
568568
dplyr::filter(.data[["param_name"]] == input$strategy)
569569

570+
shiny::validate(
571+
shiny::need(
572+
nrow(nee_params) > 0,
573+
"This TPMA was not part of the National Elicitation Exercise,
574+
so a nationally-determined estimate is not available."
575+
)
576+
)
577+
570578
nee_params |>
571579
ggplot2::ggplot() +
572580
ggplot2::geom_segment(

0 commit comments

Comments
 (0)