-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If already numpydoc format, will remove the Raises section #49
Comments
Docstrings containing a section following the "Raises" section will result in pyment correctly parsing and generating an empty diff! def func1(param1):
"""Function 1
with 1 param
Parameters
----------
param1 : type
1st parameter
Returns
-------
string
a message
Raises
------
KeyError
when a key error
Notes
-----
Some notes
"""
return "huh" To debug the code I reactivated the already existing but commented test To fix the issue one had to calculate the correct, positive relative end index in NumpydocTools.get_list_key instead of using -1 as end index. But because there are more issues with already existing numpydoc which gets "converted" to numpydoc I left the tests untouched and I also did not modify the See PR #60 |
The issue is fixed by the wagnerpeer refactorization. |
If a function is already described by a Numpydoc docstring, Pyment will remove the raises section when producing Numpydoc output docstring instead of keeping as is.
The following code (from
tests/docs_already_numpydoc.py
):Will produce the patch:
This example is in the test suite
test_pyment_cases
.The text was updated successfully, but these errors were encountered: