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.TESTS = [][source]

List of all tests for the experiment. Filled by main.

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.collect_commands(commands)[source][source]

Add default commands

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.help(*args)[source][source]

Shows help for a specified command.

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

pyexperiment.experiment.show_config()[source][source]

Print the configuration

pyexperiment.experiment.show_state(*arguments)[source][source]

Shows the contents of the state loaded by the configuration or from the file specified as an argument.

pyexperiment.experiment.show_tests(*args)[source][source]

Show available tests for the experiment

pyexperiment.experiment.test(*args)[source][source]

Run tests for the experiment