Docstring style
(cc: @patrick-wagner the same is true for xorca_brokenline
)
I'd follow Numpy's way of wrinting docstrings. Example: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html
For, e.g., get_ij
, I'd change
"""Get i and j indeces of ORCA grid
of specified lon and lat points
Input:
data - xarray DataSet of any variable(s) living on the
specified grid if xgcm = True e.g. DataArray has
been loaded with load_orca_dataset
OR xarray DataSet of original
mesh_hgr.nc/meshmask.nc if xgcm = False (default)
points - array of size n x 2, first column is latitudes
second column is longitudes
array([[lat_1, lon_1],
[lat_2, lon_2],
...
[lat_n, lon_n]])
grid - string, name of the grid (T, U, V, F)
default = 'F' (the grid used for xorca_brokenline)
xgcm - boolean, True when dataset is compatible with xgcm
default = False
xarray_out - boolean, True when output index
should be xarray DataArray
default = False
"""
to
"""Get i and j indeces of ORCA grid of specified lon and lat points.
Parameters
----------
data : xarray.Dataset
DataSet of any variable(s) living on the specified grid if `xgcm=True`
(i.e., DataArray has been loaded with load_orca_dataset) or
DataSet of original `mesh_hgr.nc/meshmask.nc` if `xgcm=False` (default).
points : array
Numpy array of shape=(n, 2). First column is latitudes, second column
is longitudes.
`array([[lat_1, lon_1], [lat_2, lon_2], ..., [lat_n, lon_n]])`
grid : str
Name of the grid (T, U, V, F). Defaults to `'F'` (which is the grid
used for `xorca_brokenline`.
xgcm : bool
If `True` dataset has to be compatible with xgcm. Defaults to `False`.
xarray_out : book
If `True` output will be an `xarrayDataArray`. Defaults to `False`.
Returns
-------
Numpy array with <TODO: What's in there???> or `xarray.DataArray`.
"""
Edited by Willi Rath