Skip to content

Commit

Permalink
Added get_XH and get_MYZ; conventional output location for xde_solve_…
Browse files Browse the repository at this point in the history
…cohort
  • Loading branch information
smitdave committed Oct 14, 2024
1 parent 78600d3 commit e5bc4fc
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 5 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,12 @@ export(get_EIR)
export(get_H)
export(get_Linits)
export(get_Lpars)
export(get_MYZ)
export(get_MYZinits)
export(get_MYZpars)
export(get_Omega)
export(get_Upsilon)
export(get_XH)
export(get_Xinits)
export(get_Xpars)
export(get_bionomics)
Expand Down
23 changes: 23 additions & 0 deletions R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,26 @@ get_terms <- function(tm, de_vars, pars) {
get_EIR = function(pars, i){
pars$outputs$terms$EIR
}

#' @title Get **XH** outputs
#' @param pars an **`xds`** object
#' @param i the host species index
#' @export
get_XH = function(pars, i=1){
got = pars$outputs$orbits$XH[[i]]
got$time = pars$outputs$orbits$time
got$eir = pars$outputs$terms$EIR[[i]]
return(got)
}

#' @title Get **MYZ** outputs
#' @param pars an **`xds`** object
#' @param s the vector species index
#' @export
get_MYZ = function(pars, s=1){
got = pars$outputs$orbits$MYZ[[s]]
got$time = pars$outputs$orbits$time
got$kappa = pars$outputs$terms$kappa[[s]]
return(got)
}

1 change: 1 addition & 0 deletions R/outputs-get.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get_EIR
5 changes: 3 additions & 2 deletions R/xde_cohort.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ xds_solve_cohort = function(pars, bday=0, A = 10, da = 10){
pars$outputs$last_y <- tail(de_vars, 1)
pars$outputs$orbits$age <- age
pars$outputs$orbits$time <- age+bday
pars$outputs$orbits$terms <- list()
pars$outputs$orbits$terms$EIR<- with(pars, F_eir(age, bday))
pars$outputs$terms <- list()
pars$outputs$terms$EIR <- list()
pars$outputs$terms$EIR[[1]] <- with(pars, F_eir(age, bday))
return(pars)
}

Expand Down
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ reference:
- parse_y
- get_inits
- get_H
- get_XH
- get_MYZ
- make_indices
- trigger_setup
- subtitle: Examine
Expand Down
4 changes: 1 addition & 3 deletions docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ articles:
Contributing: Contributing.html
ex_534: ex_534.html
Exposure: Exposure.html
Forcing: Forcing.html
GettingStarted: GettingStarted.html
History: History.html
human_hmoi: human_hmoi.html
Expand All @@ -23,9 +22,8 @@ articles:
SpatialTransmissionDynamics: SpatialTransmissionDynamics.html
TraceFunctions: TraceFunctions.html
Understanding_ramp.xds: Understanding_ramp.xds.html
VectorControl: VectorControl.html
Working: Working.html
last_built: 2024-10-09T14:34Z
last_built: 2024-10-14T15:07Z
urls:
reference: https://dd-harp.github.io/ramp.xds/reference
article: https://dd-harp.github.io/ramp.xds/articles
Expand Down
8 changes: 8 additions & 0 deletions docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions man/get_MYZ.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions man/get_XH.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed tests/testthat/.test-metrics.R.swp
Binary file not shown.

0 comments on commit e5bc4fc

Please sign in to comment.