|
17 | 17 | p = nu.Project("eg")
|
18 | 18 | p.load_data("demo", "national", name="eg")
|
19 | 19 |
|
20 |
| -### define custom scenarios |
21 |
| -kwargs1 = {"name": "Treat SAM 100%", "model_name": "eg", "scen_type": "coverage", "progvals": sc.odict({"Treatment of SAM": [0.9, 0.5, 0.8]}), "growth": "fixed coverage", "enforce_constraints_year": 1} |
| 20 | +# ### define custom scenarios |
| 21 | +# kwargs1 = {"name": "Treat SAM 100%", "model_name": "eg", "scen_type": "coverage", "progvals": sc.odict({"Treatment of SAM": [0.9, 0.5, 0.8]}), "growth": "fixed coverage", "enforce_constraints_year": 1} |
22 | 22 |
|
23 |
| -kwargs2 = sc.dcp(kwargs1) |
24 |
| -kwargs2.update({"name": "IYCF 1 100%", "progvals": sc.odict({"Small quantity lipid-based nutrition supplements": [1]})}) |
| 23 | +# kwargs2 = sc.dcp(kwargs1) |
| 24 | +# kwargs2.update({"name": "IYCF 1 100%", "progvals": sc.odict({"Small quantity lipid-based nutrition supplements": [1]})}) |
25 | 25 |
|
26 |
| -kwargs3 = {"name": "IYCF at $10 mil", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({"IYCF 1": [1e8, 2e8, 1.5e8, 2.5e8], "IPTp": [2e7, 2.8e7, 2.8e7, 4.25e7]}), "growth": "fixed coverage", "enforce_constraints_year": 1} |
| 26 | +# kwargs3 = {"name": "IYCF at $10 mil", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({"IYCF 1": [1e8, 2e8, 1.5e8, 2.5e8], "IPTp": [2e7, 2.8e7, 2.8e7, 4.25e7]}), "growth": "fixed coverage", "enforce_constraints_year": 1} |
27 | 27 |
|
28 |
| -### testing FE bugs |
29 |
| -kwargs4 = {"name": "FE check 1", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({u"IFA fortification of maize": [2000000], u"IPTp": [2000000], u"Iron and iodine fortification of salt": [], u"IYCF 1": [], u"Long-lasting insecticide-treated bednets": [], u"Micronutrient powders": [], u"Multiple micronutrient supplementation": [], u"Vitamin A supplementation": [], u"Zinc for treatment + ORS": []})} |
| 28 | +# ### testing FE bugs |
| 29 | +# kwargs4 = {"name": "FE check 1", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({u"IFA fortification of maize": [2000000], u"IPTp": [2000000], u"Iron and iodine fortification of salt": [], u"IYCF 1": [], u"Long-lasting insecticide-treated bednets": [], u"Micronutrient powders": [], u"Multiple micronutrient supplementation": [], u"Vitamin A supplementation": [], u"Zinc for treatment + ORS": []})} |
30 | 30 |
|
31 |
| -kwargs5 = {"name": "FE check 2", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({u"IFA fortification of maize": [2000000], u"IPTp": [2000000], u"Iron and iodine fortification of salt": [], u"IYCF 1": [], u"Long-lasting insecticide-treated bednets": [0], u"Micronutrient powders": [], u"Multiple micronutrient supplementation": [], u"Vitamin A supplementation": [], u"Zinc for treatment + ORS": []})} |
| 31 | +# kwargs5 = {"name": "FE check 2", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({u"IFA fortification of maize": [2000000], u"IPTp": [2000000], u"Iron and iodine fortification of salt": [], u"IYCF 1": [], u"Long-lasting insecticide-treated bednets": [0], u"Micronutrient powders": [], u"Multiple micronutrient supplementation": [], u"Vitamin A supplementation": [], u"Zinc for treatment + ORS": []})} |
32 | 32 |
|
33 |
| -kwargs5 = {"name": "Check WASH", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({"WASH: Handwashing": [1e6]})} |
| 33 | +# kwargs5 = {"name": "Check WASH", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({"WASH: Handwashing": [1e6]})} |
34 | 34 |
|
35 |
| -kwargs6 = {"name": "Check bednets", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({"Long-lasting insecticide-treated bednets": [0]})} |
| 35 | +# kwargs6 = {"name": "Check bednets", "model_name": "eg", "scen_type": "budget", "progvals": sc.odict({"Long-lasting insecticide-treated bednets": [0]})} |
36 | 36 |
|
37 |
| -kwargs7 = {"name": "IYCF", "model_name": "eg", "scen_type": "coverage", "progvals": sc.odict({"IYCF 1": [0.6, 0.2, 0.5, 0.95, 0.8]}), "growth": "fixed coverage"} |
| 37 | +# kwargs7 = {"name": "IYCF", "model_name": "eg", "scen_type": "coverage", "progvals": sc.odict({"IYCF 1": [0.6, 0.2, 0.5, 0.95, 0.8]}), "growth": "fixed coverage"} |
38 | 38 |
|
39 |
| -kwargs8 = {"name": "Treat SAM 100%", "model_name": "Maximize thrive", "mults": [1], "weights": sc.odict({"thrive": 1}), "prog_set": ["Vitamin A supplementation", "IYCF 1", "IFA fortification of maize", "Balanced energy-protein supplementation", "Public provision of complementary foods", "Iron and iodine fortification of salt"], "fix_curr": False, "add_funds": 0, "filter_progs": True} |
| 39 | +# kwargs8 = {"name": "Treat SAM 100%", "model_name": "Maximize thrive", "mults": [1], "weights": sc.odict({"thrive": 1}), "prog_set": ["Vitamin A supplementation", "IYCF 1", "IFA fortification of maize", "Balanced energy-protein supplementation", "Public provision of complementary foods", "Iron and iodine fortification of salt"], "fix_curr": False, "add_funds": 0, "filter_progs": True} |
40 | 40 |
|
41 |
| -if __name__ == "__main__": |
42 |
| - # mod = p.models.keys()[0] |
43 |
| - # progs = p.models[mod].prog_info.programs.keys() |
44 |
| - # zero_budget_kwargs = {"name": 'Zero spending exc FP', "model_name": mod, "scen_type": "budget", "progvals": sc.odict([(prog, [0]) for prog in progs])} |
45 |
| - # inf_budget_kwargs = {"name": 'Infinite spending exc FP', "model_name": mod, "scen_type": "budget", "progvals": sc.odict([(prog, [0 if prog=='Family planning' else 9999999999]) for prog in progs])} |
46 |
| - # scen_list = nu.make_scens([zero_budget_kwargs, inf_budget_kwargs]) |
| 41 | +# if __name__ == "__main__": |
| 42 | +# # mod = p.models.keys()[0] |
| 43 | +# # progs = p.models[mod].prog_info.programs.keys() |
| 44 | +# # zero_budget_kwargs = {"name": 'Zero spending exc FP', "model_name": mod, "scen_type": "budget", "progvals": sc.odict([(prog, [0]) for prog in progs])} |
| 45 | +# # inf_budget_kwargs = {"name": 'Infinite spending exc FP', "model_name": mod, "scen_type": "budget", "progvals": sc.odict([(prog, [0 if prog=='Family planning' else 9999999999]) for prog in progs])} |
| 46 | +# # scen_list = nu.make_scens([zero_budget_kwargs, inf_budget_kwargs]) |
47 | 47 |
|
48 |
| - scen_list = nu.make_scens([kwargs1, kwargs7, kwargs3, kwargs2]) |
49 |
| - p.add_scens(scen_list) |
| 48 | +# scen_list = nu.make_scens([kwargs1, kwargs7, kwargs3, kwargs2]) |
| 49 | +# p.add_scens(scen_list) |
50 | 50 |
|
51 |
| - results = p.run_scens(n_samples=1) |
| 51 | +# results = p.run_scens(n_samples=1) |
52 | 52 |
|
53 |
| -if doplot: |
54 |
| - p.plot() |
55 |
| -# costeff = p.get_costeff() |
56 |
| -# p.write_results("scen_results_test.xlsx") |
57 |
| -all_reduce = reduce_results(results) |
58 |
| -write_results(results=results, reduced_results=all_reduce, filename="scen_results_test.xlsx") |
59 |
| -p.save("test") |
| 53 | +# if doplot: |
| 54 | +# p.plot() |
| 55 | +# # costeff = p.get_costeff() |
| 56 | +# # p.write_results("scen_results_test.xlsx") |
| 57 | +# all_reduce = reduce_results(results) |
| 58 | +# write_results(results=results, reduced_results=all_reduce, filename="scen_results_test.xlsx") |
| 59 | +# p.save("test") |
0 commit comments