← Back to team overview

python-quantities-developers team mailing list archive

[Bug 389778] Re: Should use docstrings to document units

 

** Changed in: python-quantities
       Status: Fix Committed => Fix Released

-- 
Should use docstrings to document units
https://bugs.launchpad.net/bugs/389778
You received this bug notification because you are a member of Python
Quantities Development Team, which is subscribed to python-quantities.

Status in Physical Quantities for Python: Fix Released

Bug description:
You should use docstrings in the unit and constant definitions for each unit, to provide helpful text instead of just leaving it in the source code comments.  In IPython, for instance, you can see the (example) docstring very easily:


    In [17]: quantities.au?
    Type:		UnitLength
    Base Class:	<class 'quantities.unitquantity.UnitLength'>
    String Form:	1 au (astronomical_unit)
    Namespace:	Interactive
    File:		/usr/local/lib/python2.6/dist-packages/quantities-0.5b2-py2.6.egg/quantities/unitquantity.py
    Docstring:
        An astronomical unit (abbreviated as AU, au, a.u., or sometimes ua) is a 
        unit of length roughly equal to the mean distance between the Earth and 
        the Sun. It is approximately 150 million kilometres (93 million miles).
        See http://en.wikipedia.org/wiki/Astronomical_unit