Skip to content

Commit 92e8078

Browse files
[pre-commit.ci] pre-commit autoupdate (#648)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](astral-sh/ruff-pre-commit@v0.2.2...v0.3.2) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix line-length rule violation. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hameer Abbasi <[email protected]>
1 parent 0e5506e commit 92e8078

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
args: ["--autofix", "--no-ensure-ascii"]
1818

1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.2.2
20+
rev: v0.3.2
2121
hooks:
2222
- id: ruff
2323
args: ["--fix"]

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ include = ["sparse", "sparse.*"]
5656
version_file = "sparse/_version.py"
5757

5858
[tool.ruff]
59-
select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]
6059
exclude = ["sparse/_version.py"]
6160
line-length = 120
6261

62+
[tool.ruff.lint]
63+
select = ["F", "E", "W", "I", "B", "UP", "YTT", "BLE", "C4", "T10", "ISC", "ICN", "PIE", "PYI", "RSE", "RET", "SIM", "PGH", "FLY", "NPY", "PERF"]
64+
6365
[tool.ruff.lint.isort.sections]
6466
numpy = ["numpy", "numpy.*", "scipy", "scipy.*"]
6567

sparse/_compressed/compressed.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ def T(self):
320320
return self.transpose()
321321

322322
def __str__(self):
323-
summary = "<GCXS: shape={}, dtype={}, nnz={}, fill_value={}, compressed_axes={}>".format(
324-
self.shape, self.dtype, self.nnz, self.fill_value, self.compressed_axes
323+
summary = (
324+
f"<GCXS: shape={self.shape}, dtype={self.dtype}, nnz={self.nnz}, fill_value={self.fill_value}, "
325+
f"compressed_axes={self.compressed_axes}>"
325326
)
326327
return self._str_impl(summary)
327328

@@ -834,12 +835,9 @@ def __init__(self, arg, shape=None, compressed_axes=None, prune=False, fill_valu
834835
)
835836

836837
def __str__(self):
837-
summary = "<{}: shape={}, dtype={}, nnz={}, fill_value={}>".format(
838-
type(self).__name__,
839-
self.shape,
840-
self.dtype,
841-
self.nnz,
842-
self.fill_value,
838+
summary = (
839+
f"<{type(self).__name__}: shape={self.shape}, dtype={self.dtype}, nnz={self.nnz}, "
840+
f"fill_value={self.fill_value}>"
843841
)
844842
return self._str_impl(summary)
845843

sparse/_coo/numba_extension.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
For now, this just supports attribute access
55
"""
6+
67
import contextlib
78

89
import numba

0 commit comments

Comments
 (0)