Skip to content

Commit fc50840

Browse files
committed
work on docstrings
1 parent d7ed5d2 commit fc50840

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

uxarray/cross_sections/dataarray_accessor.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def __call__(
5555
"Must specify exactly one mode (keyword-only): start & end, OR lon, OR lat."
5656
)
5757

58-
# Sample points based on mode
5958
if great_circle:
6059
points_xyz, points_latlon = sample_geodesic(start, end, steps)
6160
elif const_lat:
@@ -76,16 +75,16 @@ def __call__(
7675
new_dims = [new_dim if d == "n_face" else d for d in orig_dims]
7776
dim_axis = new_dims.index(new_dim)
7877

79-
# Pull data into a NumPy array, moving face → last axis
78+
# TODO:
8079
arr = np.moveaxis(
8180
self.uxda.compute().data, face_axis, -1
8281
) # now shape (..., n_face)
83-
M, Nf = arr.reshape(-1, arr.shape[-1]).shape # M = product of all other dims
82+
M, Nf = arr.reshape(-1, arr.shape[-1]).shape
8483
flat_orig = arr.reshape(M, Nf)
8584

8685
# Fill along the arc with nearest‐neighbor
87-
flat_filled = _fill_numba(flat_orig, face_idx, Nf, steps) # shape (M, steps)
88-
filled = flat_filled.reshape(*arr.shape[:-1], steps) # shape (..., steps)
86+
flat_filled = _fill_numba(flat_orig, face_idx, Nf, steps)
87+
filled = flat_filled.reshape(*arr.shape[:-1], steps)
8988

9089
# Move steps axis back to its proper position
9190
data = np.moveaxis(filled, -1, dim_axis)
@@ -95,11 +94,10 @@ def __call__(
9594
# index along the arc
9695
coords[new_dim] = np.arange(steps)
9796

98-
# attach lat/lon vectors (length = steps)
97+
# attach lat/lon vectors
9998
coords["lat"] = (new_dim, points_latlon[:, 0])
10099
coords["lon"] = (new_dim, points_latlon[:, 1])
101100

102-
# now build & return
103101
return xr.DataArray(
104102
data,
105103
dims=new_dims,

0 commit comments

Comments
 (0)