| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
* Update pre-commit
* Run pre-commit on all files
|
|
|
|
|
|
|
|
|
|
|
| |
* TST: Add test case for cached_property.
* BUG: Fix detection of cached_property attrs.
Co-authored-by: Tirth Patel <tirthasheshpatel@gmail.com>
* Wrap cached_property import in try/except for Python 3.7.
Co-authored-by: Tirth Patel <tirthasheshpatel@gmail.com>
|
|
|
|
|
|
|
|
|
| |
* TST: Add test case.
* MAINT: Adjust logic for parameter lines with : char.
Adjust logic in parameter line splitting to avoid bug
where Returns objects containing sphinx roles are improperly
parsed.
|
| |
|
|
|
|
|
|
|
| |
* Add pre-commit hook / linter
* Run linter
* Fix GH workflow
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add test for bad behavior.
Fix test.
* Add test for bad behavior.
* Improve object name introspection
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
* Improve test specificity for name introspection
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
|
|
|
| |
Convert string formatting to f-strings with flynt
|
|
|
| |
Otherwise `'.` is seen as the second parameter.
|
|
|
|
|
|
|
| |
While they are not always an actual bug, they are certainly a Python
anti-pattern and possible the source of future bugs.
In at least one case, the default mutable argument `config` is actually
modified later on by the function.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WIP: Move get_doc_obj to docscrape
* WIP: mv _obj property to NumpyDocString
* Proof-of-concept: Docstring attrs covered by refactor.
Running the test suite on this patch demonstrates that refactoring
the boundary between NumpyDocString and SphinxDocString provides the
necessary info to (potentially) do away with the validate.Docstring
class.
* NOTE TO SELF: get_doc_object in docscrape_sphinx
* Docstring -> Validator.
* Activate validation during sphinx-build.
Add a conf option to turn on/off.
TODO: test
* Replace logger.warn with warning.
logger.warn is apparently deprecated
* DOC: Add numpydoc_validate to conf docs.
* Add mechanism for validation check selection.
Adds a config option with a set to allow users to select
which validation checks are used. Default is an empty set,
which means none of the validation checks raise warnings
during the build process.
Add documentation for new option and activate in the doc build.
* TST: modify how MockApp sets builder app.
* TST: Add test of validation warnings.
* Specify some sensible validation defaults.
* Add docstring name to validation warnings.
* Add all keyword to validation_check configuration.
More flexibility in configuring which validation checks to run during
sphinx build. If 'all' is present, treat the rest of the set as a
blocklist, else an allowlist.
* Fix failing test.
* Make validation error mapping easier to read.
* Add check for invalid error codes in configuration.
plus test.
* Add feature to exclude patterns from docstring validation.
Modify updated config name to avoid sphinx warning.
Add documentation for exclusion config value.
* Be explicit about regex syntax for exclude config val
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
* Rm redundant numpydoc_validate config param.
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
|
|
|
|
|
|
|
| |
It's unclear why `self._obj` can be None, but that's what I'm
seeing when trying numpydoc master to build SciPy master.
This fix gives the right traceback.
|
|
|
|
|
|
|
|
|
| |
* More informative error message for see also parse error.
* Improve _error_location method output.
* TST: Update test suite.
* CI: Update sphinx==1.6.5 job from Python 3.5 to 3.6
|
|
|
|
|
|
|
| |
* MAINT: rm unnecessary elses in _str methods
* rm unused indent method from NDS
* rm unused header method from NDS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix param parsing.
Closes #285
This fixes two tings:
- When first sentence of the docstring is onteh first line, Parameters
is not properly parse, which for example mis parsed numpy.array
docstring.
- many project have paremeters description list with ` :` afer the
name, even if no type is present. If there is no space after the `:`
the parameter name includes the ` :` which is most likely wrong.
* test fixture
* make doc a fixture
* Update numpydoc/tests/test_docscrape.py
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
* Update numpydoc/tests/test_docscrape.py
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in a case like:
"""signature
See Also
--------
a,b,c,d
""""
Numpydoc would incorrectly assign `a, b, c, d` as a description with no
name, or type associated items.
Closes #281
|
|
|
|
| |
if ' : ' is present twice in the line this drops any test after the second
' : ', which happens in some docstring that have the `default : stuff` idiom
|
|
|
|
|
|
|
|
|
|
|
| |
* ENH: Better warning for sections.
1) if the number of -/= is too short/ too long warn, Especially too
short it won't be detected as a section.
2) for duplicate section print the docstring to figure out where the
problem is.
* add warn test
|
|
|
|
|
| |
Spyder sometime uses the full :py:meth: role, this make sure it is
properly handled.
|
| |
|
|
|
|
|
|
| |
* F401: Add pytest.main() or clean-up unused import
* F811: remove second identical 'test_returnyield' function
* F821: 'tags' is a special object from sphinx-build; mark with noqa
* F841: clean-up unused local variables
|
|
|
|
|
|
|
|
|
|
|
| |
On handling autodoc-process-signature event, it's not needed to
escape "*" characters. The escaping is mainly allowed for
highlighting feature of editors. So it's not necessary for
generating contents by autodoc.
In addition, since Sphinx-3.0, the escaping is not recommended by
default (see strip_signature_backslash)
refs: https://github.com/sphinx-doc/sphinx/issues/7439
|
|
|
|
|
|
|
|
| |
* Delay import of Sphinx
* ENH: do not import Sphinx unless it has already been imported
* Delay import of Sphinx
|
| |
|
|
|
|
|
|
| |
Only trigger the trailing comma warning if there is also a description on the
same line.
Added a test that the warning is generated.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* ENH: accept autoclass member options
* BUG: options can be None (from review)
* MAINT: fixes from review
Co-Authored-By: mattip <matti.picus@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| |\
| | |
| | | |
Allow see also object ref to incorporate ~ prefix
|
| | |
| | |
| | |
| | | |
Fixes #3
|
| | |
| | |
| | |
| | | |
output
|
|/ / |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix `__str__` for `ParseError` in Python 3, which was resulting in error
messages with `numpydoc.docscrape.ParseError: <unprintable ParseError object>`
instead of the intended descriptive message.
Use `args[0]` instead of `Exception`'s `message` member, which had been removed
in Python 3. `args` is available to both Python 2 and 3. The `__str__` method
had been failing on an `AttributeError` when using `self.message`, resulting in
an unprintable Exception, which occluded the offending typo in a function name
which triggered the`ParseError`.
|
|\
| |
| | |
Allow extending NumpyDocString sections
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Current implementation of NumpyDocString define sections in
`self._parsed_data` in `NumpyDocString.__init__()`, which is not
convenient for developers to extend this class to add more sections. By
setting section definitions as a class static variable, it will be more
convenient for developers to extend more sections by changing the class
static variable `sections`.
|
| | |
|
|/
|
|
| |
closes #64
|