CDCgov / cfa-abc-calibration

Apache License 2.0
1 stars 0 forks source link

Added manager with minimum example #16

Closed KOVALW closed 2 weeks ago

KOVALW commented 2 weeks ago

Overview

The current set of wrappers work well but can be rigid at times. We therefore require flexible wrappers that can handle both execution and data processing elements of the calibration workflow and do so in a user-defined fashion.

Changes

This PR provides

  1. Initial call_experiment wrapper in the manager.py file
  2. Tests of the experiment setup component of the manager through test_manager.py in tests. These are added in a new workflow, which is separate from test_toy_model.yaml that handles ABCtools tests.
  3. A working example return-summaries using the wrapper to run simulations, execute a summary function over them, and store the products of both steps in two directories

Elements of the return-summaries example readme.md relevant to the creation of the manager wrapper are copied here

Goal

Purpose of this example is to show a simple implementation of the manager wrapper and how user defined calls are generated. The majority of the main.py file is used to create the user-specified simulation functions and parameter draw functions.

Calling experiments through the manager

There are only three required parameter inputs

  1. config - configuration file to specify parameter inputs
  2. experiment_mode - user-defined mode of the experiment that determines directory management, doesn't require using a string already known to the
  3. write - tuple that tells the manager what outputs to write to files

The returned output of manager.call_experiment is a SimulationBundle object that contains the information from the simulations and summaries so that no information has to be written for further analysis.

Execution

Run the example from the terminal based in the main project directory

poetry install
poetry run python abctools/examples/return-summaries/main.py
KOVALW commented 2 weeks ago

Temporarily closing to allow for poetry to access to-be-released public repos