Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Updating the README to give examples of docstring layout.
  • Loading branch information
astronomerritt authored Mar 1, 2024
1 parent c605b7b commit 0a46f30
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,49 @@ If you are adding code that should be run from the command line, this should be
adler = "adler.adler:main"
my_command = "adler.module_folder.module_name:function_name"
```

## Dev Guide - Docstrings

The docstrings use the numpydoc format. This is the format expected by the LINCC Frameworks template and results
in docstrings which compile neatly and automatically for the docs.

An example is below. Don't include the Returns section if your code returns nothing.

```
"""Here is a function that does some cool sciency stuff.
- Perhaps you want to add some bullet points.
- You can do that like this!
Parameters
-----------
arg1 : int
The first argument to the function.
arg2 : str
The second argument to the function. Default = "foo".
Returns
----------
return_value : float
The thing your function returns.
"""
```

For classes:

```
"""A class that contains some important science information.
Attibutes
-----------
attr1 : int
The first class attribute.
attr2: np.array
The second class attribute.
"""
```

0 comments on commit 0a46f30

Please sign in to comment.