Skip to content

Commit 5532e77

Browse files
committed
update docs/readme
1 parent 12f2301 commit 5532e77

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,23 @@ Utilize a built-in style by specifying any of the following names (as a string),
170170
from the parent and child are merged gracefully with nice formatting. The child's docstring sections take precedence
171171
in the case of overlap.
172172

173-
- `"numpy_with_merge"`: Behaves identically to the "numpy" style, but also merges sections that overlap,
173+
- `"numpy_with_merge"`: Behaves identically to the "numpy" style, but also merges - with de-duplication - sections that overlap,
174174
instead of only keeping the child's section. The sections that are merged are "Attributes", "Parameters",
175175
"Methods", "Other Parameters", and "Keyword Arguments".
176176

177177
- `"google"`: Google-styled docstrings from the parent and child are merged gracefully
178178
with nice formatting. The child's docstring sections take precedence in the case of overlap.
179179
This adheres to the [napoleon specification for the Google style](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html#example-google-style-python-docstrings).
180180

181-
- `"google_with_merge"`: Behaves identically to the "google" style, but also merges sections that overlap,
181+
- `"google_with_merge"`: Behaves identically to the "google" style, but also merges - with de-duplication - sections that overlap,
182182
instead of only keeping the child's section. The sections that are merged are "Attributes", "Parameters",
183183
"Methods", "Other Parameters", and "Keyword Arguments" (or their [aliases](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/index.html#docstring-sections)).
184184

185185
- `"numpy_napoleon"`: NumPy-styled docstrings from the parent and child are merged gracefully
186186
with nice formatting. The child's docstring sections take precedence in the case of overlap.
187187
This adheres to the [napoleon specification for the NumPy style](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html#example-numpy).
188188

189-
- `"numpy_napoleon_with_merge"`: Behaves identically to the 'numpy_napoleon' style, but also merges sections
189+
- `"numpy_napoleon_with_merge"`: Behaves identically to the 'numpy_napoleon' style, but also merges - with de-duplication - sections
190190
that overlap, instead of only keeping the child's section. The sections that are merged are "Attributes", "Parameters",
191191
"Methods", "Other Parameters", and "Keyword Arguments" (or their [aliases](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/index.html#docstring-sections)).
192192

@@ -197,7 +197,7 @@ Utilize a built-in style by specifying any of the following names (as a string),
197197

198198
For the `numpy`, `numpy_with_merge`, `numpy_napoleon`, `numpy_napoleon_with_merge`, `google` and `google_with_merge` styles, if the parent's docstring contains a "Raises" section and the child's docstring implements a "Returns" or a "Yields" section instead, then the "Raises" section is not included in the resulting docstring. This is to accomodate for the relatively common use case in which an abstract method/property raises `NotImplementedError`. Child classes that implement this method/property clearly will not raise this. Of course, any "Raises" section that is explicitly included in the child's docstring will appear in the resulting docstring.
199199

200-
Detailed documentation and example cases for the default styles can be found [here](https://github.com/meowklaski/custom_inherit/blob/master/custom_inherit/_style_store.py)
200+
Detailed documentation and example cases for the default styles can be found [here](https://github.com/rsokl/custom_inherit/blob/master/src/custom_inherit/_style_store.py)
201201

202202
## Making New Inheritance Styles
203203
Implementing your inheritance style is simple.

src/custom_inherit/_style_store.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,9 @@ def numpy_with_merge(prnt_doc, child_doc):
444444
Parameters
445445
----------
446446
x: int
447-
description of x
447+
parent's description of x
448448
y: Union[None, int]
449-
description of y
449+
parent's description of y
450450
451451
Raises
452452
------
@@ -463,8 +463,10 @@ def numpy_with_merge(prnt_doc, child_doc):
463463
464464
Parameters
465465
----------
466+
y: int
467+
childs's description of y
466468
z: Union[None, int]
467-
description of z
469+
child's description of z
468470
469471
Returns
470472
-------
@@ -486,11 +488,11 @@ def numpy_with_merge(prnt_doc, child_doc):
486488
Parameters
487489
----------
488490
x: int
489-
description of x
490-
y: Union[None, int]
491-
description of y
491+
parent's description of x
492+
y: int
493+
childs's description of y
492494
z: Union[None, int]
493-
description of z
495+
child's description of z
494496
495497
Returns
496498
-------

0 commit comments

Comments
 (0)