optimamodel / optima

Optima HIV software tool
http://optimamodel.com
GNU Lesser General Public License v3.0
7 stars 1 forks source link

Prop bump fix #1740

Closed cliffckerr closed 6 years ago

cliffckerr commented 6 years ago

@robynstuart pls review, code for testing:

from optima import demo, pygui, Parscen
P = demo(0)

startyear = 2020
endyear = 2025

P.pars()['force'].y[:] *= 0.6
P.pars()['popsize'].i[:] *= 2

P.copyparset('default','notfixed')
P.parset('notfixed').fixprops(False)

scenlist = [
            Parscen(name='Baseline', parsetname='default', pars=[]),
            Parscen(name='Not fixed', parsetname='notfixed', pars=[]),
            Parscen(name='95-N/A-99',
                  parsetname=0,
                  pars=[
                  {'name': 'propdx',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': 0.95,
                  },
                  {'name': 'propsupp',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': .99,
                  },
                  ]),
           Parscen(name='95-95-99',
                  parsetname=0,
                  pars=[
                  {'name': 'propdx',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': 0.95,
                  },
                  {'name': 'proptx',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': 0.95,
                  },
                  {'name': 'propsupp',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': .99,
                  },
                  ]),
                  ]

P.addscens(scenlist)
P.runscenarios(keepraw=True)
pygui(P, toplot=['cascade', 'numtreat', 'numdiag', 'numnewdiag'])