Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and mtsokol committed Jan 16, 2024
1 parent 6aefc97 commit af4ea95
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sparse/_coo/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,8 @@ def _sort_coo(
for idx, group in enumerate(np.append(group_coords, -1)):
if group == prev_group:
continue

Check warning on line 1380 in sparse/_coo/common.py

View check run for this annotation

Codecov / codecov/patch

sparse/_coo/common.py#L1378-L1380

Added lines #L1378 - L1380 were not covered by tests
elif prev_group != -1:

if prev_group != -1:
group_last_idx = idx

Check warning on line 1383 in sparse/_coo/common.py

View check run for this annotation

Codecov / codecov/patch

sparse/_coo/common.py#L1382-L1383

Added lines #L1382 - L1383 were not covered by tests

group_slice = slice(group_first_idx, group_last_idx)
Expand All @@ -1398,10 +1399,12 @@ def _sort_coo(
indices = np.arange(group_size)

Check warning on line 1399 in sparse/_coo/common.py

View check run for this annotation

Codecov / codecov/patch

sparse/_coo/common.py#L1398-L1399

Added lines #L1398 - L1399 were not covered by tests
# find a place where fill_value would be
for pos in range(group_size):
if (not descending and fill_value < data[group_slice][pos]) or (descending and fill_value > data[group_slice][pos]):
if (not descending and fill_value < data[group_slice][pos]) or (

Check warning on line 1402 in sparse/_coo/common.py

View check run for this annotation

Codecov / codecov/patch

sparse/_coo/common.py#L1401-L1402

Added lines #L1401 - L1402 were not covered by tests
descending and fill_value > data[group_slice][pos]
):
indices[pos:] += fill_value_count
break
result_indices[group_first_idx : group_last_idx] = indices
result_indices[group_first_idx:group_last_idx] = indices

Check warning on line 1407 in sparse/_coo/common.py

View check run for this annotation

Codecov / codecov/patch

sparse/_coo/common.py#L1405-L1407

Added lines #L1405 - L1407 were not covered by tests

prev_group = group
group_first_idx = idx

Check warning on line 1410 in sparse/_coo/common.py

View check run for this annotation

Codecov / codecov/patch

sparse/_coo/common.py#L1409-L1410

Added lines #L1409 - L1410 were not covered by tests
Expand Down

0 comments on commit af4ea95

Please sign in to comment.