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

Dev hiv ped 24 #31

Draft
wants to merge 63 commits into
base: master
Choose a base branch
from
Draft

Dev hiv ped 24 #31

wants to merge 63 commits into from

Conversation

mwalte10
Copy link
Collaborator

#24

Set up storage for stratified population of pediatric HIV (hivstrat_paeds). Have aging mapped out as well, but will wait to confirm that that is working as expected until natural deaths are working appropriately.

It looks like for nosocomial infections in spectrum all infections are put in the highest CD4 category at initial distribution, I've replicated that here.

maggie and others added 30 commits June 27, 2022 16:03
…ecks can be run repeatedly on different build ups of the model
This reverts commit b9eca1c.
…s like its in remotes so hoping that works"

This reverts commit af795b6.
…ey are calculated from this population, need to add in births from hiv pos moms
…fs and changed them to args to the function. Going to add these to the readme
@mwalte10
Copy link
Collaborator Author

Also, have commented out the transmission matches tests because of the connection with demographics not matching (bc aging / natural deaths not integrated)

v$paed_incid_input <- projp$nosocom_infections_04
## Hardcoded, this is putting all individuals in the highest cd4 category bc i think thats how the nosocomial infections work
## v$paed_cd4_dist <- c(0.6, 0.12, 0.1, 0.09, 0.05, 0.03, 0.01)
v$paed_cd4_dist <- c(1, 0, 0, 0, 0, 0, 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jeffeaton Looks like the nosocomial infections are all distributed into the first cd4 category, which isn't as ideal for testing this integration. Right now I'm just mirroring that


double dt = 1.0 / hiv_steps_per_year;

// demography
const TensorMapX2cT basepop(p_basepop, pAG, NG);
const TensorMapX3cT basepop(p_basepop, pAG, NG, sim_years);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding in sim_years so that the pop adjust step can be done at the end of the loop

//distribute across eligible ages, right now just going to hardcode
for(int g = 0; g < NG; g++){
for(int af = 0; af < 5; af++){
infections(af, g, t) = paed_incid_input(t) / 10;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will need to be changed when distributing across ages correctly, matching nosocomial infections structure rn

@mwalte10
Copy link
Collaborator Author

@r-ash, I'm not sure why these checks are now failing. To me it looks like there are just warnings. Do you see anything I should change?

@r-ash
Copy link

r-ash commented Aug 15, 2022

@r-ash, I'm not sure why these checks are now failing. To me it looks like there are just warnings. Do you see anything I should change?

You're right they are just warnings, current settings are to fail on warning and it is worth fixing warnings. Best to fix them by qualifying calls to unzip as utils::unzip, read.csv as read.csv and utils::read.csv and setNames as stats::setNames to avoid any ambiguity about what package the functions are from.

@mwalte10
Copy link
Collaborator Author

Looks like it isn't liking the ::: import of an internal function, I found this but not quite sure how to implement drsimonj/twidlr#16 @r-ash @jeffeaton

Also: https://stackoverflow.com/questions/2675502/what-does-the-symbol-mean-in-r

@r-ash
Copy link

r-ash commented Aug 18, 2022

Looks like it isn't liking the ::: import of an internal function, I found this but not quite sure how to implement drsimonj/twidlr#16 @r-ash @jeffeaton

Also: https://stackoverflow.com/questions/2675502/what-does-the-symbol-mean-in-r

As the packages it is complaining about are under our control we can choose to export those functions.

‘epp:::.parse_array’ - @jeffeaton can we export this?

eppasm:::create_beers - @jeffeaton can we export this? Or use an already exported function from https://github.com/mrc-ide/beers ?

If these aren't really things we don't want to export we could refactor some of this into a helper package which we then use here and elsewhere. That is a bit more faff than you probably want though so we can turn off fail on warning if this really is a pain.

@jeffeaton
Copy link
Collaborator

Thanks @r-ash, sorry had parallel discussions going on this.

The ::: issue is not new and itself only gives a note (but yes we should resolve them).

What has escalated it to a Warning is pulling in the read-spectrum-files.R script, which references a bunch of packages that are not declared in Imports:, e.g. abind here: https://github.com/mrc-ide/leapfrog/blob/dev_hiv_ped_24/R/read-spectrum-files.R#L1073

@mwalte10 -- let's chat about if we want to copy that full script in.

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.

3 participants