You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deffoo(bar: str) ->None:
""" Parameters ---------- bar : {'integer', 'float'} Some description. """ifbarnotin {'integer', 'float'}:
raiseValueError('bar is neither "integer" nor "float"')
The parameter bar is a str, and can only take on the values 'integer' and 'float'. However, if I run numpydoc on it, it reports:
$ python -m numpydoc t.foo --validatet.foo:SS01:No summary found (a short summary in a single line should be present at the beginning of the docstring)t.foo:ES01:No extended summary foundt.foo:PR06:Parameter "bar" type should use "int" instead of "integer"t.foo:SA01:See Also section not foundt.foo:EX01:No examples section found
The first 2 and last 2 errors are expected, but the middle one (PR06) feels like a false positive.
Say I have the following:
The parameter
bar
is astr
, and can only take on the values'integer'
and'float'
. However, if I runnumpydoc
on it, it reports:The first 2 and last 2 errors are expected, but the middle one (
PR06
) feels like a false positive.Noticed when trying to validate
pandas.to_numeric
(https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_numeric.html), which has a parameterdowncast
which can be equal to the string'integer'
The text was updated successfully, but these errors were encountered: