Skip to content

Commit

Permalink
Dp 1335 hot fix (#856)
Browse files Browse the repository at this point in the history
* updated description

* updated NEWS

* finalized NEWS.md

* updated Description and News.md

* Updated news.md

* updated dataset levels to account for org hierarchy changes

* commented out unrelated test

* Updated news and description for hot fix

* Updated south africa region for cop23 opus

* hotfix news

* updating d2 session object argument

* Linting

* fix version number

---------

Co-authored-by: Jordan <Jordan>
Co-authored-by: Fausto Lopez <92821116+flopez-bao@users.noreply.github.com>
  • Loading branch information
JordanBalesBAO and flopez-bao authored Jul 22, 2024
1 parent cae2ea0 commit 6a48fd9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
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

0 comments on commit 6a48fd9

Please sign in to comment.