Skip to content

Commit 4622edf

Browse files
committed
Run ruff on changes
1 parent 547eaa5 commit 4622edf

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

pytensor/tensor/ssignal.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import scipy.signal as scipy_signal
2+
3+
from pytensor.graph.basic import Apply
14
from pytensor.tensor import Op, as_tensor_variable
2-
from pytensor.graph.basic import Apply
3-
import pytensor.tensor as pt
45
from pytensor.tensor.type import TensorType
5-
import scipy.signal as scipy_signal
66

77

88
class GaussSpline(Op):
99
__props__ = ("n",)
1010

11-
def __init__(self, n: int = None):
11+
def __init__(self, n: int):
1212
self.n = n
1313

1414
def make_node(self, knots):
@@ -35,4 +35,4 @@ def infer_shape(self, fgraph, node, shapes):
3535

3636

3737
def gauss_spline(x, n):
38-
return GaussSpline(n)(x)
38+
return GaussSpline(n)(x)

tests/tensor/test_ssignal.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
from pytensor.tensor.ssignal import GaussSpline, gauss_spline
2-
from pytensor.tensor.type import matrix
3-
from pytensor import function
4-
from pytensor import tensor as pt
51
import numpy as np
62
import pytest
3+
import scipy.signal as scipy_signal
4+
5+
from pytensor import function
6+
from pytensor.tensor.ssignal import GaussSpline, gauss_spline
7+
from pytensor.tensor.type import matrix
78
from tests import unittest_tools as utt
89

9-
import scipy.signal as scipy_signal
1010

1111
class TestGaussSpline(utt.InferShapeTester):
12-
1312
def setup_method(self):
1413
super().setup_method()
1514
self.op_class = GaussSpline
@@ -20,7 +19,7 @@ def test_make_node_raises(self, n):
2019
a = matrix()
2120
with pytest.raises(ValueError, match="n must be a non-negative integer"):
2221
self.op(a, n=n)
23-
22+
2423
def test_perform(self):
2524
a = matrix()
2625
f = function([a], self.op(a, n=10))
@@ -31,4 +30,4 @@ def test_infer_shape(self):
3130
a = matrix()
3231
self._compile_and_check(
3332
[a], [self.op(a, 16)], [np.random.random((12, 4))], self.op_class
34-
)
33+
)

0 commit comments

Comments
 (0)