IMP  2.1.0
The Integrative Modeling Platform
README.md
1 # Tools #
2 
3 # Tools # {#dev_tools}
4 
5 IMP provides a variety of scripts to aid the lives of developers.
6 
7 # Making a module # {#dev_tools_make_module}
8 
9 Creating such a module is the easiest way to get started developing
10 code for IMP. First, choose a name for the module. The name should
11 only contain letters, numbers and underscores as it needs to be a
12 valid file name as well as an identifier in Python and C++.
13 
14 To create the module do `./tools/make-module.py my_module`. The new
15 module includes a number of examples and comments to help you add code
16 to the module.
17 
18 You can use your new module in a variety of ways:
19 - add C++ code to your module by putting `.h` files in
20  `modules/my_module/include` and `.cpp` files in
21  `modules/my_module/src`. In order to use use your new
22  functions and classes in Python, you must add a line
23  `%include "IMP/my_module/myheader.h"` near the end of the
24  file `modules/my_module/pyext/my_module.i`.
25 - write C++ programs using IMP by creating `.cpp` files in
26  `modules/my_module/bin`. Each `.cpp` file placed there
27  is built into a separate executable.
28 - add Python code to your library by putting a `.py` file in
29  `modules/my_module/pyext/my_module/`
30 - add Python code to your library by by adding
31  `%pythoncode` blocks to `modules/my_module/pyext/my_module.i`.
32 - add test code to your library by putting `.py` files in
33  `modules/my_module/test` or a subdirectory.
34 
35 If you feel your module is of interest to other IMP users and
36 developers, see the [contributing code to IMP](#devguide_contributing) section.
37 
38 If you document your code, building the target `IMP-doc` will build
39 documentation of all of the modules including yours and
40 `IMP.mymodule-doc` will build the doc for just yours. To access the
41 documentation for all of IMP, open `doc/html/index.html` and for just
42 your module, open `doc/html/mymodule/index.html`
43 
44 # Formatting your code # {#dev_tools_clang_format}
45 
46 The command `./tools/clang-format.py` uses the program `clang-format` to
47 reformat C++ code, working around some eccentricies of IMP code. `clang-format`
48 is part of [llvm](http://llvm.org) >= 3.3. You should always inspect the
49 changes made by `clang-format` before submitting.
50 
51 # Checking standards # {#dev_tools_check_standards}
52 
53 The command `./tools/check-standards.py` runs a number of IMP-specific standards
54 checks on C++ and Python files. It is also run as part of `git` commits.