Пример #1
0
def builtinAnalyzers():
    analyzers = {
        'time_series':
        TimeseriesAnalyzer(select_function=sample_selection(),
                           group_function=group_by_name('_site_'),
                           plot_function=plot_grouped_lines),
        'vector_species':
        VectorSpeciesAnalyzer(select_function=sample_selection(),
                              group_function=group_by_name('_site_')),
    }

    return analyzers
Пример #2
0
        ModFn(DTKConfigBuilder.set_param, 'Run_Number', seed)
        for seed in range(5)
    ],
)

# The run_sim_args is a dictionary informing the command line of:
# - What config builder to use
# - What is the name we want for the experiment
# - Which experiment builder to use
run_sim_args = {
    'config_builder': cb,
    'exp_name': 'Sample larvicides epxeriment',
    'exp_builder': builder
}

# In this file we also decided to include the analyzers.
# When present the `analyzers` variable is an array of Analyzers that will be executed when
# the command `dtk analyze larvicides_campaign.py` is called.
# Here we are using a simple TimeSeriesAnalyzer, grouping the simulations by the larvicide_start tag (averaging
# across the Run_Number). And displaying the results for 3 vector related channels.
analyzers = [
    TimeseriesAnalyzer(group_function=group_by_name('larvicide_start'),
                       channels=['Daily EIR', 'Adult Vectors', 'Infected'])
]

if __name__ == "__main__":
    SetupParser.init()
    em = ExperimentManagerFactory.init()
    em.run_simulations(**run_sim_args)
    em.wait_for_finished(verbose=True)
Пример #3
0
from dtk.utils.analyzers import TimeseriesAnalyzer, VectorSpeciesAnalyzer
from simtools.AnalyzeManager.AnalyzeManager import AnalyzeManager
from simtools.Utilities.Experiments import retrieve_experiment

if __name__ == "__main__":
    # Retrieve a couple of test experiments
    experiment1 = retrieve_experiment('158cc530-780e-e711-9400-f0921c16849c')
    experiment2 = retrieve_experiment('c62aa746-780e-e711-9400-f0921c16849c')

    # Create an analyze manager
    # Note that we are adding the experiments that we want to analyze
    am = AnalyzeManager(exp_list=[experiment1, experiment2])

    # Add the TimeSeriesAnalyzer to the manager
    am.add_analyzer(TimeseriesAnalyzer())
    am.add_analyzer(VectorSpeciesAnalyzer())

    # Analyze
    am.analyze()
from dtk.utils.analyzers import name_match_filter, group_by_name, plot_grouped_lines, \
                                TimeseriesAnalyzer, RegressionTestAnalyzer

analyzers = [
    TimeseriesAnalyzer(group_function=group_by_name('Config_Name'),
                       plot_function=plot_grouped_lines),
    RegressionTestAnalyzer(filter_function=name_match_filter('Vector'),
                           channels=[
                               'Statistical Population', 'Rainfall',
                               'Adult Vectors', 'Daily EIR', 'Infected',
                               'Parasite Prevalence'
                           ],
                           onlyPlotFailed=False)
]
Пример #5
0
from dtk.utils.builders.sweep import GenericSweepBuilder
from dtk.utils.core.DTKConfigBuilder import DTKConfigBuilder
from dtk.vector.study_sites import configure_site
from simtools.Analysis.AnalyzeManager import AnalyzeManager
from simtools.ExperimentManager.ExperimentManagerFactory import ExperimentManagerFactory
from simtools.SetupParser import SetupParser

# This block will be used unless overridden on the command-line
SetupParser.default_block = 'HPC'

cb = DTKConfigBuilder.from_defaults('VECTOR_SIM')
configure_site(cb, 'Namawala')
cb.set_param('Simulation_Duration',365)


analyzers = (TimeseriesAnalyzer(),
             VectorSpeciesAnalyzer())


builder = GenericSweepBuilder.from_dict({'Run_Number': range(5)})

run_sim_args =  {
    'exp_name': 'testrunandanalyze',
    'exp_builder': builder,
    'config_builder':cb
}

if __name__ == "__main__":
    SetupParser.init(selected_block=SetupParser.default_block)
    exp_manager = ExperimentManagerFactory.from_cb(config_builder=cb)
    exp_manager.run_simulations(**run_sim_args)
Пример #6
0
from dtk.utils.analyzers import TimeseriesAnalyzer, VectorSpeciesAnalyzer, sample_selection
from dtk.utils.analyzers.group import group_by_name
from dtk.utils.analyzers.plot import plot_grouped_lines

analyzers = [
    TimeseriesAnalyzer(select_function=sample_selection(),
                       group_function=group_by_name('_site_'),
                       plot_function=plot_grouped_lines),
    VectorSpeciesAnalyzer(
        select_function=sample_selection(),
        group_function=group_by_name('_site_'),
    )
]