Source code for emodpy_hiv.demographics.assortivity
fromtypingimportList,Dictfromemod_api.demographics.UpdateableimportUpdateable# TODO: should we drop NO_GROUP support altogether? If so, group is always INDIVIDUAL_PROPERTY and the instantiation# argument should be removed. If NOT, then we need to ensure that an inconsistent state is not possible if calling# code toggles "things" e.g. group = 'NO_GROUP' and property_name = 'Risk'# https://github.com/InstituteforDiseaseModeling/emodpy-hiv/issues/216
[docs]classAssortivity(Updateable):def__init__(self,matrix:List[List[float]]=None,group:str="INDIVIDUAL_PROPERTY"):super().__init__()self.axes=['LOW','MEDIUM','HIGH']self.group=groupself.property_name='Risk'self.matrix=matrix# a None matrix is valid if group is 'NO_GROUP'