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

V22 #63

Merged
merged 103 commits into from
Dec 16, 2024
Merged

V22 #63

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
5c94b2a
update requirements
robynstuart Oct 10, 2024
e1238e4
update version
robynstuart Oct 10, 2024
4ed15e5
default to define
robynstuart Oct 10, 2024
bd7afaa
add to define
robynstuart Oct 10, 2024
b0a6a7d
more nomenclature
robynstuart Oct 10, 2024
7445123
also to networks
robynstuart Oct 10, 2024
d596b99
working on test run
robynstuart Oct 10, 2024
e5af9a1
still working
robynstuart Oct 10, 2024
47ee089
switch calibration
robynstuart Oct 10, 2024
618a5ba
remove calibration
robynstuart Oct 10, 2024
5df9104
progress
robynstuart Oct 11, 2024
2a5ee56
minimal version
robynstuart Oct 11, 2024
085bf2d
change devtests
robynstuart Oct 11, 2024
ed674ff
fix warnings
robynstuart Oct 11, 2024
6504fe1
remove hiv result
robynstuart Oct 11, 2024
281bcc8
more checks
robynstuart Oct 11, 2024
860b711
more checks
robynstuart Oct 11, 2024
e148b0d
change to dur
robynstuart Oct 11, 2024
fac1764
updates to hiv intvs
robynstuart Oct 13, 2024
995e4f0
change yearvec
robynstuart Oct 13, 2024
49ca4a0
pass name
robynstuart Oct 13, 2024
73a218b
year to now
robynstuart Oct 13, 2024
f2304b4
dt changes
robynstuart Oct 13, 2024
93748bd
remove yearvec
robynstuart Oct 13, 2024
3834c90
change method name
robynstuart Oct 14, 2024
2cd0297
rerun tests
robynstuart Oct 14, 2024
f2f698f
check tests
robynstuart Oct 14, 2024
9882afd
update method names again
robynstuart Oct 14, 2024
05014b0
more updates for time
robynstuart Oct 14, 2024
ce35832
network updates
robynstuart Oct 14, 2024
e7c48a5
fixes to calibration
robynstuart Oct 14, 2024
fe23c94
modified calibration file
robynstuart Oct 14, 2024
5f16d43
remove calibration again
robynstuart Oct 14, 2024
2cb869b
remove from init
robynstuart Oct 14, 2024
e9a2407
remove par
robynstuart Oct 14, 2024
c0796c3
one more
robynstuart Oct 14, 2024
a67d3d4
fix test
robynstuart Oct 17, 2024
65cbddb
refactor base
robynstuart Oct 17, 2024
394be18
rename methods
robynstuart Oct 17, 2024
10e23c0
remove jump call
robynstuart Oct 17, 2024
f102f41
hiv results
robynstuart Oct 17, 2024
88ed89e
correct m2c
robynstuart Oct 17, 2024
a392813
year to now
robynstuart Oct 20, 2024
d182927
fixes
robynstuart Oct 20, 2024
942a3a9
change method name
robynstuart Oct 20, 2024
4fcc367
unpin starsim version
cliffckerr Nov 1, 2024
28ae575
update changelog
cliffckerr Nov 1, 2024
6fdfa33
working on timesteps
robynstuart Nov 18, 2024
aad68e4
steps
robynstuart Nov 18, 2024
c361d07
update t
robynstuart Nov 18, 2024
b5954a2
update testing
robynstuart Nov 18, 2024
704532f
restructured bv
robynstuart Nov 20, 2024
106a0be
rename module
robynstuart Nov 21, 2024
1c3e6eb
add connector
robynstuart Nov 21, 2024
acaa6f3
fixing beta
robynstuart Nov 22, 2024
b8271fd
testing
robynstuart Nov 22, 2024
188375a
change bv prob
robynstuart Nov 22, 2024
6e53970
comma
robynstuart Nov 22, 2024
3a70bff
rename par
robynstuart Nov 22, 2024
fc6dd10
stopping here
robynstuart Nov 22, 2024
c6156b8
remove transmission
robynstuart Nov 27, 2024
56c540d
fix zeros
robynstuart Nov 27, 2024
c0a667e
prepping tests
robynstuart Nov 27, 2024
be16d58
changing durs
robynstuart Nov 27, 2024
04de1d1
running tests
robynstuart Nov 27, 2024
849f7d7
put test back
robynstuart Nov 28, 2024
357e8a6
add bv hiv rel trans
robynstuart Nov 28, 2024
7025af5
remove infect class
robynstuart Nov 28, 2024
8d015b1
fix bl ct model
robynstuart Nov 28, 2024
c3682fd
tidying hiv
robynstuart Nov 29, 2024
b3806d6
rerun tests
robynstuart Nov 29, 2024
8c383dd
clean up interventions
robynstuart Dec 1, 2024
e3e0a84
tidy syphilis
robynstuart Dec 1, 2024
81ee4fc
fix syphilis bugs
robynstuart Dec 1, 2024
0e3912a
adjust acts
robynstuart Dec 2, 2024
80668b4
half life to years
robynstuart Dec 2, 2024
03f5218
find divide by zero error
robynstuart Dec 2, 2024
119be5f
tidy
robynstuart Dec 2, 2024
ea58fd1
check deaths
robynstuart Dec 2, 2024
a76380d
test hiv dynamics
robynstuart Dec 3, 2024
ca9fee7
more tests
robynstuart Dec 3, 2024
bdb4cac
speed up test
robynstuart Dec 3, 2024
db9fa1b
shorter run
robynstuart Dec 3, 2024
3e793dd
add back calibration
robynstuart Dec 3, 2024
a3ec93e
add sim export
robynstuart Dec 4, 2024
df9cc9e
add gof calcs
robynstuart Dec 4, 2024
17f95fb
deal with missing weights
robynstuart Dec 4, 2024
f4371c0
it works!
robynstuart Dec 4, 2024
70dbe2f
update versoin
robynstuart Dec 5, 2024
1af2996
update changelog
robynstuart Dec 5, 2024
e05916a
working on speedups
robynstuart Dec 9, 2024
b823da4
preserve bug
robynstuart Dec 9, 2024
cea89b1
faster version
robynstuart Dec 10, 2024
56468bd
redo durations
robynstuart Dec 12, 2024
fff5c6c
fix zeros
robynstuart Dec 12, 2024
5d33d43
add shrink method
robynstuart Dec 12, 2024
02f87be
second round
robynstuart Dec 12, 2024
4e494db
partner tally
robynstuart Dec 13, 2024
9e62c6e
tidying dists
robynstuart Dec 16, 2024
8c4079a
fix trich
robynstuart Dec 16, 2024
a94aacf
tidy test
robynstuart Dec 16, 2024
517e7f7
sti names
robynstuart Dec 16, 2024
0c54b21
finalize
robynstuart Dec 16, 2024
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
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ What's new
All notable changes to the codebase are documented in this file.


Version 1.0.0 (2024-12-11)
--------------------------
- Updates to work with Starsim v2.2.1
- *GitHub info*: PR `63 <https://github.com/starsimhub/stisim/pull/63>`_


Version 0.2.0 (2024-11-01)
--------------------------
- Updates to work with Starsim v2.0
- *GitHub info*: PR `62 <https://github.com/starsimhub/stisim/pull/62>`_


Version 0.1.0 (2024-10-02)
--------------------------
- Collection of updates related to the NG/CT/TV work
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
include_package_data=True,
classifiers=CLASSIFIERS,
install_requires=[
'starsim==1.0.3',
'starsim>=2.2.0',
'optuna',
],
)
2 changes: 1 addition & 1 deletion stisim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
print(__license__)

# Double-check key requirements -- should match setup.py
sc.require(['sciris>=3.1.6', 'pandas>=2.0.0', 'scipy', 'numba', 'networkx'], message=f'The following dependencies for STIsim {__version__} were not met: <MISSING>.')
sc.require(['starsim>=2.2.0', 'sciris>=3.1.6', 'pandas>=2.0.0', 'scipy', 'numba', 'networkx'], message=f'The following dependencies for STIsim {__version__} were not met: <MISSING>.')
del sc # Don't keep this in the module
428 changes: 254 additions & 174 deletions stisim/calibration.py

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions stisim/connectors/gud_syph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class gud_syph(ss.Connector):

def __init__(self, pars=None, **kwargs):
super().__init__(label='GUD-Syphilis', requires=[sti.GUD, sti.Syphilis])
self.default_pars(
self.define_pars(
rel_sus_syph_gud=2, # People with GUD are 2x more likely to acquire syphilis
rel_trans_syph_gud=2, # People with GUD are 2x more likely to transmit syphilis
rel_sus_gud_syph=2, # People with syphilis are 2x more likely to acquire GUD
Expand All @@ -17,9 +17,7 @@ def __init__(self, pars=None, **kwargs):

def update(self, sim):
"""
Specify GUD-syphilis interactions
Question, should this be multiplicative?
Also, it needs to be reset after infection clears/enters latency
GUD-syphilis interactions
"""
# People with GUD are more likely to acquire syphilis
sim.diseases.syphilis.rel_sus[sim.people.gud.infected] = self.pars.rel_sus_syph_gud
Expand Down
45 changes: 35 additions & 10 deletions stisim/connectors/hiv_sti.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from stisim.diseases.syphilis import SyphilisPlaceholder


__all__ = ['hiv_syph', 'hiv_tv', 'hiv_ng', 'hiv_ct']
__all__ = ['hiv_syph', 'hiv_tv', 'hiv_ng', 'hiv_ct', 'hiv_bv']


class hiv_syph(ss.Connector):
Expand All @@ -16,7 +16,9 @@ def __init__(self, hiv_module, syphilis_module, pars=None, **kwargs):

self.hiv = hiv_module
self.syphilis = syphilis_module
self.default_pars(
self.define_pars(
unit='month',

# Changes to HIV due to syphilis coinfection
rel_sus_hiv_syph=2.67, # Relative increase in susceptibility to HIV due to syphilis
rel_trans_hiv_syph=1.2, # Relative increase in transmission due to syphilis
Expand All @@ -29,7 +31,7 @@ def __init__(self, hiv_module, syphilis_module, pars=None, **kwargs):
)
self.update_pars(pars, **kwargs)

self.add_states(
self.define_states(
ss.FloatArr('rel_sus_hiv_syph', default=self.pars.rel_sus_hiv_syph),
ss.FloatArr('rel_trans_hiv_syph', default=self.pars.rel_trans_hiv_syph),
ss.FloatArr('rel_sus_syph_hiv', default=self.pars.rel_sus_syph_hiv),
Expand All @@ -40,7 +42,7 @@ def __init__(self, hiv_module, syphilis_module, pars=None, **kwargs):

return

def update(self):
def step(self):

# HIV changes due to syphilis
syphilis = self.syphilis.active
Expand Down Expand Up @@ -69,7 +71,7 @@ def __init__(self, hiv_module, tv_module, pars=None, **kwargs):

self.hiv = hiv_module
self.tv = tv_module
self.default_pars(
self.define_pars(
# Changes to HIV due to trichonomiasis coinfection
# Sources:
# - https://www.who.int/news-room/fact-sheets/detail/trichomoniasis
Expand All @@ -79,7 +81,7 @@ def __init__(self, hiv_module, tv_module, pars=None, **kwargs):
self.update_pars(pars, **kwargs)
return

def update(self):
def step(self):
tv = self.tv.infected
self.hiv.rel_sus[tv] *= self.pars.rel_sus_hiv_tv
return
Expand All @@ -92,7 +94,7 @@ def __init__(self, hiv_module, ng_module, pars=None, **kwargs):

self.hiv = hiv_module
self.ng = ng_module
self.default_pars(
self.define_pars(
# Changes to HIV due to gonorrhea coinfection
# Sources:
# - TODO
Expand All @@ -102,7 +104,7 @@ def __init__(self, hiv_module, ng_module, pars=None, **kwargs):

return

def update(self):
def step(self):
ng = self.ng.infected
self.hiv.rel_sus[ng] *= self.pars.rel_sus_hiv_ng
return
Expand All @@ -115,7 +117,7 @@ def __init__(self, hiv_module, ct_module, pars=None, **kwargs):

self.hiv = hiv_module
self.ct = ct_module
self.default_pars(
self.define_pars(
# Changes to HIV due to chlamydia coinfection
# Sources:
# - TODO
Expand All @@ -125,8 +127,31 @@ def __init__(self, hiv_module, ct_module, pars=None, **kwargs):

return

def update(self):
def step(self):
ct = self.ct.infected
self.hiv.rel_sus[ct] *= self.pars.rel_sus_hiv_ct
return


class hiv_bv(ss.Connector):

def __init__(self, hiv_module, bv_module, pars=None, **kwargs):
super().__init__()

self.hiv = hiv_module
self.bv = bv_module
self.define_pars(
# Changes to HIV due to BV
rel_sus_hiv_bv=2, # PLACEHOLDER: BV leads to 2x risk of HIV acquisition
rel_trans_hiv_bv=2, # PLACEHOLDER: BV leads to 2x risk of HIV transmission
)
self.update_pars(pars, **kwargs)

return

def step(self):
bv = self.bv.infected
self.hiv.rel_trans[bv] *= self.pars.rel_trans_hiv_bv
self.hiv.rel_sus[bv] *= self.pars.rel_sus_hiv_bv
return

2 changes: 1 addition & 1 deletion stisim/diseases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Individual diseases
from .chlamydia import *
from .discharging_sti import *
from .bv import *
from .gonorrhea import *
from .gud import *
from .hiv import *
Expand Down
Loading
Loading