@@ -5,7 +5,7 @@ and standards. Please edit and extend this document.
55
66== svn checkouts ==
77
8- # checking out the main src
8+ # checking out the main src
99svn co https://svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib
1010
1111# checking out everything (toolkits, user's guide, htdocs, etc..)
@@ -38,8 +38,29 @@ in mind.
3838 * If you have altered extension code, do you pass
3939 unit/memleak_hawaii.py?
4040
41+ == Importing and name spaces ==
4142
42- == Naming and spacing conventions ==
43+ For numpy, use:
44+
45+ import numpy as npy
46+ ...
47+ a = npy.array([1,2,3])
48+ ...
49+
50+ For matplotlib main module, use:
51+
52+ import matplotlib as mpl
53+ ...
54+ mpl.rcParams['xtick.major.pad'] = 6
55+
56+ For matplotlib modules, use:
57+
58+ import matplotlib.cbook as cbook
59+ ...
60+ if cbook.iterable(z):
61+ ...
62+
63+ == Naming, spacing, and formatting conventions ==
4364
4465In general, we want to hew as closely as possible to the standard
4566coding guidelines for python written by Guido in
@@ -58,6 +79,22 @@ Also, use an editor that does not put tabs in files. Four spaces
5879should be used for indentation everywhere and if there is a file with
5980tabs or more or less spaces it is a bug -- please fix it.
6081
82+ Please avoid spurious invisible spaces at the ends of lines.
83+ (Tell your editor to strip whitespace from line ends when saving
84+ a file.)
85+
86+ Keep docstrings uniformly indented as in the example below, with
87+ nothing to the left of the triple quotes. The dedent() function
88+ is needed to remove excess indentation only if something will be
89+ interpolated into the docstring, again as in the example above.
90+
91+ Limit line length to 80 characters. If a logical line needs to be
92+ longer, use parentheses to break it; do not use an escaped
93+ newline. It may be preferable to use a temporary variable
94+ to replace a single long line with two shorter and more
95+ readable lines.
96+
97+
6198== Licenses ==
6299
63100matplotlib only uses BSD compatible code. If you bring in code from
@@ -195,7 +232,6 @@ Then in any function accepting Line2D passthrough kwargs, eg
195232matplotlib.axes.Axes.plot
196233
197234 # in axes.py
198- from cbook import dedent
199235...
200236 def plot(self, *args, **kwargs):
201237 """
@@ -210,7 +246,7 @@ from cbook import dedent
210246 information
211247 """
212248 pass
213- plot.__doc__ = dedent(plot.__doc__) % artist.kwdocd
249+ plot.__doc__ = cbook. dedent(plot.__doc__) % artist.kwdocd
214250
215251Note there is a problem for Artist __init__ methods, eg Patch.__init__
216252which supports Patch kwargs, since the artist inspector cannot work
@@ -220,18 +256,3 @@ made some manual hacks in this case which violates the "single entry
220256point" requirement above; hopefully we'll find a more elegant solution
221257before too long
222258
223- == Formatting (editor setup) ==
224-
225- Indentation is in units of 4 spaces.
226-
227- Please avoid hard tabs--use only spaces.
228-
229- Please avoid spurious invisible spaces at the ends of lines.
230- (Tell your editor to strip whitespace from line ends when saving
231- a file.)
232-
233- Keep docstrings uniformly indented as in the example above, with
234- nothing to the left of the triple quotes. The dedent() function
235- is needed to remove excess indentation only if something will be
236- interpolated into the docstring, again as in the example above.
237-
0 commit comments