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] committed Jan 16, 2024
1 parent 16cbe86 commit 5bd29ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions sparse/_coo/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,8 @@ def sort(x, /, *, axis=-1, descending=False):
"""

from .core import COO
from .._common import moveaxis

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
sparse._common
begins an import cycle.
from .core import COO

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
sparse._coo.core
begins an import cycle.

x = _validate_coo_input(x)

Expand All @@ -1297,9 +1297,7 @@ def sort(x, /, *, axis=-1, descending=False):
x_shape = x.shape
x = x.reshape((-1, x_shape[-1]))

new_coords, new_data = _sort_coo(
x.coords, x.data, x.fill_value, sort_axis_len=x_shape[-1], descending=descending
)
new_coords, new_data = _sort_coo(x.coords, x.data, x.fill_value, sort_axis_len=x_shape[-1], descending=descending)

x = COO(new_coords, new_data, x.shape, has_duplicates=False, sorted=True, fill_value=x.fill_value)

Expand Down
1 change: 0 additions & 1 deletion sparse/tests/test_coo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,6 @@ def test_sort(arr, fill_value, axis, descending):
@pytest.mark.parametrize("fill_value", [-1, 0, 1])
@pytest.mark.parametrize("descending", [False, True])
def test_sort_only_fill_value(fill_value, descending):

arr = np.full((3, 3), fill_value=fill_value)
s_arr = sparse.COO.from_numpy(arr, fill_value)

Expand Down

0 comments on commit 5bd29ad

Please sign in to comment.