Skip to content

I1738 #18

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

I1738 #18

wants to merge 13 commits into from

Conversation

xiangli313
Copy link
Contributor

Youtrack:
https://vimc.myjetbrains.com/youtrack/issue/VIMC-1738

Task:
This PR has two major tasks.

  1. modup method 1 - this is for a specific modup 201310gavi-201403gavi
  2. modup method 2 - version 2 - this is to get version 2 gavi impact through filtering by per-year-gavi-level from total impact.

Tested:
I will double test the changes made in this PR with a few orderly reports before coming to you.

@xiangli313 xiangli313 self-assigned this May 29, 2018
@xiangli313 xiangli313 requested a review from richfitz May 29, 2018 10:29
@xiangli313
Copy link
Contributor Author

Hi @richfitz, do you have time for this PR this week?

Copy link
Member

@richfitz richfitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had got part way through this last week - can you look at the comments below and we'll get this done this week

##' @export
modified_update_calculate <- function(con, touchstone_name_mod, touchstone_use) {
modified_update_calculate <- function(con, touchstone_name_mod, touchstone_use, method = "method2", version = "v2") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing with method and version both containing version numbers and version being numeric but stored as a character. Can you write a list of the versions somewhere so we can see how this might be simplified?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Documented in the beginning of this function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I should have been clearer: version = "v2" is pretty confusing - if you want to have a numeric version and numeric methods, why not go with version = 2? And is method2/version2 not more reasonably just method = "method3" which could also be spelt as method = 3?

Copy link
Contributor Author

@xiangli313 xiangli313 Jun 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that we are already talking about method 3 elsewhere (although not yet developed). Shall we go with method = 2 and version = 2 ?

sql <- paste("SELECT *",
" FROM touchstone",
" WHERE touchstone_name = $1",
sep = "\n")
touchstone_mod <- DBI::dbGetQuery(con, sql, touchstone_name_mod)
i <- touchstone_mod$id != '201510gavi-42'
touchstone_mod <- touchstone_mod[which.max(touchstone_mod$version[i]), ]
i <- touchstone_mod$id != '201510gavi-42'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document the significance of this touchstone?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documented above this line of code.

dat <- merge_in(dat, mu_fix_coverage(d_cov_new),
c(coverage_new = "coverage",
coverage_target_new = "target",
gavi_support_new = "gavi_support"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this is a diff artefact but this closing brace being missing in the new version seems surprising (use side-by-side diff, ignoring whitespace)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing brace } is not missing, but moved to the line before dat <- merge)in(...). It is not making any difference actually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for clarification


ret <- fvps_new * rate_tot_old
mu_scale <- function(name, d, method = "method2") {
## This chunck becomes simpler, since only method 2 is used throughout. - Not any more, we need method 1 now.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rewrite this comment to describe only the new code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

meta$data <- data

if(version == "v2") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry to be pedantic, but can you keep a space between if and ( here and elsewhere (similarly for for, etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here and else where.

Copy link
Contributor Author

@xiangli313 xiangli313 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@xiangli313
Copy link
Contributor Author

I have done detailed checking. It is not possible to deal with version = 2 here (countries that have both gavi/non-gavi campaigns in the same year). I have resolved the problem in my preparation for the mid-july modup. I need to remove all version = 2 things here.

@xiangli313
Copy link
Contributor Author

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants