File: contributing.rst

package info (click to toggle)
deap 1.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,372 kB
  • sloc: python: 9,874; ansic: 1,054; cpp: 592; javascript: 153; makefile: 95; sh: 7
file content (105 lines) | stat: -rw-r--r-- 2,477 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Contributing
============


Reporting a bug
---------------

You can report a bug on deap Github issues page.

`<https://github.com/deap/deap/issues>`_

Retrieving the latest code
--------------------------

You can check the latest sources with the command::

    git clone https://github.com/DEAP/deap.git


Contributing code
-----------------

The preferred way to contribute to deap is to fork the `main
repository <http://github.com/deap/deap/>`__ on GitHub,
then submit a "pull request" (PR):

 1. Fork the `project repository
    <http://github.com/deap/deap>`__: click on the 'Fork'
    button near the top of the page. This creates a copy of the code under your
    account on the GitHub server.

 2. Clone your fork locally::

        $ git clone git@github.com:YourLogin/deap.git

 3. Create a branch to hold your changes::

        $ git checkout -b my-feature

    and start making changes. Never work in the ``master`` branch!

 4. When you're done editing, do::

        $ git add modified_files
        $ git commit

    to record your changes in Git, then push them to GitHub with::

        $ git push -u origin my-feature

Finally, go to the web page of your fork of the deap repository,
and click 'Pull request' to send your changes for review.

You can also contact us on the deap users 
list at `<http://groups.google.com/group/deap-users>`_.

Coding guidelines
-----------------

Most of those conventions are base on Python PEP8.

    *A style guide is about consistency. Consistency with this style guide is important.
    Consistency within a project is more important. Consistency within one module or 
    function is most important.*

Code layout
+++++++++++

Same as PEP8.

Imports
+++++++

First imports in a file are the standard library module, then come the imports of deap module, and finally the custom module for a problem. Each block of imports should be separated by a new line.

::

  import system
  
  from deap import base

  import mymodule

Whitespace in Expressions and Statements
++++++++++++++++++++++++++++++++++++++++

Same as PEP8.

Comments
++++++++

Same as PEP8

Documentation Strings
+++++++++++++++++++++
Same as PEP8

Naming Conventions
++++++++++++++++++

- **Module** : use the lowercase convention.
- **Class** : class names use the CapWords? convention.
- **Function** / Procedure : use the mixedCase convention. First word should be an action verb.
- **Variable** : use the lower_case_with_underscores convention.