コード例 #1
0
def plot_vectors(exp_id, sample, save_file=None):
    am = AnalyzeManager()
    am.add_experiment(retrieve_experiment(exp_id))
    am.add_analyzer(
        VectorSpeciesReportAnalyzer(sample,
                                    save_file=save_file,
                                    channel='Daily HBR'))
    am.analyze()
コード例 #2
0
    # am.add_experiment(retrieve_experiment("15a20ddd-2a36-e811-a2bf-c4346bcb7274"))  # facazissa iter5. best 0.  4/1 10:30pm
    # am.add_experiment(retrieve_experiment("86413a54-0d36-e811-a2bf-c4346bcb7274"))  # magude iter3. best 10.  4/1 10:30pm  X
    # am.add_experiment(retrieve_experiment("15a1d9fe-2f36-e811-a2bf-c4346bcb7274"))  # mahel iter9.  best 0. 4/1
    #  am.add_experiment(retrieve_experiment("0fc16f8f-2636-e811-a2bf-c4346bcb7274")) # mapulanguene iter9. best 10.  4/1 10:30pm
    # am.add_experiment(retrieve_experiment("f5873afe-1336-e811-a2bf-c4346bcb7274"))  # moine iter6. best 0 4/1
    # am.add_experiment(retrieve_experiment("19794550-c135-e811-a2bf-c4346bcb7274"))  # motaze iter1. best 15 4/1
    # am.add_experiment(retrieve_experiment("e6f8c635-2d36-e811-a2bf-c4346bcb7274"))  # panjane iter6. best 0 4/1

    # am.add_experiment(retrieve_experiment("6fe0132a-c135-e811-a2bf-c4346bcb7274")) # faca stage1, iter1, best 9
    # am.add_experiment(retrieve_experiment("86413a54-0d36-e811-a2bf-c4346bcb7274")) # m-s stage 1. iter3, best 12
    # am.add_experiment(retrieve_experiment("eb30545d-e536-e811-a2bf-c4346bcb7274")) # m-s stage 2.  ite3, best 6

    # am.add_experiment(retrieve_experiment("d4b08d09-1835-e811-a2bf-c4346bcb7274")) #caputine iter12. best 8.
    # am.add_experiment(retrieve_experiment("0fc97f4a-4634-e811-a2bf-c4346bcb7274"))  # chichuco iter0.  best 3
    # am.add_experiment(retrieve_experiment("f67437d5-4e34-e811-a2bf-c4346bcb7274"))  # chicutso iter2. best 3
    # am.add_experiment(retrieve_experiment("d7d2a0be-a234-e811-a2bf-c4346bcb7274")) # facazissa iter3.  best 12
    # am.add_experiment(retrieve_experiment("3240a906-9e33-e811-a2bf-c4346bcb7274"))  # magude iter0. best 21.
    # am.add_experiment(retrieve_experiment("6cd7957f-cb34-e811-a2bf-c4346bcb7274"))  # mahel iter6. best 11.
    # am.add_experiment(retrieve_experiment("0dbd4e00-cc34-e811-a2bf-c4346bcb7274")) # mapulanguene iter8. best 3
    # am.add_experiment(retrieve_experiment("777c34a8-dc34-e811-a2bf-c4346bcb7274"))  # moine iter6. best 8
    # am.add_experiment(retrieve_experiment("5171d868-4634-e811-a2bf-c4346bcb7274"))  # motaze iter0. best 11
    # am.add_experiment(retrieve_experiment("7a5ab67b-dc34-e811-a2bf-c4346bcb7274"))  # panjane iter8. best 17

    # am.add_experiment(retrieve_experiment("2ecf9cd7-9c35-e811-a2bf-c4346bcb7274")) #aggregate 2014.  iter2, best 20
    # am.add_experiment(retrieve_experiment("d8cb3061-ae35-e811-a2bf-c4346bcb7274")) #aggregate 2014,2015.  iter2, best 5

    am.add_experiment(
        retrieve_experiment("2f76368f-bc57-e811-a2bf-c4346bcb7274"))

    am.add_analyzer(PrevAnalyzer(cait_output_mode=True, gatesreview=True))
    am.analyze()
コード例 #3
0

if __name__=="__main__":
    SetupParser.init('HPC')

    am = AnalyzeManager()

    # Corrected stepd
    # am.add_experiment(retrieve_experiment("43cac760-cbd6-e711-9414-f0921c16b9e5")) # bbondo
    # am.add_experiment(retrieve_experiment("a31b516a-cbd6-e711-9414-f0921c16b9e5"))  # chabbobboma
    # am.add_experiment(retrieve_experiment("1ecdf372-cbd6-e711-9414-f0921c16b9e5")) # chisanga
    # am.add_experiment(retrieve_experiment("957e6159-32d6-e711-9414-f0921c16b9e5")) # chiyabi
    # am.add_experiment(retrieve_experiment("9669907b-cbd6-e711-9414-f0921c16b9e5"))  # luumbo
    # am.add_experiment(retrieve_experiment("fbe40809-ccd6-e711-9414-f0921c16b9e5"))  # munyumbwe
    # am.add_experiment(retrieve_experiment("8aadd6a0-cbd6-e711-9414-f0921c16b9e5"))  # nyanga chaamwe
    # am.add_experiment(retrieve_experiment("d18a9aa8-cbd6-e711-9414-f0921c16b9e5"))  # sinafala
    am.add_experiment(retrieve_experiment("d28a9aa8-cbd6-e711-9414-f0921c16b9e5"))  # sinamalima

    # Old MBGSR
    # am.add_experiment(retrieve_experiment("7f188957-2fe1-e711-9414-f0921c16b9e5")) # bbondo
    # am.add_experiment(retrieve_experiment("f60d69eb-2fe1-e711-9414-f0921c16b9e5"))  # chabbobboma
    # am.add_experiment(retrieve_experiment("7aa30068-2fe1-e711-9414-f0921c16b9e5")) # chisanga
    # am.add_experiment(retrieve_experiment("d57bccae-25e1-e711-9414-f0921c16b9e5")) # chiyabi
    # am.add_experiment(retrieve_experiment("5d5cff6d-2fe1-e711-9414-f0921c16b9e5"))  # luumbo
    # am.add_experiment(retrieve_experiment("cf37cd7b-2fe1-e711-9414-f0921c16b9e5"))  # munyumbwe
    # am.add_experiment(retrieve_experiment("94aa85fb-2fe1-e711-9414-f0921c16b9e5"))  # nyanga chaamwe
    # am.add_experiment(retrieve_experiment("f5c0fb13-30e1-e711-9414-f0921c16b9e5"))  # sinafala
    # am.add_experiment(retrieve_experiment("33b92b39-30e1-e711-9414-f0921c16b9e5"))  # sinamalima

    am.add_analyzer(RDTPrevAnalyzer())
    am.analyze()
コード例 #4
0
def plot_RDT(exp_id, sample, save_file=None, **kwargs):
    am = AnalyzeManager()
    am.add_experiment(retrieve_experiment(exp_id))
    am.add_analyzer(
        prevalence_plot_analyzer(catch, sample, save_file=save_file, **kwargs))
    am.analyze()
コード例 #5
0
        plt.tight_layout()
        # if self.save_file:
        #     # if self.cait_output_mode:
        #     #     MozambiqueExperiment.save_figs_for_caitlin(fig,self.save_file)
        #     # else:
        if not self.save_file:
            self.save_file = save_file = "figs/{}".format(self.catch)
        # plt.savefig(self.save_file + ".pdf")
        # plt.savefig(self.save_file + ".png")
        # else:
        plt.show()
        print("Done!")


if __name__ == "__main__":
    SetupParser.init('HPC')

    am = AnalyzeManager()
    # am.add_experiment(retrieve_experiment("0a373d77-1f93-e811-a2c0-c4346bcb7275")) # chichuco
    # am.add_experiment(retrieve_experiment("0d801fc0-3c92-e811-a2c0-c4346bcb7275")) # chicutso
    am.add_experiment(
        retrieve_experiment(
            "c5c3c5bb-a79c-e811-a2c0-c4346bcb7275"))  # magude-sede-facazissa
    # am.add_experiment(retrieve_experiment("210bcb89-e696-e811-a2c0-c4346bcb7275")) # mahel
    # am.add_experiment(retrieve_experiment("10238aac-7593-e811-a2c0-c4346bcb7275")) # mapulanguene
    # am.add_experiment(retrieve_experiment("85bef741-2d97-e811-a2c0-c4346bcb7275")) # moine
    # am.add_experiment(retrieve_experiment("140fe8a7-1194-e811-a2c0-c4346bcb7275")) # motaze
    # am.add_experiment(retrieve_experiment("b1c79146-6194-e811-a2c0-c4346bcb7275")) # panjane-caputine

    am.add_analyzer(PrevAnalyzer())
    am.analyze()
コード例 #6
0
    # Calibration experiments:
    # am.add_experiment(retrieve_experiment("09829129-b00b-e811-9415-f0921c16b9e5")) #Mahel
    # am.add_experiment(retrieve_experiment("11cb8543-e20b-e811-9415-f0921c16b9e5")) #Motaze
    # am.add_experiment(retrieve_experiment("8853ca79-1c0c-e811-9415-f0921c16b9e5"))

    # am.add_experiment(retrieve_experiment("171711d2-a010-e811-9415-f0921c16b9e5")) #Caputine
    # am.add_experiment(retrieve_experiment("632dd6f5-a610-e811-9415-f0921c16b9e5")) # Chicutso
    # am.add_experiment(retrieve_experiment("ef6564ad-a110-e811-9415-f0921c16b9e5"))  # Mahel
    # am.add_experiment(retrieve_experiment("fd4866f4-a310-e811-9415-f0921c16b9e5"))  # Mapulanguene
    # am.add_experiment(retrieve_experiment("da1bccd2-a910-e811-9415-f0921c16b9e5"))  # Moine
    # am.add_experiment(retrieve_experiment("7e10e1d1-a710-e811-9415-f0921c16b9e5"))  # Panjane

    # am.add_experiment(retrieve_experiment("7e10e1d1-a710-e811-9415-f0921c16b9e5"))  # Panjane multi-dose



    # am.add_experiment(retrieve_experiment("f335b9ab-1f12-e811-9415-f0921c16b9e5")) # Moine DONE
    # am.add_experiment(retrieve_experiment("8731f656-2a12-e811-9415-f0921c16b9e5")) # Caputine iter6
    # am.add_experiment(retrieve_experiment("f3ed1863-2b12-e811-9415-f0921c16b9e5"))  # Mahel iter2

    # am.add_experiment(retrieve_experiment("62454c29-1212-e811-9415-f0921c16b9e5"))  # Panjane iter2

    am.add_experiment(retrieve_experiment("354912fd-3612-e811-9415-f0921c16b9e5"))  # Motaze iter4
    # am.add_experiment(retrieve_experiment("169df5ae-2b12-e811-9415-f0921c16b9e5"))  # Mapulanguene

    # pbnb
    # am.add_experiment(retrieve_experiment("002e8d2d-4e12-e811-9415-f0921c16b9e5"))  # Caputine

    am.add_analyzer(RDTPrevAnalyzer())
    am.analyze()
コード例 #7
0
        plt.legend()
        # plt.xlim([3000,7000])
        plt.xlim([foo("2010-01-01"), foo("2019-01-01")])

        plt.tight_layout()
        plt.show()
        # plt.savefig(self.base + "data/figs/{}_prev.png".format(catch))


if __name__ == "__main__":
    SetupParser.init('HPC')

    am = AnalyzeManager()

    # Calibration experiments:
    am.add_experiment(
        retrieve_experiment("66f05adf-c10b-e811-9415-f0921c16b9e5"))

    # hand-fudged Milen habitat params
    # am.add_experiment(retrieve_experiment("4766b178-f5f4-e711-9414-f0921c16b9e5")) #bbondo
    # am.add_experiment(retrieve_experiment("34213b5c-f8f4-e711-9414-f0921c16b9e5"))  # chabbobboma
    # am.add_experiment(retrieve_experiment("84d95a7a-faf4-e711-9414-f0921c16b9e5"))  # chisanga
    # am.add_experiment(retrieve_experiment("c6313998-faf4-e711-9414-f0921c16b9e5")) # chiyabi
    # am.add_experiment(retrieve_experiment("69c0e4de-faf4-e711-9414-f0921c16b9e5"))  # luumbo
    # am.add_experiment(retrieve_experiment("4f045b1b-fbf4-e711-9414-f0921c16b9e5"))  # munyumbwe
    # am.add_experiment(retrieve_experiment("542b05fe-fbf4-e711-9414-f0921c16b9e5"))  # nyanga chaamwe (x0.5)
    # am.add_experiment(retrieve_experiment("b546a866-04f5-e711-9414-f0921c16b9e5"))  # nyanga chaamwe (x0.25)
    # am.add_experiment(retrieve_experiment("a938d951-06f5-e711-9414-f0921c16b9e5"))  # nyanga chaamwe (x0.15)
    # am.add_experiment(retrieve_experiment("47bc7d56-fcf4-e711-9414-f0921c16b9e5"))  # sinafala
    # am.add_experiment(retrieve_experiment("cd2853cf-fcf4-e711-9414-f0921c16b9e5"))  # sinamalima

    # Milen habitat params
コード例 #8
0
            # COMPS_experiment_name = suite_name # I want hover-over in COMPS to be the suite name

            experiment_manager.run_simulations(exp_name=COMPS_experiment_name,
                                               exp_builder=experiment_builder,
                                               suite_id=suite_id)
            experiments.append(experiment_manager)
            experiments_ids.append(experiment_manager.experiment.exp_id)

        # Dump the experiment ids for resume
        with open('ids.json', 'w') as out:
            json.dump(experiments_ids, out)

    # Every experiments are created at this point -> Analyze
    am = AnalyzeManager(verbose=False, create_dir_map=False)
    for em in experiments:
        am.add_experiment(em.experiment)
#    am.add_analyzer(DownloadAnalyzerTPI(['output\\DemographicsSummary.json', 'config.json', 'output\\ReportHIVART.csv', 'output\\ReportHIVByAgeAndGender.csv'],
#                                        output_dir='Test HIV 1'))
    am.add_analyzer(
        DownloadAnalyzerTPI(['output\\ReportHIVByAgeAndGender.csv'],
                            output_dir='Nyanza Base Case'))

    # While the experiments are running, we are analyzing every 15 seconds
    while not all([em.finished() for em in experiments]):
        map(lambda e: e.refresh_experiment(), experiments)
        print("Analyzing !")
        am.analyze()
        print("Waiting 15 seconds")
        time.sleep(15)

    # Analyze one last time when everything is complete
コード例 #9
0
            int(x["year"]) + 2010,
            str(int(x["month"])).zfill(2)),
                              axis=1)
        # print("mdate")
        df["mdate"] = df.apply(lambda x: date_to_mdate(x["date"]), axis=1)
        # print("plot")
        # ax.plot(df["year"] * 12 + df["month"], df["cases"], *args, **kwargs)
        ax.plot_date(df["mdate"], df["cases"], *args, **kwargs)

        ax.set_xlabel("Date")
        ax.set_ylabel("Cases")
        ax.set_xlim([date_to_mdate("2010-01-01"), date_to_mdate("2017-01-01")])
        # ax.tick_params(direction="inout")

    def uid(self):
        ''' A unique identifier of site-name and analyzer-name. '''
        return '_'.join([self.site.name, self.name])


if __name__ == "__main__":
    SetupParser.init('HPC')

    am = AnalyzeManager()

    # Calibration experiments:
    am.add_experiment(
        retrieve_experiment("a0bee2bd-f8b5-e811-a2c0-c4346bcb7275"))

    am.add_analyzer(incidence_likelihood(zambia_calib_site("bbondo")))
    am.analyze()
コード例 #10
0
            for exp_id in self.pop_data.keys():
                plt.plot(
                    np.array(self.raw_pop_data[exp_id][-2]) /
                    self.tot_pop[exp_id][-2])
            ax.set_title("Late")
            ax.set_xticks(range(24))
            ax.set_xticklabels(self.age_bins)
            plt.show()

        #
        # for exp_id in self.pop_data.keys():
        #     plt.plot_date(self.report_times, self.pop_data[exp_id],fmt='-',c=c,linewidth=lw,label=label,alpha=0.4)
        #     plt.plot_date(self.report_times, self.pop_data[exp_id], fmt='-', c=c, linewidth=lw, label=label, alpha=0.4)
        #     plt.plot_date(self.report_times, self.pop_data[exp_id], fmt='-', c=c, linewidth=lw, label=label, alpha=0.4)
        #     plt.plot_date(self.report_times, self.pop_data[exp_id], fmt='-', c=c, linewidth=lw, label=label, alpha=0.4)
        # plt.legend([s['environment'] for s in self.metadata.values()])


if __name__ == "__main__":
    SetupParser.init('HPC')

    am = AnalyzeManager()

    am.add_experiment(
        retrieve_experiment("f4ecdcc6-768c-e711-9401-f0921c16849d"))  # L1
    # am.add_experiment(retrieve_experiment("001a9f44-758c-e711-9401-f0921c16849d")) # L5
    am.add_experiment(
        retrieve_experiment("4188b9de-e28c-e711-9401-f0921c16849d"))  # L6

    am.add_analyzer(AgeStratificationAnalyzer())
    am.analyze()
コード例 #11
0
        #     # c1 = green = IRS
        #     # c2 = red = MSAT
        #     # c3 = purple = MDA

        plt.legend()
        # plt.xlim([3000,7000])
        plt.xlim([foo("2010-01-01"), foo("2019-01-01")])
        # plt.show()
        plt.tight_layout()
        plt.savefig(base + "data/figs/{}_prev_node.png".format(catch))


if __name__ == "__main__":
    SetupParser.init('HPC')

    am = AnalyzeManager()

    # am.add_experiment(retrieve_experiment("43cac760-cbd6-e711-9414-f0921c16b9e5")) # bbondo
    # am.add_experiment(retrieve_experiment("a31b516a-cbd6-e711-9414-f0921c16b9e5"))  # chabbobboma
    # am.add_experiment(retrieve_experiment("1ecdf372-cbd6-e711-9414-f0921c16b9e5")) # chisanga
    # am.add_experiment(retrieve_experiment("957e6159-32d6-e711-9414-f0921c16b9e5")) # chiyabi
    # am.add_experiment(retrieve_experiment("9669907b-cbd6-e711-9414-f0921c16b9e5"))  # luumbo
    # am.add_experiment(retrieve_experiment("fbe40809-ccd6-e711-9414-f0921c16b9e5"))  # munyumbwe
    am.add_experiment(
        retrieve_experiment(
            "8aadd6a0-cbd6-e711-9414-f0921c16b9e5"))  # nyanga chaamwe
    # am.add_experiment(retrieve_experiment("d18a9aa8-cbd6-e711-9414-f0921c16b9e5"))  # sinafala
    # am.add_experiment(retrieve_experiment("d28a9aa8-cbd6-e711-9414-f0921c16b9e5"))  # sinamalima

    am.add_analyzer(RDTPrevAnalyzer())
    am.analyze()
コード例 #12
0

    def finalize(self):
        # print self.my_data
        print("")

    def plot(self):
        import matplotlib.pyplot as plt

        # Plot histogram of trips
        for sim_id, data in self.n_trips.items():
            # data only contains data for travellers.  Need to add in "zero trips" for everyone who didn't travel.
            n_couch = self.pop_init[sim_id] - self.n_travellers[sim_id]
            full_data = np.append(data, np.zeros(int(n_couch)))
            plt.hist(full_data,histtype='stepfilled',alpha=0.4,log=True, label=self.metadata[sim_id])

        plt.legend()

        plt.show()



if __name__=="__main__":
    SetupParser.init('HPC')

    am = AnalyzeManager()

    am.add_experiment(retrieve_experiment("151f8b4b-867c-e711-9401-f0921c16849d"))

    am.add_analyzer(MigrationAnalyzer())
    am.analyze()
コード例 #13
0
            date_to_mdate("2013-01-01"),
            date_to_mdate("2014-01-01"),
            date_to_mdate("2015-01-01"),
            date_to_mdate("2016-01-01"),
            date_to_mdate("2017-01-01"),
            date_to_mdate("2018-01-01"),
            date_to_mdate("2019-01-01")
        ])

        # plt.ylim([-0.01,0.25])
        plt.ylabel("RDT Prevalence")
        plt.legend(frameon=True)
        plt.tight_layout()
        if self.save_file:
            plt.savefig(self.save_file + ".pdf")
            plt.savefig(self.save_file + ".png")
        else:
            plt.show()


if __name__ == "__main__":
    am = AnalyzeManager()
    # am.add_experiment(retrieve_experiment("cdb12c2d-61c3-e811-a2bd-c4346bcb1555"))
    am.add_experiment(
        retrieve_experiment("9df3a55a-63c3-e811-a2bd-c4346bcb1555"))
    # am.add_analyzer(custom_prev_plot_analyzer("chiyabi","C0", 3))
    # am.add_analyzer(custom_prev_plot_analyzer("chiyabi","C1", 4))
    am.add_analyzer(custom_prev_plot_analyzer("chiyabi", "C2", 5))
    # am.add_analyzer(custom_prev_plot_analyzer("chiyabi","C3", 6))
    am.analyze()