uncertainties
uncertainties copied to clipboard
Documentation for unumpy.isnan(), etc. is unhelpful
The documentation for unumpy.isnan() is the documentation for numpy.vectorize(). This is not helpful. It would be better to display the NumPy documentation, prefixed by a note about unumpy.isnan() being a generalization to numbers with uncertainty.
PS: This behavior is documented:
The definition of the mathematical quantities calculated by these functions is available in the documentation for uncertainties.umath (which is accessible through help() or pydoc).
The documentation should be updated if the unumpy functions become documented.
The problem is actually more subtle:
print unumpy.isnan.__doc__is correct, but…- …
help(unumpy.isnan)does not show this docstring but instead the doc for vectorize (this is the same aspydoc.render_doc(unumpy.isnan)), - … while IPython's
unumpy.isnan?shows both, under "Docstring" and "Class docstring".
The problem comes from the fact that unumpy.isnan() is not a Python function object but a numpy.lib.function_base.vectorize object: __doc__ is looked up "for modules, classes, functions and methods", not instances.
A solution would be to convert unumpy.isnan() to a function that simply calls the vectorize instance, but this would incur a time penalty.