Skip to content

Commit

Permalink
moved docstrings example to developer guide to keep contributing.md m…
Browse files Browse the repository at this point in the history
…ore concise and have everything at one place
  • Loading branch information
JuliaKukulies committed Apr 10, 2024
1 parent 9ed0420 commit 6aeb9e1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ to learn about our project goals and check the
[changelog.md](https://github.com/tobac-project/tobac/blob/main/CHANGELOG.md).
* More details on the code structure and further help for code contributions can be found in our [developer
guide](https://tobac.readthedocs.io/code_structure.html)
* Before you start a pull request, please make sure that you added [numpydoc docstrings](#docstringExample) to your
functions. This way the api documentation will be parsed properly.
* Before you start a pull request, please make sure that you added [numpydoc
docstrings](https://numpydoc.readthedocs.io/en/latest/format.html) to your
functions. See [docstring example in the developer guide](https://tobac.readthedocs.io/contributing.html).This way the
api documentation will be parsed properly.
* If it is a larger change or an newly added feature or workflow, please add an example in the [example
folder](https://github.com/tobac-project/tobac/tree/main/examples) or adapt the existing examples there.
* The code should be PEP 8 compliant, as this facilitates our collaboration. Please use the first stable version (22.6.0) of [black](https://black.readthedocs.io/en/stable/) to format your code. When you submit a pull request, all files are checked for formatting.
Expand Down
34 changes: 34 additions & 0 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,40 @@ git basics

* **Create a pull request from your fork:** We use our personal forks of the tobac repository to create pull requests. This means that you have to first commit and push your local changes to your personal fork and then create a pull request from that fork: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

===================================
Writing proper documentation
===================================

Please provide **Numpy Docstrings** for all new functions.

**Example**:

``
'''
calculate centre of gravity and mass forech individual tracked cell in the simulation


Parameters
----------
tracks : pandas.DataFram
DataFrame containing trajectories of cell centres

param mass : iris.cube.Cube
cube of quantity (need coordinates 'time', 'geopotential_height','projection_x_coordinate' and
'projection_y_coordinate')

param mask : iris.cube.Cube
cube containing mask (int > where belonging to cloud volume, 0 everywhere else )


Returns
-------
track_out : pandas.DataFrame
Dataframe containing t,x,y,z positions of centre of gravity and total cloud mass each tracked cells
at each timestep

'''
``


===================================
Expand Down

0 comments on commit 6aeb9e1

Please sign in to comment.