-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Pytroll coding guidelines | ||
========================= | ||
|
||
“It is not the strongest of the species that survives, nor the most intelligent that survives. | ||
It is the one that is most adaptable to change.” | ||
Charles Darwin | ||
|
||
“It seems that perfection is attained, | ||
not when there is nothing more to add, | ||
but when there is nothing more to take away.” | ||
Antoine de Saint Exupéry | ||
|
||
|
||
Language is US English. | ||
|
||
We generally follow the pep-8 | ||
|
||
Max line length is set to 120 chars, 80 chars is ok too. | ||
|
||
Indentation is 4 spaces (no tabs!) | ||
|
||
Global constants are written in capital letters, eg. PLANK_CONSTANT if they are not modified in the module. | ||
|
||
About docstrings, pep 257 https://www.python.org/dev/peps/pep-0257/ | ||
|
||
Versionning: http://semver.org/ | ||
|
||
Prepare to be Python3 compatible. | ||
|
||
Commit messages: | ||
http://chris.beams.io/posts/git-commit/ | ||
http://who-t.blogspot.de/2009/12/on-commit-messages.html | ||
|
||
|
||
The Zen of Python (PEP20) | ||
------------------------- | ||
* Beautiful is better than ugly. | ||
* Explicit is better than implicit. | ||
* Simple is better than complex. | ||
* Complex is better than complicated. | ||
* Flat is better than nested. | ||
* Sparse is better than dense. | ||
* Readability counts. | ||
* Special cases aren't special enough to break the rules. | ||
* Although practicality beats purity. | ||
* Errors should never pass silently. | ||
* Unless explicitly silenced. | ||
* In the face of ambiguity, refuse the temptation to guess. | ||
* There should be one-- and preferably only one --obvious way to do it. | ||
* Although that way may not be obvious at first unless you're Dutch. | ||
* Now is better than never. | ||
* Although never is often better than *right* now. | ||
* If the implementation is hard to explain, it's a bad idea. | ||
* If the implementation is easy to explain, it may be a good idea. | ||
* Namespaces are one honking great idea -- let's do more of those! | ||
|