owmeta icon indicating copy to clipboard operation
owmeta copied to clipboard

Update property documentation

Open mwatts15 opened this issue 7 years ago • 1 comments

New-style properties (declared in class body) can have documentation attached to them whereas old-style properties (declared in __init__) did not. This allows for automation of documentation generation for those fields by defining docstrings and setting the __doc__ attribute as appropriate. A few classes have already been updated. In addition there are attributes of the property (like its value_type and inverse_of) which are now accessible for documentation generation after module load: these should be added to the doc string.

Example of a new-style properties:

class Clock(DataObject):
    hour = DatatypeProperty() # <--- new-style property
    ''' The hour of the clock ''' # <-- documentation for the property

    minute = DatatypeProperty()
    ''' The minute of the :py:attr:`hour` of the clock '''

    maker = ObjectProperty(value_type=ClockManufacturer) # undocumented

It may not be clear what documentation is appropriate to each attribute, but the first task is just to identify which attributes are lacking documentation.

mwatts15 avatar Jun 04 '18 02:06 mwatts15

The latest documentation is hosted here: https://pyopenworm.readthedocs.io/en/latest/

mwatts15 avatar Jun 04 '18 02:06 mwatts15