@@ -12,7 +12,7 @@ The project is hosted on https://github.com/matplotlib/matplotlib
12
12
Submitting a bug report
13
13
=======================
14
14
15
- In case you experience issues using this package , do not hesitate to submit a
15
+ If you find a bug in the code or documentation , do not hesitate to submit a
16
16
ticket to the
17
17
`Bug Tracker <https://github.com/matplotlib/matplotlib/issues >`_. You are
18
18
also welcome to post feature requests or pull requests.
@@ -30,52 +30,56 @@ You can check out the latest sources with the command::
30
30
git clone git@github.com:matplotlib/matplotlib.git
31
31
32
32
33
- After obtaining a local copy of the matpotlib source code (:ref: `set-up-fork `),
34
- navigate to the matplotlib directory and run the following in the shell:
35
-
36
<
B41A
code class="diff-text syntax-highlighted-line deletion">- ::
33
+ After obtaining a local copy of the matplotlib source code (:ref: `set-up-fork `),
34
+ navigate to the matplotlib directory and run the following in the shell::
37
35
38
36
python setup.py develop
39
37
40
38
or::
41
39
42
40
pip install -v -e .
43
41
44
- This installs matplotlib for development (i.e., builds everything and places the
45
- symbolic links back to the source code). You can then run the tests your work
46
- environment is set up properly::
47
42
48
- python tests.py
43
+ This installs matplotlib for development (i.e., builds everything and places the
44
+ symbolic links back to the source code).
49
45
46
+ .. warning ::
50
47
51
- You may want to consider setting up a `virtual environment
52
- <http://docs.python-guide.org/en/latest/dev/virtualenvs/> `_ or a `conda
53
- environment <http://conda.pydata.org/docs/using/envs.html> `_
48
+ If you already have a version of matplotlib installed, you will need to
49
+ uninstall it.
54
50
55
51
56
52
.. note ::
57
53
58
- If you decide to do this, you will have to rerun::
54
+ If you decide to do install with ``python setup.py develop `` or ``pip
55
+ install -v -e ``, you will have to rerun::
59
56
60
57
python setup.py build
61
58
<
F438
/div>
62
59
every time the source code of a compiled extension is changed (for
63
60
instance when switching branches or pulling changes from upstream).
64
61
65
- .. _nose : http://nose.readthedocs.org/en/latest/
66
- .. _pep8 : http://pep8.readthedocs.org/en/latest/
62
+
63
+
64
+ You can then run the tests to check your work environment is set up properly::
65
+
66
+ python tests.py
67
+
68
+
69
+ .. _nose : https://nose.readthedocs.io/en/latest/
70
+ .. _pep8 : https://pep8.readthedocs.io/en/latest/
67
71
68
72
.. note ::
69
73
70
74
**Additional dependencies for testing **: nose _ (version 1.0 or later), `mock
71
- <http ://www.voidspace .org.uk/python/mock/ > `_ (if python < 3.3), `Ghostscript
72
- <http://pages.cs.wisc.edu/~ghost /> `_, `Inkscape <http://inkscape.org >`_
75
+ <https ://docs.python .org/dev/library/unittest.mock.html > `_ (if python < 3.3), `Ghostscript
76
+ <http://www.ghostscript.com /> `_, `Inkscape <http://inkscape.org >`_
73
77
74
78
.. note :: To make sure the tests run locally:
75
79
76
80
* Copy setup.cfg.template to setup.cfg
77
- * Edit setup.cfg to set `test ` to True, and `local_freetype ` to True
78
- * If you have build matplotlib previously, remove the build folder.
81
+ * Edit setup.cfg to set `` test `` to True, and `` local_freetype ` ` to True
82
+ * If you have built matplotlib previously, remove the `` build `` folder.
79
83
* Execute the build command.
80
84
81
85
When working on bleeding edge packages, setting up a
@@ -112,21 +116,22 @@ then submit a "pull request" (PR):
112
116
113
117
4. Create a branch to hold your changes::
114
118
115
- $ git checkout -b my-feature
119
+ $ git checkout -b my-feature origin/master
116
120
117
121
and start making changes. Never work in the ``master`` branch!
118
122
119
123
5. Work on this copy, on your computer, using Git to do the version
120
- control. When you're done editing, do::
124
+ control. When you're done editing e.g., ``lib/matplotlib/collections.py ``,
125
+ do::
121
126
122
- $ git add modified_files
127
+ $ git add lib/matplotlib/collections.py
123
128
$ git commit
124
129
125
130
to record your changes in Git, then push them to GitHub with::
126
131
127
132
$ git push -u origin my-feature
128
133
129
- Finally, go to the web page of the your fork of the matplotlib repo,
134
+ Finally, go to the web page of your fork of the matplotlib repo,
130
135
and click 'Pull request' to send your changes to the maintainers for review.
131
136
You may want to consider sending an email to the mailing list for more
132
137
visibility.
@@ -143,24 +148,24 @@ Contributing pull requests
143
148
It is recommended to check that your contribution complies with the following
144
149
rules before submitting a pull request:
145
150
146
- * If your pull request addresses an issue, please use the title todescribe
151
+ * If your pull request addresses an issue, please use the title to describe
147
152
the issue and mention the issue number in the pull request description
148
153
to ensure a link is created to the original issue.
149
154
150
155
* All public methods should have informative docstrings with sample
151
- usage presented as doctests when appropriate. Use the
156
+ usage when appropriate. Use the
152
157
`numpy docstring standard <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt >`_
153
158
154
- * Formatting should follow `PEP8 recommandation
155
- <http ://www.python.org/dev/peps/pep-0008/> `_. You should consider
159
+ * Formatting should follow `PEP8 recommendation
160
+ <https ://www.python.org/dev/peps/pep-0008/> `_. You should consider
156
161
installing/enabling automatic PEP8 checking in your editor. Part of the
157
162
test suite is checking PEP8 compliance, things go smoother if the code is
158
163
mostly PEP8 compliant to begin with.
159
164
160
165
* Each high-level plotting function should have a simple example in
161
- the `Example ` section of the docstring. This should be as simple as
166
+ the `` Example ` ` section of the docstring. This should be as simple as
162
167
possible to demonstrate the method. More complex examples should go
163
- in the `examples ` tree.
168
+ in the `` examples ` ` tree.
164
169
165
170
* Changes (both new features and bugfixes) should be tested. See
166
171
:ref: `testing ` for more details.
@@ -170,13 +175,12 @@ rules before submitting a pull request:
170
175
import numpy as np
171
176
import numpy.ma as ma
172
177
import matplotlib as mpl
173
- from matplotlib import pyplot as plt
178
+ import matplotlib. pyplot as plt
174
179
import matplotlib.cbook as cbook
175
- import matplotlib.collections as mcol
176
180
import matplotlib.patches as mpatches
177
181
178
- * If your change is a major new feature, add an entry to ` What's new `
179
- section by adding a new file in `doc/users/whats_new ` (see
182
+ * If your change is a major new feature, add an entry to the `` What's new ` `
183
+ section by adding a new file in `` doc/users/whats_new ` ` (see
180
184
:file: `doc/users/whats_new/README ` for more information).
181
185
182
186
* If you change the API in a backward-incompatible way, please
@@ -205,7 +209,7 @@ tools:
205
209
206
210
The current state of the matplotlib code base is not compliant with all
207
211
of those guidelines, but we expect that enforcing those constraints on all
208
- new contributions will get the overall code base quality in the right
212
+ new contributions will move the overall code base quality in the right
209
213
direction.
210
214
211
215
@@ -223,23 +227,14 @@ Issues for New Contributors
223
227
---------------------------
224
228
225
229
New contributors should look for the following tags when looking for issues.
226
- We strongly recommend that new contributors tackle "new-contributor-friendly"
230
+ We strongly recommend that new contributors tackle
231
+ `new-contributor-friendly <https://github.com/matplotlib/matplotlib/labels/new-contributor-friendly >`_
227
232
issues (easy, well documented issues, that do not require an understanding of
228
- the different submodules of matplotlib) and "Easy-fix" issues. This helps the
229
- contributor become familiar with the contribution workflow, and for the core
230
- devs to become acquainted with the contributor; besides which, we frequently
231
- underestimate how easy an issue is to solve!
232
-
233
- .. topic :: new-contributor-friendly
234
-
235
- A great way to start contributing to matplotlib is to pick an item from
236
- the list of
237
- `new-contributor-friendly <https://github.com/matplotlib/matplotlib/labels/new-contributor-friendly >`_
238
- in the issue tracker. Resolving these issues allow you to start
239
- contributing to the project without much prior knowledge. Your assistance
240
- in this area will be greatly appreciated by the more experienced
241
- developers as it helps free up their time to concentrate on other issues.
242
-
233
+ the different submodules of matplotlib) and
234
+ `Easy-fix <https://github.com/matplotlib/matplotlib/labels/Difficulty%3A%20Easy >`_
235
+ issues. This helps the contributor become familiar with the contribution
236
+ workflow, and for the core devs to become acquainted with the contributor;
237
+ besides which, we frequently underestimate how easy an issue is to solve!
243
238
244
239
.. _other_ways_to_contribute :
245
240
@@ -266,7 +261,7 @@ New modules and files: installation
266
261
-----------------------------------
267
262
268
263
* If you have added new files or directories, or reorganized existing
269
- ones, make sure the new files included in the match patterns in
264
+ ones, make sure the new files are included in the match patterns in
270
265
:file: `MANIFEST.in `, and/or in `package_data ` in `setup.py `.
271
266
272
267
C/C++ extensions
@@ -277,9 +272,6 @@ C/C++ extensions
277
272
* Code style should conform to PEP7 (understanding that PEP7 doesn't
278
273
address C++, but most of its admonitions still apply).
279
274
280
- * Interfacing with Python may be done either with the raw Python/C API
281
- or Cython.
282
-
283
275
* Python/C interface code should be kept separate from the core C/C++
284
276
code. The interface code should be named `FOO_wrap.cpp ` or
285
277
`FOO_wrapper.cpp `.
@@ -296,7 +288,7 @@ Keyword argument processing
296
288
297
289
Matplotlib makes extensive use of ``**kwargs `` for pass-through
298
290
customizations from one function to another. A typical example is in
299
- :func: `matplotlib.pylab .text `. The definition of the pylab text
291
+ :func: `matplotlib.pyplot .text `. The definition of the pylab text
300
292
function is a simple pass-through to
301
293
:meth: `matplotlib.axes.Axes.text `::
302
294
@@ -310,7 +302,7 @@ function is a simple pass-through to
310
302
i.e., it just passes all ``args `` and ``kwargs `` on to
311
303
:meth: `matplotlib.text.Text.__init__ `::
312
304
313
- # in axes.py
305
+ # in axes/_axes .py
314
306
def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
315
307
t = Text(x=x, y=y, text=s, **kwargs)
316
308
@@ -342,7 +334,7 @@ used locally and pass on the rest. For example, in
342
334
local arguments and the rest are passed on as
343
335
:meth: `~matplotlib.lines.Line2D ` keyword arguments::
344
336
345
- # in axes.py
337
+ # in axes/_axes .py
346
338
def plot(self, *args, **kwargs):
347
339
scalex = kwargs.pop('scalex', True)
348
340
scaley = kwargs.pop('scaley', True)
@@ -381,7 +373,7 @@ If you are working on a custom backend, the *backend* setting in
381
373
:file: `matplotlibrc ` (:ref: `customizing-matplotlib `) supports an
382
374
external backend via the ``module `` directive. if
383
375
:file: `my_backend.py ` is a matplotlib backend in your
384
- :envvar: `PYTHONPATH `, you can set use it on one of several ways
376
+ :envvar: `PYTHONPATH `, you can set it on one of several ways
385
377
386
378
* in matplotlibrc::
387
379
0 commit comments