Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COP25 Schema Update Release Zero #859

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion R/getPSNUs.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ getValidOrgUnits <- function(cop_year = NULL) {

switch(as.character(cop_year),
"2023" = valid_OrgUnits,
"2024" = valid_OrgUnits_2024)
"2024" = valid_OrgUnits_2024,
"2025" = valid_OrgUnits_2025)

}

Expand Down
17 changes: 11 additions & 6 deletions R/packageSetup.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ getCurrentCOPYear <- function() {
datapackrSupports <- function() {
tibble::tribble(
~tools, ~yrs, ~seasons,
"Data Pack", c(2023, 2024), c("COP", "OPU"),
"Data Pack", c(2023, 2024, 2025), c("COP", "OPU"),
"OPU Data Pack", c(2023), c("OPU", "COP"),
"Data Pack Template", c(2023, 2024), c("COP", "OPU"),
"Data Pack Template", c(2023, 2024, 2025), c("COP", "OPU"),
"OPU Data Pack Template", c(2023), c("OPU", "COP"),
"PSNUxIM", c(2023, 2024), c("COP", "OPU"),
"PSNUxIM Template", c(2024), c("COP", "OPU"))
"PSNUxIM", c(2023, 2024, 2025), c("COP", "OPU"),
"PSNUxIM Template", c(2024, 2025), c("COP", "OPU"))
}


Expand Down Expand Up @@ -138,18 +138,20 @@ skip_tabs <- function(tool = "Data Pack", cop_year) {
switch(as.character(cop_year),
"2023" = c("Home", "Spectrum", "Year 2"),
"2024" = c("Home", "Spectrum", "Year 2"),
"2025" = c("Home", "Spectrum", "Year 2"),
NA_character_)

skip$unpack <-
switch(as.character(cop_year),
"2023" = c("Home", "Spectrum", "KP Validation"),
"2024" = c("Home", "Spectrum", "KP Validation"),
"2025" = c("Home", "Spectrum", "KP Validation"),
NA_character_)

skip$schema <- skip$pack[skip$pack %in% skip$unpack]

} else if (tool %in% c("OPU Data Pack Template", "OPU Data Pack", "PSNUxIM", "PSNUxIM Template") &&
cop_year %in% c(2023, 2024)) {
cop_year %in% c(2023, 2024, 2025)) {
skip$pack <- c("Home")
skip$unpack <- c("Home")
skip$schema <- c("Home")
Expand Down Expand Up @@ -180,7 +182,7 @@ headerRow <- function(tool, cop_year) {
rm(params, p)

#Currently all tools use row 14 as the header.
if (cop_year %in% c(2023, 2024)) {
if (cop_year %in% c(2023, 2024, 2025)) {
if (tool %in% datapackrSupports()$tools) {
return(14)
} else {
Expand Down Expand Up @@ -225,12 +227,14 @@ pick_schema <- function(cop_year, tool) {
schema <- switch(as.character(cop_year),
"2023" = cop23_data_pack_schema,
"2024" = cop24_data_pack_schema,
"2025" = cop25_data_pack_schema,
stop("Data Pack schema not available for the COP year provided."))

} else if (tool %in% c("PSNUxIM", "PSNUxIM Template")) {
schema <- switch(as.character(cop_year),
"2023" = cop23_psnuxim_schema,
"2024" = cop24_psnuxim_schema,
"2025" = cop25_psnuxim_schema,
stop("PSNUxIM schema not available for the COP year provided."))
} else {
stop("No schema could be found for the combination of tool and COP year provided.")
Expand Down Expand Up @@ -273,6 +277,7 @@ pick_template_path <- function(cop_year, tool) {
template_filename <- switch(as.character(cop_year),
"2023" = "COP23_Data_Pack_Template.xlsx",
"2024" = "COP24_Data_Pack_Template.xlsx",
"2025" = "COP25_Data_Pack_Template.xlsx",
NULL)

}
Expand Down
2 changes: 1 addition & 1 deletion R/unPackSchema.R
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ unPackSchema <- function(template_path = NULL,
# rm(params, p)

if (tool %in% c("OPU Data Pack Template", "OPU Data Pack", "PSNUxIM", "PSNUxIM Template")
&& cop_year %in% c(2023, 2024)) {
&& cop_year %in% c(2023, 2024, 2025)) {
include_blank_cells <- TRUE
} else {
include_blank_cells <- FALSE
Expand Down
Loading