Skip to content

Commit

Permalink
better ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
ohrechykha committed Sep 10, 2024
1 parent 1ff29b9 commit 48893b8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ragged/_spec_set_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ def unique_counts(x: array, /) -> tuple[array, array]:
values=ragged.array([]), counts=ragged.array([])
)
values, counts = np.unique(
x_flat.layout.data, return_counts=True, equal_nan=False
) # pylint: disable=E1101
x_flat.layout.data,
return_counts=True,
equal_nan=False, # pylint: disable=E1101
)
return unique_counts_result(
values=ragged.array(values), counts=ragged.array(counts)
)
Expand Down Expand Up @@ -175,8 +177,10 @@ def unique_inverse(x: array, /) -> tuple[array, array]:
values=ragged.array([]), inverse_indices=ragged.array([])
)
values, inverse_indices = np.unique(
x_flat.layout.data, return_inverse=True, equal_nan=False
) # pylint: disable=E1101
x_flat.layout.data,
return_inverse=True,
equal_nan=False, # pylint: disable=E1101
)

return unique_inverse_result(
values=ragged.array(values),
Expand Down

0 comments on commit 48893b8

Please sign in to comment.