Skip to content

Commit

Permalink
Data update 18 10 24 (#32)
Browse files Browse the repository at this point in the history
* Fix: Relabelling stat neigh multi chart input

* Chore: Updating paths in BDS wide to long, pointing at new BDS and in-proj data dict

* Feat: New data dict and BDS long

* Chore: minor updates to checking new data quality in global

* Feat: Removing old data dict and updating this in data log

* Tests: Updating bar chart title and screenshot for LA UI tests for new KS1 data
  • Loading branch information
JT-39 authored Oct 22, 2024
1 parent e667e82 commit 4b057a7
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 9 deletions.
Binary file modified 01_data/02_prod/LAIT Data Dictionary.xlsx
Binary file not shown.
Binary file not shown.
Binary file modified 01_data/02_prod/bds_long_0.parquet
Binary file not shown.
6 changes: 3 additions & 3 deletions 02_dev/bds_wide_to_long.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ source(here::here("R/fn_load_data.R"))
```{r pull-latest-bds-data}
# Load raw BDS wide from shared folder
bds_wide_raw_sf <- readxl::read_xlsx(
path = paste0(shared_folder, "/../Project Documentation/BDS - 2024 (JAKE).xlsx"),
sheet = "BDS",
path = paste0(shared_folder, "/../Information for App Development/BDS - 2024 (JAKE).xlsx"),
sheet = "BDS for new LAIT",
col_names = TRUE,
skip = 1,
# Replace multi-space with single-space
Expand Down Expand Up @@ -136,7 +136,7 @@ bds_long_la <- bds_long_clean |>
# only public-safe/in-use measures)
# NOTE: Children_away changed to Children_Away to match BDS
data_dict <- readxl::read_xlsx(
path = paste0(shared_folder, "/LAIT Data Dictionary (To QA!).xlsx"),
path = paste0("01_data/02_prod/LAIT Data Dictionary.xlsx"),
sheet = "Data_prod"
) |>
dplyr::mutate(Measure_short = trimws(Measure_short)) |>
Expand Down
4 changes: 2 additions & 2 deletions R/lait_modules/mod_stat_n_charts.R
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ StatN_Chart_InputUI <- function(id) {
tagList(
shiny::selectizeInput(
inputId = ns("chart_line_input"),
label = "Select region to compare (max 3)",
label = "Select statistical neighbour to compare (max 3)",
choices = NULL,
multiple = TRUE,
options = list(
Expand All @@ -404,7 +404,7 @@ StatN_Chart_InputUI <- function(id) {
),
shiny::selectizeInput(
inputId = ns("chart_bar_input"),
label = "Select region to compare (max 3)",
label = "Select statistical neighbour to compare (max 3)",
choices = NULL,
multiple = TRUE,
options = list(
Expand Down
1 change: 0 additions & 1 deletion datafiles_log.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ filename,status
01_data/02_prod/LA code list.xlsx,published
01_data/02_prod/SN_April 2021.xlsx,published
01_data/02_prod/LAIT Data Dictionary.xlsx,published
01_data/02_prod/LAIT Data Dictionary_old_11092024.xlsx,published
15 changes: 13 additions & 2 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ testthat::test_that(
{
testthat::expect_equal(
bds_clean |>
dplyr::filter(`Short Desc` %notin% metrics_discontinued) |>
nrow(),
nrow(bds_metrics) - (nrow(bds_metrics_dupes) / 2)
)
Expand All @@ -211,13 +210,25 @@ testthat::test_that(
# Using waldo to do same as test
waldo::compare(
x = bds_clean |>
dplyr::filter(`Short Desc` %notin% metrics_discontinued) |>
nrow() |>
as.numeric(),
y = (nrow(bds_metrics) - (nrow(bds_metrics_dupes) / 2)) |>
as.numeric()
)

# Measures that have not been joined by BDS clean
bds_metrics |>
dplyr::filter(is.na(`LA and Regions`)) |>
pull_uniques("Measure_short")

# Measures in BDS metrics but not in BDS clean
setdiff(
bds_metrics |> pull_uniques("Measure_short"),
bds_clean |> pull_uniques("Short Desc")
)



# PROOF 2: The unique values of Measure Short + Topic are the same
testthat::test_that(
"Unique vals of measure_short + topic are the same in BDS & Metrics",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test-UI-mod_la_lvl_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ test_that("Check LA charts behave as expected", {
# Check title
testthat::expect_true(
grepl(
"Pupils achieving Key Stage 1 Reading Expected Standard (%)",
"Pupils achieving expected level in Phonics decoding - all pupils (%)",
cleaned_barplot_str,
fixed = TRUE
)
Expand Down

0 comments on commit 4b057a7

Please sign in to comment.