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

Docstrings #133

Open
geraintpalmer opened this issue Nov 15, 2017 · 4 comments
Open

Docstrings #133

geraintpalmer opened this issue Nov 15, 2017 · 4 comments

Comments

@geraintpalmer
Copy link
Member

Develop a system for writing docstrings that is comprehensive and will be of use to future developers, and for overwriting class methods for implementing behaviour.

Section in docs that use autodoc to show these docstrings.

@daffidwilde
Copy link
Contributor

@geraintpalmer and I are going to start implementing this over the coming weeks and will be using the following format:

    def write_records_to_file(self, file_name, headers=True):
        """
        Writes the data records for all individuals who have completed 
        at least one service to a csv file in the current directory.

        Parameters 
        ----------
        file_name : str
            The name of records file
        headers : bool
            Is the first line of the csv going to be the column labels or not? (True/False)
        
        """

In the case of class definitions there will be an Attributes section, and for methods/functions with outputs there will also be a Returns section explaining what to expect as an output.

Any differences to the norm set out in these docstrings will be detailed in the relevant 'mother' docstrings.

E.g. It will be written in exactnode.py that float should be replaced by Decimal where relevant in other docstrings.

@drvinceknight
Copy link
Contributor

Looks like numpy style (sounds good), this might be of interest: https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/

If you go down the autodoc route be sure to include make html in your CI so that you'll be prewarned of contributions that break your documentation (I forget if you already have this).

@galenseilis
Copy link
Contributor

Should be possible to incrementally check and update parts of the code:

@galenseilis
Copy link
Contributor

While one can always go into GitHub to read the docstrings, or call help, I also think that having an "API Documentation" section of the HTML documentation would be beneficial.

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

4 participants