pyexperiment.experiment¶
Framework for quick and clean experiments with python.
For a simple example to adapt to your own needs, check the example file.
Written by Peter Duerr.
- pyexperiment.experiment.COMMANDS = [][source]¶
List of all commands for the experiment. Filled by main.
- pyexperiment.experiment.DEFAULT_CONFIG_FILENAME = u'./config.ini'[source]¶
Default name for the configuration file
- pyexperiment.experiment.DEFAULT_CONFIG_SPECS = u"[pyexperiment]\nverbosity = option('DEBUG','INFO','WARNING','ERROR','CRITICAL',default='WARNING')\nlog_to_file = boolean(default=False)\nlog_filename = string(default=log.txt)\nlog_file_verbosity = option('DEBUG','INFO','WARNING','ERROR','CRITICAL',default='DEBUG')\nrotate_n_logs = integer(min=0, default=5)\nprint_timings = boolean(default=False)\nload_state = boolean(default=False)\nsave_state = boolean(default=False)\nstate_filename = string(default=experiment_state.h5f)\nrotate_n_state_files = integer(min=0, default=5)\n[[plot]]\nfont_size = integer(min=1, default=14)\nlabel_size = integer(min=1, default=14)\nuse_tex = boolean(default=True)\nline_width = integer(min=1, default=4)\n[[[seaborn]]]\nenable = boolean(default=True)\nstyle = option('darkgrid','whitegrid','dark','white','ticks',default='darkgrid')\npalette_name = string(default=colorblind)\ndesat = float(min=0.0, max=1.0, default=0.6)\n"[source]¶
Default specification for the experiment’s configuration
- pyexperiment.experiment.activate_autocompletion()[source][source]¶
Activate auto completion for your experiment with zsh or bash.
Call with eval “$(script_name activate_autocompletion)”. In zsh you may need to call autoload bashcompinit and bashcompinit first.
- pyexperiment.experiment.configure(commands, config_specs, description)[source][source]¶
Load configuration from command line arguments and optionally, a configuration file. Possible command line arguments depend on the list of supplied commands, the configuration depends on the supplied configuration specification.
- pyexperiment.experiment.format_command_help(commands)[source][source]¶
Format the docstrings of the commands.
- pyexperiment.experiment.init_log()[source][source]¶
Initialize the logger based on the configuration
- pyexperiment.experiment.main(commands=None, config_spec=u'', tests=None, description=None)[source][source]¶
Parses command line arguments and configuration, then runs the appropriate command.
- pyexperiment.experiment.save_config(filename)[source][source]¶
Save a configuration file to a filename
- pyexperiment.experiment.setup_arg_parser(commands, description)[source][source]¶
Setup the argument parser for the experiment