Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 454d7bc

Browse files
committed
Deprecated docstring and updated references
1 parent 6817a46 commit 454d7bc

35 files changed

+208
-203
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Module ``docstring`` deprecated
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The module ``matplotlib.docstring`` is considered internal and public access
5+
is deprecated.

doc/devel/documenting_mpl.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,14 +684,14 @@ are:
684684
2. as automated as possible so that as properties change, the docs
685685
are updated automatically.
686686

687-
The ``@docstring.interpd`` decorator implements this. Any function accepting
687+
The ``@_docstring.interpd`` decorator implements this. Any function accepting
688688
`.Line2D` pass-through ``kwargs``, e.g., `matplotlib.axes.Axes.plot`, can list
689689
a summary of the `.Line2D` properties, as follows:
690690

691691
.. code-block:: python
692692
693693
# in axes.py
694-
@docstring.interpd
694+
@_docstring.interpd
695695
def plot(self, *args, **kwargs):
696696
"""
697697
Some stuff omitted
@@ -726,7 +726,7 @@ gets interpolated into the docstring.
726726

727727
Note that this scheme does not work for decorating an Artist's ``__init__``, as
728728
the subclass and its properties are not defined yet at that point. Instead,
729-
``@docstring.interpd`` can be used to decorate the class itself -- at that
729+
``@_docstring.interpd`` can be used to decorate the class itself -- at that
730730
point, `.kwdoc` can list the properties and interpolate them into
731731
``__init__.__doc__``.
732732

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106

107107
# cbook must import matplotlib only within function
108108
# definitions, so it is safe to import from it here.
109-
from . import _api, _version, cbook, docstring, rcsetup
109+
from . import _api, _version, cbook, _docstring, rcsetup
110110
from matplotlib.cbook import MatplotlibDeprecationWarning, sanitize_sequence
111111
from matplotlib.cbook import mplDeprecation # deprecated
112112
from matplotlib.rcsetup import validate_backend, cycler
@@ -593,7 +593,7 @@ def gen_candidates():
593593
_deprecated_remain_as_none = {}
594594

595595

596-
@docstring.Substitution(
596+
@_docstring.Substitution(
597597
"\n".join(map("- {}".format, sorted(rcsetup._validators, key=str.lower)))
598598
)
599599
class RcParams(MutableMapping, dict):

lib/matplotlib/_enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"""
1212

1313
from enum import Enum, auto
14-
from matplotlib import docstring
14+
from matplotlib import _docstring
1515

1616

1717
class _AutoStringNameEnum(Enum):
@@ -179,5 +179,5 @@ def demo():
179179
+ ", ".join([f"'{cs.name}'" for cs in CapStyle]) \
180180
+ "}"
181181

182-
docstring.interpd.update({'JoinStyle': JoinStyle.input_description,
182+
_docstring.interpd.update({'JoinStyle': JoinStyle.input_description,
183183
'CapStyle': CapStyle.input_description})

0 commit comments

Comments
 (0)