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

Dp 1335 hot fix #856

Merged
merged 19 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.0
Date: 2024-06-28
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
20 changes: 20 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# datapackr 7.6.2
## 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

## Minor improvements and fixes
*

# datapackr 7.6.0
## New features
* Sunset COP21 and COP22
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
1 change: 0 additions & 1 deletion tests/testthat/test-pdap-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ test_that("Can upload PDAP CSV export", {
# expect_equal(jobs$status_code, 200L)
# })


test_that("Can initiate a PDAP job", {
d <-
loadDataPack(
Expand Down