8000 DOC: Fix references in contribution guides. · matplotlib/matplotlib@d51e67f · GitHub
[go: up one dir, main page]

Skip to content

Commit d51e67f

Browse files
committed
DOC: Fix references in contribution guides.
1 parent 249596a commit d51e67f

File tree

4 files changed

+30
-55
lines changed

4 files changed

+30
-55
lines changed

doc/api/testing_api.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
**********************
44

55

6+
:func:`matplotlib.test`
7+
=======================
8+
9+
.. autofunction:: matplotlib.test
10+
611
:mod:`matplotlib.testing`
712
=========================
813

doc/devel/contributing.rst

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -409,29 +409,26 @@ C/C++ extensions
409409
Keyword argument processing
410410
---------------------------
411411

412-
Matplotlib makes extensive use of ``**kwargs`` for pass-through
413-
customizations from one function to another. A typical example is in
414-
:func:`matplotlib.pyplot.text`. The definition of the pylab text
415-
function is a simple pass-through to
416-
:meth:`matplotlib.axes.Axes.text`::
412+
Matplotlib makes extensive use of ``**kwargs`` for pass-through customizations
413+
from one function to another. A typical example is in `matplotlib.pyplot.text`.
414+
The definition of the pylab text function is a simple pass-through to
415+
`matplotlib.axes.Axes.text`::
417416

418417
# in pylab.py
419418
def text(*args, **kwargs):
420419
ret = gca().text(*args, **kwargs)
421420
draw_if_interactive()
422421
return ret
423422

424-
:meth:`~matplotlib.axes.Axes.text` in simplified form looks like this,
425-
i.e., it just passes all ``args`` and ``kwargs`` on to
426-
:meth:`matplotlib.text.Text.__init__`::
423+
`~matplotlib.axes.Axes.text` in simplified form looks like this, i.e., it just
424+
passes all ``args`` and ``kwargs`` on to ``matplotlib.text.Text.__init__``::
427425

428426
# in axes/_axes.py
429427
def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
430428
t = Text(x=x, y=y, text=s, **kwargs)
431429

432-
and :meth:`~matplotlib.text.Text.__init__` (again with liberties for
433-
illustration) just passes them on to the
434-
:meth:`matplotlib.artist.Artist.update` method::
430+
and ``matplotlib.text.Text.__init__`` (again with liberties for illustration)
431+
just passes them on to the `matplotlib.artist.Artist.update` method::
435432

436433
# in text.py
437434
def __init__(self, x=0, y=0, text='', **kwargs):
@@ -471,10 +468,10 @@ local arguments and the rest are passed on as
471468
Using logging for debug messages
472469
--------------------------------
473470

474-
Matplotlib uses the standard python `logging` library to write verbose
475-
warnings, information, and
476-
debug messages. Please use it! In all those places you write :func:`print()`
477-
statements to do your debugging, try using :func:`log.debug()` instead!
471+
Matplotlib uses the standard Python `logging` library to write verbose
472+
warnings, information, and debug messages. Please use it! In all those places
473+
you write `print` calls to do your debugging, try using `logging.debug`
474+
instead!
478475

479476

480477
To include `logging` in your module, at the top of the module, you need to
@@ -489,8 +486,8 @@ To include `logging` in your module, at the top of the module, you need to
489486

490487
will log to a logger named ``matplotlib.yourmodulename``.
491488

492-
If an end-user of Matplotlib sets up `logging` to display at levels
493-
more verbose than `logging.WARNING` in their code with the Matplotlib-provided
489+
If an end-user of Matplotlib sets up `logging` to display at levels more
490+
verbose than ``logging.WARNING`` in their code with the Matplotlib-provided
494491
helper::
495492

496493
plt.set_loglevel("debug")
@@ -527,7 +524,7 @@ There are five levels at which you can emit messages.
527524
steps of layouting or rendering) should only log at this level.
528525

529526
By default, `logging` displays all log messages at levels higher than
530-
`logging.WARNING` to `sys.stderr`.
527+
``logging.WARNING`` to `sys.stderr`.
531528

532529
The `logging tutorial`_ suggests that the difference between `logging.warning`
533530
and `.cbook._warn_external` (which uses `warnings.warn`) is that
@@ -537,11 +534,11 @@ persistent. Moreover, note that `.cbook._warn_external` will by default only
537534
emit a given warning *once* for each line of user code, whereas
538535
`logging.warning` will display the message every time it is called.
539536

540-
By default, `warnings.warn` displays the line of code that has the `warn` call.
541-
This usually isn't more informative than the warning message itself. Therefore,
542-
Matplotlib uses `.cbook._warn_external` which uses `warnings.warn`, but goes
543-
up the stack and displays the first line of code outside of Matplotlib.
544-
For example, for the module::
537+
By default, `warnings.warn` displays the line of code that has the ``warn``
538+
call. This usually isn't more informative than the warning message itself.
539+
Therefore, Matplotlib uses `.cbook._warn_external` which uses `warnings.warn`,
540+
but goes up the stack and displays the first line of code outside of
541+
Matplotlib. For example, for the module::
545542

546543
# in my_matplotlib_module.py
547544
import warnings
@@ -582,10 +579,9 @@ and running the same script will display::
582579
Writing examples
583580
----------------
584581

585-
We have hundreds of examples in subdirectories of
586-
:file:`matplotlib/examples`, and these are automatically generated
587-
when the website is built to show up in the `examples
588-
<../gallery/index.html>` section of the website.
582+
We have hundreds of examples in subdirectories of :file:`matplotlib/examples`,
583+
and these are automatically generated when the website is built to show up in
584+
the :ref:`examples <gallery>` section of the website.
589585

590586
Any sample data that the example uses should be kept small and
591587
distributed with Matplotlib in the

doc/devel/testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Writing a simple test
9191
---------------------
9292

9393
Many elements of Matplotlib can be tested using standard tests. For
94-
example, here is a test from :mod:`matplotlib.tests.test_basic`::
94+
example, here is a test from :file:`matplotlib/tests/test_basic.py`::
9595

9696
def test_simple():
9797
"""
@@ -105,7 +105,7 @@ begin with ``"test_"`` and then within those files for functions beginning with
105105

106106
Some tests have internal side effects that need to be cleaned up after their
107107
execution (such as created figures or modified `.rcParams`). The pytest fixture
108-
:func:`~matplotlib.testing.conftest.mpl_test_settings` will automatically clean
108+
``matplotlib.testing.conftest.mpl_test_settings`` will automatically clean
109109
these up; there is no need to do anything further.
110110

111111
Random data in tests

doc/missing-references.json

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,6 @@
416416
]
417417
},
418418
"py:func": {
419-
"log.debug": [
420-
"doc/devel/contributing.rst:450"
421-
],
422419
"matplotlib.Axis.set_ticks_position": [
423420
"doc/users/prev_whats_new/whats_new_1.4.rst:141"
424421
],
@@ -427,12 +424,6 @@
427424
],
428425
"matplotlib.axis.Tick.label1On": [
429426
"doc/users/prev_whats_new/whats_new_2.1.0.rst:409"
430-
],
431-
"matplotlib.test": [
432-
"doc/devel/testing.rst:79"
433-
],
434-
"matplotlib.testing.conftest.mpl_test_settings": [
435-
"doc/devel/testing.rst:106"
436427
]
437428
},
438429
"py:meth": {
@@ -502,10 +493,6 @@
502493
"matplotlib.patches.Rectangle.contains": [
503494
"doc/users/event_handling.rst:164"
504495
],
505-
"matplotlib.text.Text.__init__": [
506-
"doc/devel/contributing.rst:400",
507-
"doc/devel/contributing.rst:408"
508-
],
509496
"option_scale_image": [
510497
"lib/matplotlib/backends/backend_cairo.py:docstring of matplotlib.backends.backend_cairo.RendererCairo.draw_image:22",
511498
"lib/matplotlib/backends/backend_pdf.py:docstring of matplotlib.backends.backend_pdf.RendererPdf.draw_image:22",
@@ -552,15 +539,9 @@
552539
],
553540
"matplotlib.ft2font": [
554541
"doc/api/prev_api_changes/api_changes_0.91.0.rst:34"
555-
],
556-
"matplotlib.tests.test_basic": [
557-
"doc/devel/testing.rst:93"
558542
]
559543
},
560544
"py:obj": {
561-
"./gallery/index.html": [
562-
"doc/devel/contributing.rst:562"
563-
],
564545
"Artist.stale_callback": [
565546
"doc/users/interactive_guide.rst:326"
566547
],
@@ -898,10 +879,6 @@
898879
"load_char": [
899880
"doc/gallery/misc/ftface_props.rst:16"
900881
],
901-
"logging.WARNING": [
902-
"doc/devel/contributing.rst:468",
903-
"doc/devel/contributing.rst:505"
904-
],
905882
"mainloop": [
906883
"lib/matplotlib/backends/backend_nbagg.py:docstring of matplotlib.backends.backend_nbagg.show:4"
907884
],
@@ -1403,9 +1380,6 @@
14031380
"w_pad": [
14041381
"lib/matplotlib/figure.py:docstring of matplotlib.figure.Figure.set_constrained_layout:5"
14051382
],
1406-
"warn": [
1407-
"doc/devel/contributing.rst:517"
1408-
],
14091383
"whats_new.rst": [
14101384
"doc/users/next_whats_new/README.rst:6"
14111385
],

0 commit comments

Comments
 (0)
0