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

Closed cliffckerr closed 6 years ago

cliffckerr commented 6 years ago

@robynstuart pls review, running on sandbox, fixes:

code i used to test the prop thing:

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

startyear = 2018
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='90-90',
                  parsetname=0,
                  pars=[
                  {'name': 'propdx',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': 0.9,
                  },
                  {'name': 'propsupp',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': .99,
                  },
                  ]),
           Parscen(name='90-90-90',
                  parsetname=0,
                  pars=[
                  {'name': 'propdx',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': 0.9,
                  },
                  {'name': 'proptx',
                  'for': ['tot'],
                  'startyear': startyear,
                  'endyear': endyear,
                  'startval': None,
                  'endval': 0.9,
                  },
                  {'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'])