6b758b5e5e28ac11ae5e375e03fbb76ab239ed5e kent Fri Apr 6 16:53:30 2012 -0700 Removing 'rare' for the acronym case, since it's not so rare. diff --git python/style.txt python/style.txt index d629e38..e8f6a04 100644 --- python/style.txt +++ python/style.txt @@ -32,31 +32,31 @@ NAMING CONVENTIONS Use mixedCase for symbol names: the leading character is not capitalized and all successive words are capitalized. (Classes are an exception, see below.) Non-UCSC Python code may follow other conventions and does not need to be adapted to these naming conventions. Abbreviations follow rules in src/README: Abbreviation of words is strongly discouraged. Words of five letters and less should generally not be abbreviated. If a word is abbreviated in general it is abbreviated to the first three letters: tabSeparatedFile -> tabSepFile In some cases, for local variables abbreviating to a single letter for each word is okay: tabSeparatedFile -> tsf - In rare, complex cases you may treat the abbreviation itself as a word, and only the + In complex cases you may treat the abbreviation itself as a word, and only the first letter is capitalized: genscanTabSeparatedFile -> genscanTsf Numbers are considered words. You would represent "chromosome 22 annotations" as "chromosome22Annotations" or "chr22Ann." Note the capitalized 'A" after the 22. Packages and Modules In Python, a package is represented as a directory with an __init__.py file in it, and contains some number of modules, which are represented as files with a .py extension. A module may in turn contain any number of related classes and methods. This differs from Java, where one file correlates to one class: in Python it is correct to treat one module similar to a whole namespace in Java. Internal packages and modules should have short names in mixedCase, with no spaces or underscores.