File: coding_guidelines.rst

package info (click to toggle)
glueviz 0.14.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 29,280 kB
  • sloc: python: 41,995; makefile: 138; sh: 63
file content (23 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Coding guidelines
=================

Glue is written entirely in Python, and we abide by the following guidelines:

* All code should be Python 2 and 3-compatible. We do this by using the `six
  <https://pypi.org/project/six>`_ package, which we bundle in
  ``glue.external.six``.

* We follow many of the same guidelines as the `Astropy <https://www.astropy.org>`_ project, which you can find `here <http://docs.astropy.org/en/stable/development/codeguide.html#coding-style-conventions>`__.

* We use absolute imports for most of the code in Glue, with the exception of
  tests, which are allowed to import the classes/functions they are testing
  using relative imports. This means that if we need to move files and their
  associated tests around, the tests will still work without having to change
  the imports.

* All Qt-specific code should live in ``qt/`` sub-directories (see
  :ref:`qt_code` for more details).

* Docstrings should be written using the `numpydoc
  <https://github.com/numpy/numpydoc>`_ format, which is described in detail
  `here <http://docs.astropy.org/en/latest/development/docrules.html>`__.