Use legacy np.unique(..., return_counts=True)

This is to support older versions of NumPy
This commit is contained in:
Oleksandr Pavlyk
2026-06-25 11:41:40 -05:00
parent f72c02dba2
commit e75815ff97

View File

@@ -1331,7 +1331,7 @@ def format_support_filter_info(filter_info):
def sorted_unique_counts(values: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
unique_values, unique_counts = np.unique_counts(values)
unique_values, unique_counts = np.unique(values, return_counts=True)
# unique is not guaranteed to return sorted values
# make sure to order them
sorting_indices = np.argsort(unique_values)