import argparse

DEFAULT_FIGURE_FOLDER = "figures/"
DEFAULT_PREPROCESSING_FOLDER = "preproc/"
DEFAULT_RESULTS_FOLDER = "results_for_motion_detection/"
DEFAULT_ROOT_STATS = "."
DEFAULT_ROOT_SYN = "../synaptogenesis/"

parser = argparse.ArgumentParser(
    description='Module to analyse the quality of the topographic maps '
                'generated by SpiNNaker')
flags = parser.add_argument_group('flag arguments')
parser.add_argument('path', help='path of .npz archive', nargs='*')

parser.add_argument('-i', '--input', type=str, nargs="*",
                    help="name(s) of the npz archive storing "
                         "the results from running the simulations",
                    dest='input')

parser.add_argument('-o', '--output', type=str,
                    help="name of the numpy archive storing simulation results",
                    dest='filename')

parser.add_argument('--fig_folder', type=str,
                    help="directory for figures -- [default {}]".format(DEFAULT_FIGURE_FOLDER),
                    dest='fig_folder', default=DEFAULT_FIGURE_FOLDER)

parser.add_argument('--results_folder', type=str,
                    help="directory for reading in results -- [default {}]".format(DEFAULT_RESULTS_FOLDER),
                    dest='results_folder', default=DEFAULT_RESULTS_FOLDER)

parser.add_argument('--preproc_folder', type=str,
                    help="directory for reading in results -- [default {}]".format(DEFAULT_PREPROCESSING_FOLDER),
                    dest='preproc_folder',
                    default=DEFAULT_PREPROCESSING_FOLDER)

parser.add_argument('--root_stats', type=str,
                    help="path to directory for reading in stats -- [default {}]".format(
                        DEFAULT_ROOT_STATS),
                    dest='root_stats',
                    default=DEFAULT_ROOT_STATS)

parser.add_argument('--root_syn', type=str,
                    help="path to directory for reading in synaptogenesis simulations -- [default {}]".format(
                        DEFAULT_ROOT_SYN),
                    dest='root_syn',
                    default=DEFAULT_ROOT_SYN)

flags.add_argument('--plot', help="display plots",
                   action="store_true")

flags.add_argument('--snapshots', help="run snapshot analysis",
                   action="store_true")

# flag to force re-analysis
flags.add_argument('--no-cache', help="force simulation re-analysis without "
                                      "using cached information",
                   action="store_true", dest="no_cache")

flags.add_argument('--time_to_waste', help="we have time to waste with Elephant",
                   action="store_true", dest="time_to_waste")

# flags to control which types of analysis will be run
flags.add_argument('--singles', help="analyse all single experiments",
                   action="store_true")
flags.add_argument('--comparisons', help="analyse all comparison experiments",
                   action="store_true")
flags.add_argument('--evolutions', help="analyse all evolution experiments",
                   action="store_true")
flags.add_argument('--elephants', help="analyse all elephant experiments",
                   action="store_true")
flags.add_argument('--batches', help="analyse all batch experiments",
                   action="store_true")

args = parser.parse_args()
