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

Updated south africa region for cop23 opus #855

Merged
merged 4 commits into from
Jul 22, 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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Type: Package
Package: datapackr
Title: A Package that Packs and Unpacks all Data Packs and Target Setting
Tools
Version: 7.6.1
Date: 2024-07-17
Version: 7.6.2
Date: 2024-07-19
Authors@R: c(
person("Scott", "Jackson", , "sjackson@baosystems.com", role = c("aut", "cre")),
person("Jason", "Pickering", , "jason.p.pickering@gmail.com", role = c("aut", "rev")),
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
## New features
*

## Bug fixes
* Updated `checkMechanisms` to handle shifts in rationalization as it relates to 23 OPU's

## Minor improvements and fixes
*

# datapackr 7.6.1
## New features
*

## Bug fixes
* Updated dataset_levels to reflect org hierarchy change

Expand Down
7 changes: 5 additions & 2 deletions R/checkMechanisms.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@ checkMechanisms <- function(d,

period_info <- datimvalidation::getPeriodFromISO(paste0(d$info$cop_year, "Oct"))


mechs_datim <- datapackr::getMechanismView(d2_session = d2_session,
update_stale_cache = TRUE,
cached_mechs_path = cached_mechs_path) %>%
# Fri Jul 19 15:04:49 2024 Due to Regionalization shifts between cop years affecting OPUs.
{ if (d$info$operating_unit$ou == "West Africa Region")
dplyr::mutate(., ou = replace(ou, ou == "West Africa Region 1" |
ou == "West Africa Region 2", "West Africa Region")) else .
} %>%
dplyr::filter(ou == d$info$operating_unit$ou) %>%
dplyr::filter(!is.na(startdate)) %>%
dplyr::filter(!is.na(enddate)) %>%
dplyr::filter(startdate <= period_info$startDate) %>%
dplyr::filter(enddate >= period_info$endDate) %>%
dplyr::pull(mechanism_code)


#Allow for the default mechanism
mechs_datim <- append("default", mechs_datim)

Expand Down