Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcleod89 committed Oct 3, 2024
1 parent c516686 commit 3e42c5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/hivpy/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ class SexType(IntEnum):
def opposite_sex(sex: SexType):
return (1 - sex)


def sub_pop_ratio(sp1, sp2):
if len(sp2) == 0:
return 0
else:
return len(sp1) / len(sp2)


def safe_ratio(n1, n2):
if n2 == 0:
return 0
else:
return n1/n2


class date:
def __init__(self, year, month=1, day=1):
self.year = year
Expand Down
5 changes: 3 additions & 2 deletions src/hivpy/hiv_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import hivpy.column_names as col

from . import output
from .common import AND, COND, SexType, opposite_sex, rng, timedelta, safe_ratio
from .common import (AND, COND, SexType, opposite_sex, rng, safe_ratio,
timedelta)


class HIVStatusModule:
Expand Down Expand Up @@ -119,7 +120,7 @@ def init_HIV_variables(self, population: Population):
population.init_variable(col.VIRAL_LOAD, 0.0)
population.init_variable(col.VIRAL_SUPPRESSION, False)
population.init_variable(col.X4_VIRUS, False)

# TODO: move to ART module
population.init_variable(col.ON_ART, False)

Expand Down

0 comments on commit 3e42c5f

Please sign in to comment.