Good Practices When Using IMP

IMP is a fairly complicated piece of software to use, so it is important that you follow various good practices when using it in order to reduce the chance of important bugs making their way into your programs and to make it easier to track down the source of problems when they do arise. These suggestions are divided into two, no very well separated groups based on whether they are simply good programming practices or are somewhat IMP-specific as well as a list of things to do when you find a problem.

General good practices

restraint=create_force_field(molecules)

   1 def create_force_field(molecules):
   2   ret=IMP.RestraintSet("forcefield")
   3   data= load_data(default_parameters)
   4   ret.add_restraint(create_force_field_bonds(get_bonds(molecules), data)
   5   etc

IMP-specific

Tricks

When you find a (potential) problem

  1. run with all checks turned on to see if there is a usage error that IMP can catch
  2. run gdb/valgrind to isolate the problem (a stack trace is way more useful than a python exception printout)
  3. keep track of what IMP version you used and what type of machine (or in the lab, what machine name) you encountered it on 1.simplify your code to provide a fast, random number and parameter free block of code which reproduces the problem. In addition to making life much easier for the person fixing the code, the simplification process often reveals problems in the code calling IMP.
  4. send it to the IMP list

IMP: good_practices (last edited 2010-12-12 17:08:46 by DanielRussel)