Skip to content

I1738#18

Open
xiangli313 wants to merge 13 commits intomasterfrom
i1738
Open

I1738#18
xiangli313 wants to merge 13 commits intomasterfrom
i1738

Conversation

@xiangli313
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ?

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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