Skip to content

Commit c2081ae

Browse files
author
Ralf Gommers
committed
DOC: add deprecation section to docstandard. Closes #1501.
1 parent c343611 commit c2081ae

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

doc/HOWTO_DOCUMENT.rst.txt

+32-10
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,29 @@ The sections of the docstring are:
116116

117117
"""
118118

119-
2. **Extended summary**
119+
2. **Deprecation warning**
120+
121+
A section (use if applicable) to warn users that the object is deprecated.
122+
Section contents should include:
123+
124+
* In what Numpy version the object was deprecated, and when it will be
125+
removed.
126+
127+
* Reason for deprecation if this is useful information (e.g., object
128+
is superseded, duplicates functionality found elsewhere, etc.).
129+
130+
* New recommended way of obtaining the same functionality.
131+
132+
This section should use the note Sphinx directive instead of an
133+
underlined section header.
134+
135+
::
136+
137+
.. note:: Deprecated in Numpy 1.6
138+
`ndobj_old` will be removed in Numpy 2.0, it is replaced by
139+
`ndobj_new` because the latter works also with array subclasses.
140+
141+
3. **Extended summary**
120142

121143
A few sentences giving an extended description. This section
122144
should be used to clarify *functionality*, not to discuss
@@ -125,7 +147,7 @@ The sections of the docstring are:
125147
parameters and the function name, but parameter descriptions still
126148
belong in the **parameters** section.
127149

128-
3. **Parameters**
150+
4. **Parameters**
129151

130152
Description of the function arguments, keywords and their
131153
respective types.
@@ -177,18 +199,18 @@ The sections of the docstring are:
177199
x1, x2 : array_like
178200
Input arrays, description of `x1`, `x2`.
179201

180-
4. **Returns**
202+
5. **Returns**
181203

182204
Explanation of the returned values and their types, of the same
183205
format as **parameters**.
184206

185-
5. **Other parameters**
207+
6. **Other parameters**
186208

187209
An optional section used to describe infrequently used parameters.
188210
It should only be used if a function has a large number of keyword
189211
prameters, to prevent cluttering the **parameters** section.
190212

191-
6. **Raises**
213+
7. **Raises**
192214

193215
An optional section detailing which errors get raised and under
194216
what conditions::
@@ -201,7 +223,7 @@ The sections of the docstring are:
201223
This section should be used judiciously, i.e only for errors
202224
that are non-obvious or have a large chance of getting raised.
203225

204-
7. **See Also**
226+
8. **See Also**
205227

206228
An optional section used to refer to related code. This section
207229
can be very useful, but should be used judiciously. The goal is to
@@ -240,7 +262,7 @@ The sections of the docstring are:
240262
func_b, func_c_, func_d
241263
func_e
242264

243-
8. **Notes**
265+
9. **Notes**
244266

245267
An optional section that provides additional information about the
246268
code, possibly including a discussion of the algorithm. This
@@ -285,7 +307,7 @@ The sections of the docstring are:
285307
where filename is a path relative to the reference guide source
286308
directory.
287309

288-
9. **References**
310+
10. **References**
289311

290312
References cited in the **notes** section may be listed here,
291313
e.g. if you cited the article below using the text ``[1]_``,
@@ -310,7 +332,7 @@ The sections of the docstring are:
310332
should not be required to understand it. References are numbered, starting
311333
from one, in the order in which they are cited.
312334

313-
10. **Examples**
335+
11. **Examples**
314336

315337
An optional section for examples, using the `doctest
316338
<http://www.python.org/doc/lib/module-doctest.html>`_ format.
@@ -512,7 +534,7 @@ output. New paragraphs are marked with a blank line.
512534
Use *italics*, **bold**, and ``courier`` if needed in any explanations
513535
(but not for variable names and doctest code or multi-line code).
514536
Variable, module and class names should be written between single
515-
backticks (```numpy```).
537+
back-ticks (```numpy```).
516538

517539
A more extensive example of reST markup can be found in `this example
518540
document <http://docutils.sourceforge.net/docs/user/rst/demo.txt>`_;

0 commit comments

Comments
 (0)