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 #192

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Dev #192

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ S3method(IRSEffectSizes,none)
S3method(LBaseline,basicL)
S3method(LBaseline,trivial)
S3method(LBionomics,basicL)
S3method(LBionomics,static)
S3method(LBionomics,trivial)
S3method(LSM,none)
S3method(MBaseline,GeRM)
Expand All @@ -108,7 +107,6 @@ S3method(MBionomics,GeRM)
S3method(MBionomics,SI)
S3method(MBionomics,basicM)
S3method(MBionomics,macdonald)
S3method(MBionomics,static)
S3method(MBionomics,trivial)
S3method(MassHealth,none)
S3method(OtherBloodHosts,static)
Expand Down Expand Up @@ -231,12 +229,6 @@ S3method(make_function,sharkfin)
S3method(make_function,sigmoid)
S3method(make_function,sin)
S3method(make_function,sum)
S3method(make_indices_MYZ,GeRM)
S3method(make_indices_MYZ,RM_dts)
S3method(make_indices_MYZ,SI)
S3method(make_indices_MYZ,basicM)
S3method(make_indices_MYZ,macdonald)
S3method(make_indices_MYZ,trivial)
S3method(make_runtime,dts)
S3method(make_runtime,xde)
S3method(parse_Lorbits,basicL)
Expand Down Expand Up @@ -277,6 +269,8 @@ S3method(set_eir,cohort)
S3method(setup_EIP,fixedlag_dts)
S3method(setup_Linits,basicL)
S3method(setup_Linits,trivial)
S3method(setup_Lix,basicL)
S3method(setup_Lix,trivial)
S3method(setup_Lpar,basicL)
S3method(setup_Lpar,trivial)
S3method(setup_MYZinits,GeRM)
Expand All @@ -285,17 +279,23 @@ S3method(setup_MYZinits,SI)
S3method(setup_MYZinits,basicM)
S3method(setup_MYZinits,macdonald)
S3method(setup_MYZinits,trivial)
S3method(setup_MYZix,GeRM)
S3method(setup_MYZix,RM_dts)
S3method(setup_MYZix,SI)
S3method(setup_MYZix,basicM)
S3method(setup_MYZix,macdonald)
S3method(setup_MYZix,trivial)
S3method(setup_MYZpar,GeRM)
S3method(setup_MYZpar,SI)
S3method(setup_MYZpar,basicM)
S3method(setup_MYZpar,macdonald)
S3method(setup_MYZpar,trivial)
S3method(setup_X_indices,SIS)
S3method(setup_X_indices,hMoI)
S3method(setup_X_indices,trivial)
S3method(setup_Xinits,SIS)
S3method(setup_Xinits,hMoI)
S3method(setup_Xinits,trivial)
S3method(setup_Xix,SIS)
S3method(setup_Xix,hMoI)
S3method(setup_Xix,trivial)
S3method(setup_Xpar,SIS)
S3method(setup_Xpar,hMoI)
S3method(setup_Xpar,trivial)
Expand All @@ -306,8 +306,6 @@ S3method(setup_exposure_pois,dts)
S3method(setup_exposure_pois,xde)
S3method(setup_humidity,func)
S3method(setup_hydrology,func)
S3method(setup_indices_L,basicL)
S3method(setup_indices_L,trivial)
S3method(setup_rainfall,func)
S3method(setup_shock,func)
S3method(setup_temperature,func)
Expand Down Expand Up @@ -531,7 +529,6 @@ export(make_calU)
export(make_eggs_laid)
export(make_function)
export(make_indices)
export(make_indices_MYZ)
export(make_kappa)
export(make_local_frac)
export(make_parameters_demography_null)
Expand Down Expand Up @@ -570,12 +567,14 @@ export(setup_EGG_LAYING)
export(setup_EIP)
export(setup_Hpar_static)
export(setup_Linits)
export(setup_Lix)
export(setup_Lpar)
export(setup_MYZinits)
export(setup_MYZix)
export(setup_MYZpar)
export(setup_TRANSMISSION)
export(setup_X_indices)
export(setup_Xinits)
export(setup_Xix)
export(setup_Xpar)
export(setup_care_seeking_no_behavior)
export(setup_development)
Expand All @@ -589,7 +588,6 @@ export(setup_humidity)
export(setup_humidity_func)
export(setup_hydrology)
export(setup_hydrology_func)
export(setup_indices_L)
export(setup_no_active_case_detection)
export(setup_no_area_spray)
export(setup_no_bednets)
Expand Down
6 changes: 3 additions & 3 deletions R/adult-GeRM.R
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,12 @@ xde_steady_state_MYZ.GeRM = function(Lambda, kappa, MYZpar){with(MYZpar,{


#' @title Add indices for adult mosquitoes to parameter list
#' @description Implements [make_indices_MYZ] for the GeRM model.
#' @inheritParams make_indices_MYZ
#' @description Implements [setup_MYZix] for the GeRM model.
#' @inheritParams setup_MYZix
#' @return a [list]
#' @importFrom utils tail
#' @export
make_indices_MYZ.GeRM <- function(pars, s) {with(pars,{
setup_MYZix.GeRM <- function(pars, s) {with(pars,{

M_ix <- seq(from = max_ix+1, length.out=nPatches)
max_ix <- tail(M_ix, 1)
Expand Down
6 changes: 3 additions & 3 deletions R/adult-RM-dts.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ make_MYZinits_RM_dts = function(nPatches, max_eip, MYZopts = list(),


#' @title Add indices for adult mosquitoes to parameter list
#' @description Implements [make_indices_MYZ] for the RM_dts model.
#' @inheritParams make_indices_MYZ
#' @description Implements [setup_MYZix] for the RM_dts model.
#' @inheritParams setup_MYZix
#' @return a [list]
#' @importFrom utils tail
#' @export
make_indices_MYZ.RM_dts <- function(pars, s) {with(pars,{
setup_MYZix.RM_dts <- function(pars, s) {with(pars,{

M_ix <- seq(from = max_ix+1, length.out=nPatches)
max_ix <- tail(M_ix, 1)
Expand Down
6 changes: 3 additions & 3 deletions R/adult-basicM.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ set_MYZpars.GeRM <- function(pars, s=1, MYZopts=list()) {
}))}

#' @title Add indices for adult mosquitoes to parameter list
#' @description Implements [make_indices_MYZ] for the basic M model.
#' @inheritParams make_indices_MYZ
#' @description Implements [setup_MYZix] for the basic M model.
#' @inheritParams setup_MYZix
#' @return none
#' @importFrom utils tail
#' @export
make_indices_MYZ.basicM <- function(pars, s) {with(pars,{
setup_MYZix.basicM <- function(pars, s) {with(pars,{

M_ix <- seq(from = max_ix+1, length.out = nPatches)
max_ix <- tail(M_ix, 1)
Expand Down
4 changes: 2 additions & 2 deletions R/adult-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ set_MYZinits <- function(pars, s=1, MYZopts=list()) {
#' @param s the species index
#' @return [list]
#' @export
make_indices_MYZ <- function(pars, s) {
UseMethod("make_indices_MYZ", pars$MYZpar[[s]])
setup_MYZix <- function(pars, s) {
UseMethod("setup_MYZix", pars$MYZpar[[s]])
}

#' @title Parse the outputs and return the variables by name in a list
Expand Down
6 changes: 3 additions & 3 deletions R/adult-macdonald.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ xde_steady_state_MYZ.macdonald = function(Lambda, kappa, MYZpar){with(MYZpar,{


#' @title Add indices for adult mosquitoes to parameter list
#' @description Implements [make_indices_MYZ] for the macdonald model.
#' @inheritParams make_indices_MYZ
#' @description Implements [setup_MYZix] for the macdonald model.
#' @inheritParams setup_MYZix
#' @return a [list]
#' @importFrom utils tail
#' @export
make_indices_MYZ.macdonald <- function(pars, s) {with(pars,{
setup_MYZix.macdonald <- function(pars, s) {with(pars,{

M_ix <- seq(from = max_ix+1, length.out=nPatches)
max_ix <- tail(M_ix, 1)
Expand Down
6 changes: 3 additions & 3 deletions R/adult-si.R
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ put_MYZvars.SI <- function(MYZvars, y, pars, s){
}

#' @title Add indices for adult mosquitoes to parameter list
#' @description Implements [make_indices_MYZ] for the `SI` model.
#' @inheritParams make_indices_MYZ
#' @description Implements [setup_MYZix] for the `SI` model.
#' @inheritParams setup_MYZix
#' @return a [list]
#' @importFrom utils tail
#' @export
make_indices_MYZ.SI <- function(pars, s) {with(pars,{
setup_MYZix.SI <- function(pars, s) {with(pars,{

M_ix <- seq(from = max_ix+1, length.out=nPatches)
max_ix <- tail(M_ix, 1)
Expand Down
6 changes: 3 additions & 3 deletions R/adult-trivial.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ setup_MYZinits.trivial = function(pars, s, MYZopts=NULL){
}

#' @title Add indices for aquatic stage mosquitoes to parameter list
#' @description Implements [make_indices_MYZ] for trivial (forced emergence) model.
#' @inheritParams make_indices_MYZ
#' @description Implements [setup_MYZix] for trivial (forced emergence) model.
#' @inheritParams setup_MYZix
#' @return none
#' @export
make_indices_MYZ.trivial <- function(pars, s) {
setup_MYZix.trivial <- function(pars, s) {
return(pars)
}

Expand Down
26 changes: 13 additions & 13 deletions R/aquatic-basicL.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,25 @@ update_Linits.basicL <- function(pars, y, s) {
return(pars)
}


#' @title Set **L** Component Initial Values
#' @param pars an **`xds`** object
#' @param s the vector species index
#' @param Lopts a named list
#' @return an `xds` object
#' @export
set_Linits <- function(pars, s=1, Lopts=list()) {
UseMethod("set_Linits", pars$Lpar[[s]])
}

#' @title Setup Variable Indices for `basicL` (**L** Component)
#' @description Set the values of the indices for the **L** component variables
#' for the `basicL` module
#' @inheritParams setup_indices_L
#' @inheritParams setup_Lix
#' @return an **`xds`** object
#' @importFrom utils tail
#' @export
setup_indices_L.basicL <- function(pars, s) {with(pars,{
setup_Lix.basicL <- function(pars, s) {with(pars,{

L_ix <- seq(from = max_ix+1, length.out = nHabitats)
max_ix <- tail(L_ix, 1)
Expand All @@ -274,17 +285,6 @@ parse_Lorbits.basicL <- function(outputs, pars, s) {
return(list(L=L))
}


#' @title Set **L** Component Initial Values
#' @param pars an **`xds`** object
#' @param s the vector species index
#' @param Lopts a named list
#' @return an `xds` object
#' @export
set_Linits <- function(pars, s=1, Lopts=list()) {
UseMethod("set_Linits", pars$Lpar[[s]])
}

#' @title Compute the Steady State of `dLdt.basicL` (**L** Component)
#' @description Given an egg deposition rate `eta,`
#' return a steady state value for the equations in [dLdt.basicL]
Expand Down
4 changes: 2 additions & 2 deletions R/aquatic-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ update_Linits <- function(pars, y, s) {
#' @param s the species index
#' @return an **`xds`** object
#' @export
setup_indices_L <- function(pars, s) {
UseMethod("setup_indices_L", pars$Lpar[[s]])
setup_Lix <- function(pars, s) {
UseMethod("setup_Lix", pars$Lpar[[s]])
}

#' @title Parse **L** Component Outputs
Expand Down
6 changes: 3 additions & 3 deletions R/aquatic-trivial.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ update_Linits.trivial<- function(pars, y, s) {
}

#' @title Setup Variable Indices for `trivial` (**L** Component)
#' @description Implements [setup_indices_L] for trivial (forced emergence) model.
#' @inheritParams setup_indices_L
#' @description Implements [setup_Lix] for trivial (forced emergence) model.
#' @inheritParams setup_Lix
#' @return an **`xds`** object
#' @export
setup_indices_L.trivial <- function(pars, s) {
setup_Lix.trivial <- function(pars, s) {
return(pars)
}

Expand Down
18 changes: 0 additions & 18 deletions R/bionomics.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,3 @@ Bionomics <- function(t, y, pars){
}
return(pars)
}

#' @title Set mosquito bionomics to baseline
#' @description Implements [MBionomics] for models with no forcing
#' @inheritParams MBionomics
#' @return an `xds` object
#' @export
MBionomics.static <- function(t, y, pars, s) {
return(pars)
}

#' @title Set mosquito bionomics to baseline
#' @description Implements [LBionomics] for models with no forcing
#' @inheritParams LBionomics
#' @return the model as a [list]
#' @export
LBionomics.static <- function(t, y, pars, s) {
return(pars)
}
6 changes: 3 additions & 3 deletions R/human-SIS.R
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ get_Xinits.SIS <- function(pars, i=1){pars$Xinits[[i]]}


#' @title Add indices for human population to parameter list
#' @description Implements [setup_X_indices] for the SIS model.
#' @inheritParams setup_X_indices
#' @description Implements [setup_Xix] for the SIS model.
#' @inheritParams setup_Xix
#' @return none
#' @importFrom utils tail
#' @export
setup_X_indices.SIS <- function(pars, i) {with(pars,{
setup_Xix.SIS <- function(pars, i) {with(pars,{

S_ix <- seq(from = max_ix+1, length.out=nStrata[i])
max_ix <- tail(S_ix, 1)
Expand Down
6 changes: 3 additions & 3 deletions R/human-hMoI.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ HTC.hMoI <- function(pars, i) {
}

#' @title Add indices for human population to parameter list
#' @description Implements [setup_X_indices] for the hybrid MoI model.
#' @inheritParams setup_X_indices
#' @description Implements [setup_Xix] for the hybrid MoI model.
#' @inheritParams setup_Xix
#' @return none
#' @importFrom utils tail
#' @export
setup_X_indices.hMoI <- function(pars, i) {with(pars,{
setup_Xix.hMoI <- function(pars, i) {with(pars,{
m1_ix <- seq(from = max_ix+1, length.out=nStrata[i])
max_ix <- tail(m1_ix, 1)

Expand Down
4 changes: 2 additions & 2 deletions R/human-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ setup_Xinits = function(pars, H, i, Xopts=list()){
#' @param i the host species index
#' @return an **`xds`** object
#' @export
setup_X_indices <- function(pars, i) {
UseMethod("setup_X_indices", pars$Xpar[[i]])
setup_Xix <- function(pars, i) {
UseMethod("setup_Xix", pars$Xpar[[i]])
}

#' @title Return the variables as a list
Expand Down
6 changes: 3 additions & 3 deletions R/human-trivial.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ setup_Xinits.trivial = function(pars, H, i, Xopts=list()){
}

#' @title Add indices for human population to parameter list
#' @description Implements [setup_X_indices] for the trivial model.
#' @inheritParams setup_X_indices
#' @description Implements [setup_Xix] for the trivial model.
#' @inheritParams setup_Xix
#' @return none
#' @importFrom utils tail
#' @export
setup_X_indices.trivial <- function(pars, i) {
setup_Xix.trivial <- function(pars, i) {
return(pars)
}

Expand Down
6 changes: 3 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ make_indices <- function(pars) {
s = length(pars$Linits)
if(s>0)
for(ix in 1:s)
pars = setup_indices_L(pars, ix)
pars = setup_Lix(pars, ix)

s = length(pars$MYZinits)
if(s>0)
for(ix in 1:s)
pars = make_indices_MYZ(pars, ix)
pars = setup_MYZix(pars, ix)

i = length(pars$Xinits)
if(i>0)
for(ix in 1:i)
pars = setup_X_indices(pars, ix)
pars = setup_Xix(pars, ix)

return(pars)
}
Expand Down
Loading