owmeta
owmeta copied to clipboard
Update property documentation
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.
The latest documentation is hosted here: https://pyopenworm.readthedocs.io/en/latest/