Skip to content

Commit 037ff98

Browse files
authored
Minor fix to Point in Face (#1264)
* update return * update docstring
1 parent 7309e50 commit 037ff98

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

uxarray/grid/grid.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,9 +2590,7 @@ def get_faces_containing_point(
25902590
-------
25912591
If `return_counts=True`:
25922592
face_indices : np.ndarray, shape (N, M) or (N,)
2593-
- 2D array of face indices when `counts` contains values >1 or
2594-
when mixed counts exist; unused slots are filled with `INT_FILL_VALUE`.
2595-
- If **all** `counts == 1`, this will be squeezed to a 1-D array of shape `(N,)`.
2593+
- 2D array of face indices with unused slots are filled with `INT_FILL_VALUE`.
25962594
counts : np.ndarray, shape (N,)
25972595
Number of valid face indices in each row of `face_indices`.
25982596
@@ -2643,7 +2641,7 @@ def get_faces_containing_point(
26432641
return output
26442642

26452643
if (counts == 1).all():
2646-
# collapse to a 1D array of length n_points
26472644
face_indices = face_indices[:, 0]
2645+
face_indices = face_indices[:, None]
26482646

26492647
return face_indices, counts

0 commit comments

Comments
 (0)