You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an error in the docstring of vertices_to_bounds for the parameter vertices. The docstring says that it must be of shape (N, 2) or (N, M, 4), while in reality it must be (N+1,) (for the 1-D case, I guess (N+1, M+1) for the 2D case?).
Below is the line in the docstring (line 126).
Indeed you are right I think. The first part of the docstring is correct, but the "Parameters" section is wrong. I guess it could simply read: "The vertices to convert." or, for completeness, " The vertices to convert. Must be of shape (N+1,) or (N + 1, M + 1). ".
This distinction between "bounds" and "vertices" is not universal. I've seen "bounds" used for what we call here "vertices", but our definition of bounds is closest to CF, which is what this is all about.
Let's say we have a rectangular grid. We might have lat and lon giving the coordinates of the centers. Then, "Vertices" are two new coordinates giving the corners. If the grid is regular, lat, lon and the corresponding vertices are 1D, but with a rotated grid (for example) they are 2D.
There is an error in the docstring of
vertices_to_bounds
for the parametervertices
. The docstring says that it must be of shape (N, 2) or (N, M, 4), while in reality it must be (N+1,) (for the 1-D case, I guess (N+1, M+1) for the 2D case?).Below is the line in the docstring (line 126).
cf-xarray/cf_xarray/helpers.py
Lines 113 to 126 in 88eff83
Minimal example
prints
which is what we expect.
Proposed solution
I can correct the docstring in a PR. I however don't understand the 2D case, so if anyone can guide me on this I'll be happy.
The text was updated successfully, but these errors were encountered: