Python guidelines#
Getting started#
The modular architecture of PynPoint allows for easy implementation of new pipeline modules and we welcome contributions from users. Before writing a new PynPoint module, it is helpful to have a look at the Architecture section. In addition, some basic knowledge on Python is required and some understanding on the following items can be helpful:
Python types such as lists, tuples, and dictionaries.
Classes and in particular the concept of inheritance.
Abstract classes as interfaces.
Conventions#
Before we start writing a new PynPoint module, please take notice of the following style conventions:
PEP 8 – style guide for Python code
We recommend using pylint and pycodestyle to analyze newly written code in order to keep PynPoint well structured, readable, and documented.
Names of class member should start with
m_
.Images should ideally not be read from and written to the central database at once but in amounts of
MEMORY
.
Unit tests#
PynPoint is a robust pipeline package with 95% of the code covered by unit tests. Testing of the package is done by running make test
in the cloned repository. This requires the installation of:
The unit tests ensure that the output from existing functionalities will not change whenever new code. With these things in mind, we are now ready to code!