Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update property documentation #351

Open
mwatts15 opened this issue Jun 4, 2018 · 1 comment
Open

Update property documentation #351

mwatts15 opened this issue Jun 4, 2018 · 1 comment

Comments

@mwatts15
Copy link
Contributor

mwatts15 commented Jun 4, 2018

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
Copy link
Contributor Author

mwatts15 commented Jun 4, 2018

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

mwatts15 added a commit that referenced this issue Jun 9, 2018
- Including empty Git repo creation

- Making optimizations in various places. Adding docstrings (#350)

- Making it possible to do RealSimpleProperty decls in class body.
  This was added now mostly for documentation purposes, but also because
  eventually, we'll want to add these relationships to the graph (#351)

- Reordering operations to avoid unnecessary work

- Using namedtuple for Statement impl

- Removing unneeded imports in __init__.py

- Removing automodules in PyOpenWorm docstring -- apidoc will handle these
- Adding an excepthook to filter out import_override frames

- Making DataObjectTest backwards compatible with 2.7

- Upgrading numpydoc and updating documentation

- Enabling "related topics" in docs html sidebar

- Enabling warnings

- Adding arg for ContextualizableList decontextualize init

- Changing to "pow.conf" for default config file name. Adding add_graph test

- Putting imports in a named context

- Adding base directory for translation in insert_worm.py: Makes things
  more portable
@mwatts15 mwatts15 added the sp/1 label Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant