diff --git a/inputs/en/demo_national_input.xlsx b/inputs/en/demo_national_input.xlsx index a9abea9b..b821a090 100644 Binary files a/inputs/en/demo_national_input.xlsx and b/inputs/en/demo_national_input.xlsx differ diff --git a/nutrition/data.py b/nutrition/data.py index 7d04caf5..5d340a4d 100644 --- a/nutrition/data.py +++ b/nutrition/data.py @@ -318,7 +318,7 @@ def get_risk_dist(self): # self.calcscache.write_row('Nutritional status distribution', 14, 2, anaem[:]) # for age, prev in anaem.items(): # Should work with commented out code above - for age, prev in anaem.iteritems(): + for age, prev in anaem.items(): self.risk_dist[_("Anaemia")][age] = dict() self.risk_dist[_("Anaemia")][age][_("Anaemic")] = prev self.risk_dist[_("Anaemia")][age][_("Not anaemic")] = 1.0 - prev @@ -625,6 +625,8 @@ def make_dict2(self, mydict): for condCat in mydict[age].keys(): cond = condCat[0] cat = condCat[1] + if type(cat) == float: + cat = "None" if res_dict[age].get(cat) is None: res_dict[age][cat] = dict() # CK TEST res_dict[age][cat][cond] = mydict[age][condCat] @@ -639,6 +641,8 @@ def make_dict3(self, mydict): res_dict[age] = sc.odict() for condCat in mydict[age].keys(): cat = condCat[1] + if type(cat) == float: + cat = "None" if res_dict[age].get(cat) is None: res_dict[age][cat] = mydict[age][condCat] return res_dict @@ -1237,6 +1241,8 @@ def make_dict2(self, mydict): for condCat in mydict[age].keys(): cond = condCat[0] cat = condCat[1] + if type(cat) == float: + cat = "None" if res_dict[age].get(cat) is None: res_dict[age][cat] = dict() # CK TEST res_dict[age][cat][cond] = mydict[age][condCat] @@ -1251,6 +1257,8 @@ def make_dict3(self, mydict): res_dict[age] = sc.odict() for condCat in mydict[age].keys(): cat = condCat[1] + if type(cat) == float: + cat = "None" if res_dict[age].get(cat) is None: res_dict[age][cat] = mydict[age][condCat] return res_dict diff --git a/nutrition/programs.py b/nutrition/programs.py index d99d371f..5fd43d9f 100644 --- a/nutrition/programs.py +++ b/nutrition/programs.py @@ -297,8 +297,8 @@ def _wasting_prev_update(self, age_group): # If SAM treatment is extended to MAM, then the coverage refers to SAM children, who are only a fraction of MAM children newcov = min(1, self.annual_unrestr_cov[self.year] * age_group.frac_wasted(_('SAM')) / age_group.frac_wasted(_('MAM'))) newProb = get_new_prob(newcov, probWastedIfCovered, probWastedIfNotCovered) - print(self.year, age_group.age, newcov, probWastedIfCovered, newProb, oldProb, - sc.safedivide(oldProb - newProb, oldProb, default=0.0), probWastedIfCovered - probWastedIfNotCovered) + # print(self.year, age_group.age, newcov, probWastedIfCovered, newProb, oldProb, + # sc.safedivide(oldProb - newProb, oldProb, default=0.0), probWastedIfCovered - probWastedIfNotCovered) else: newcov = self.annual_unrestr_cov[self.year] newProb = get_new_prob(newcov, probWastedIfCovered, probWastedIfNotCovered) diff --git a/tests/scen_results_test.xlsx b/tests/scen_results_test.xlsx index 46940bf4..6426b3d7 100644 Binary files a/tests/scen_results_test.xlsx and b/tests/scen_results_test.xlsx differ diff --git a/tests/test.prj b/tests/test.prj index d9c7ebc4..d5d1c953 100644 Binary files a/tests/test.prj and b/tests/test.prj differ diff --git a/tests/testdemo.py b/tests/testdemo.py index 28682f78..d32f49c1 100644 --- a/tests/testdemo.py +++ b/tests/testdemo.py @@ -5,9 +5,9 @@ import nutrition.ui as nu do_plot = True -run_scen = False -run_optim = True -run_geo = False +run_scen = True +run_optim = False +run_geo = True P = nu.demo(scens=run_scen, optims=run_optim, geos=run_geo)