Skip to content

Announcing bake

AlexSzatmary edited this page Aug 16, 2011 · 1 revision

Introduction

Bake runs a set of code a number of times, each time having a different set of input values.

Bake reads a bake parameter file. A bake parameter file is a list of keys which have one or more values. Then, bake does something for each combination ofvalues. It's useful for doing repetitive find-and-replace operations, wrangling data out of oodles of really-similar-but-sublty- different-in-two-variables-but-not-the-other-five sets of data, doing the accounting on submitting jobs to all of the different kinds of supercomputers in your life, and making plots of y vs x for a given z, but then b vs t for a given y.

It's like a little robot that does repetitive things for you so you don't get tenosynovitis.


Included with bake is an example of a Poisson solver. (If you don't do much numerics and don't know what a Poisson solver is, don't worry.) In one line:

$ bake -m -f bp/sine -e 'python poisson.py; python compare_ideal.py' \
      -o '@label@;sine-n@n@' -o '@n@;3;5;11;21;41'

giving one result per job,

0.233700550136
0.0530292875455
0.00826541696623
0.00205870676453
0.00051420047815

In one line, bake runs a numerical code for five different test cases, and then compares those results to the ideal solution, and outputs those errors in a list. (Well, the code and the post-processing were already coded up, but bake coordinated this action five times in one line.)

The Big Ideas of bake

  1. bake can take a file with keys in it and give you a copy with each key swapped out for a value
  2. bake can take a file, and make different copies of it, with keys replaced for different values in each copy
  3. bake can do complex things with values by enclosing keys in values
  4. bake can do all sorts of operations on each generated set of files
  5. bake is easy to extend; things that you would do at the command line can easily be rolled into custom bake commands
  6. You can make your own version of bake that can do everything that plain bake can do, plus things that you can do in Python that would be difficult to do through the plain bake command line interface

How you can help the bake project

Bug reports and code for new features are welcome at this point. However, more importantly, I have used bake for three projects in my research, but my use of it has been idiosyncratic. I have tried to separate many of these idiosyncracies into my own bake front-end that is not included in this project.

What I would appreciate the most are:

  1. Questions about why bake could help you
  2. Ideas for things you could use bake for
  3. Notes on what parts of documentation are unclear
Clone this wiki locally