#!/usr/bin/env python

"""
Copyright (C) 2017, California Institute of Technology

This file is part of addm_toolbox.

addm_toolbox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

addm_toolbox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with addm_toolbox. If not, see <http://www.gnu.org/licenses/>.

---

Script: ddm_pta_test
Author: Gabriela Tavares, gtavares@caltech.edu

Test to check the validity of the DDM parameter estimation. Artificial data is
generated using specific parameters for the model. These parameters are then
recovered through a maximum a posteriori estimation procedure.
"""

from __future__ import absolute_import

import argparse

from addm_toolbox import ddm_pta_test


parser = argparse.ArgumentParser()
parser.add_argument(u"--d", type=float, default=0.006,
                    help=u"DDM parameter for generating artificial data.")
parser.add_argument(u"--sigma", type=float, default=0.08,
                    help=u"DDM parameter for generating artificial data.")
parser.add_argument(u"--range-d", nargs=u"+", type=float,
                    default=[0.005, 0.006, 0.007],
                    help=u"Search range for parameter d.")
parser.add_argument(u"--range-sigma", nargs=u"+", type=float,
                    default=[0.065, 0.08, 0.095],
                    help=u"Search range for parameter sigma.")
parser.add_argument(u"--trials-file-name", type=str, default=None,
                    help=u"Path of trial conditions file.")
parser.add_argument(u"--trials-per-condition", type=int, default=800,
                    help=u"Number of artificial data trials to be "
                    "generated per trial condition.")
parser.add_argument(u"--num-threads", type=int, default=9,
                    help=u"Size of the thread pool.")
parser.add_argument(u"--verbose", default=False, action=u"store_true",
                    help=u"Increase output verbosity.")

args = parser.parse_args()
ddm_pta_test.main(args.d, args.sigma, args.range_d, args.range_sigma,
                  args.trials_file_name, args.trials_per_condition,
                  args.num_threads, args.verbose)
