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