Skip to content

Commit

Permalink
Fix some formatting deltas and exclude some rules that apply more bro…
Browse files Browse the repository at this point in the history
…adly than before.
  • Loading branch information
ntjohnson1 committed Nov 3, 2024
1 parent a6aa7b2 commit 7a18ce1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ ignore = [
"tests/**.py" = ["E", "PL", "W", "N", "NPY", "RUF", "B"]
# Ignore everything for now
"docs/**.py" = ["E", "F", "PL", "W", "I", "N", "NPY", "RUF", "B"]
"docs/**.ipynb" = ["E", "F", "PL", "W", "I", "N", "NPY", "RUF", "B"]
"profiling/**.ipynb" = ["E", "F", "PL", "W", "I", "N", "NPY", "RUF", "B"]

[tool.ruff.format]
docstring-code-format = true
Expand Down
4 changes: 2 additions & 2 deletions pyttb/cp_apr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ def tt_cp_apr_pqnr( # noqa: PLR0912,PLR0913,PLR0915


@overload
def tt_calcpi_prowsubprob( # noqa: PLR0913
def tt_calcpi_prowsubprob(
Data: ttb.sptensor,
Model: ttb.ktensor,
rank: int,
Expand All @@ -1150,7 +1150,7 @@ def tt_calcpi_prowsubprob( # noqa: PLR0913


@overload
def tt_calcpi_prowsubprob( # noqa: PLR0913
def tt_calcpi_prowsubprob(
Data: ttb.tensor,
Model: ttb.ktensor,
rank: int,
Expand Down
6 changes: 3 additions & 3 deletions pyttb/gcp/fg_est.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@overload
def estimate( # noqa: PLR0913
def estimate(
model: ttb.ktensor,
data_subs: np.ndarray,
data_vals: np.ndarray,
Expand All @@ -30,7 +30,7 @@ def estimate( # noqa: PLR0913


@overload
def estimate( # noqa: PLR0913
def estimate(
model: ttb.ktensor,
data_subs: np.ndarray,
data_vals: np.ndarray,
Expand All @@ -43,7 +43,7 @@ def estimate( # noqa: PLR0913


@overload
def estimate( # noqa: PLR0913
def estimate(
model: ttb.ktensor,
data_subs: np.ndarray,
data_vals: np.ndarray,
Expand Down
18 changes: 9 additions & 9 deletions pyttb/sptensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def innerprod(
>>> S = ttb.sptensor()
>>> S[0, 0] = 1
... S[1, 1] = 2
>>> S[1, 1] = 2
>>> S
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
Expand Down Expand Up @@ -899,7 +899,7 @@ def isequal(self, other: Union[sptensor, ttb.tensor]) -> bool:
>>> S = ttb.sptensor()
>>> S[0, 0] = 1
... S[1, 1] = 2
>>> S[1, 1] = 2
>>> S
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
Expand Down Expand Up @@ -940,7 +940,7 @@ def logical_and(self, other: Union[float, sptensor, ttb.tensor]) -> sptensor:
>>> S = ttb.sptensor()
>>> S[0, 0] = 1
... S[1, 1] = 2
>>> S[1, 1] = 2
>>> S
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
Expand Down Expand Up @@ -1005,7 +1005,7 @@ def logical_not(self) -> sptensor:
>>> S = ttb.sptensor()
>>> S[0, 0] = 1
... S[1, 1] = 2
>>> S[1, 1] = 2
>>> S
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
Expand Down Expand Up @@ -1048,7 +1048,7 @@ def logical_or(
>>> S = ttb.sptensor()
>>> S[0, 0] = 1
... S[1, 1] = 2
>>> S[1, 1] = 2
>>> S.logical_or(S)
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
Expand Down Expand Up @@ -1119,7 +1119,7 @@ def logical_xor(
>>> S = ttb.sptensor()
>>> S[0, 0] = 1
... S[1, 1] = 2
>>> S[1, 1] = 2
>>> S.logical_xor(S)
empty sparse tensor of shape (2, 2)
Expand Down Expand Up @@ -1178,7 +1178,7 @@ def mask(self, W: sptensor) -> np.ndarray:
>>> S = ttb.sptensor()
>>> S[0, 0] = 1
... S[1, 1] = 2
>>> S[1, 1] = 2
>>> S
sparse tensor of shape (2, 2) with 2 nonzeros
[0, 0] = 1.0
Expand All @@ -1189,7 +1189,7 @@ def mask(self, W: sptensor) -> np.ndarray:
>>> W = ttb.sptensor()
>>> W[0, 0] = 1
... W[1, 1] = 1
>>> W[1, 1] = 1
>>> S.mask(W)
array([[1.],
[2.]])
Expand All @@ -1199,7 +1199,7 @@ def mask(self, W: sptensor) -> np.ndarray:
>>> W = ttb.sptensor()
>>> W[0, 0] = 1
... W[1, 0] = 1
>>> W[1, 0] = 1
>>> S.mask(W)
array([[1.],
[0.]])
Expand Down
2 changes: 1 addition & 1 deletion pyttb/tenmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class tenmat:

__slots__ = ("tshape", "rindices", "cindices", "data")

def __init__( # noqa: PLR0912, PLR0913
def __init__( # noqa: PLR0912
self,
data: Optional[np.ndarray] = None,
rdims: Optional[np.ndarray] = None,
Expand Down

0 comments on commit 7a18ce1

Please sign in to comment.