Skip to content

Commit f493ec1

Browse files
committed
pre-commit fixes
1 parent 1b4d091 commit f493ec1

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

nigsp/tests/test_metrics.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import numpy as np
55
from numpy.random import rand
6-
from pytest import raises
6+
from pytest import raises, warns
77

88
from nigsp.operations import metrics
99
from nigsp.utils import prepare_ndim_iteration
@@ -73,13 +73,22 @@ def test_gsdi():
7373

7474

7575
def test_smoothness():
76-
signal = rand(10, 2)
76+
s1 = rand(10)
77+
s2 = rand(10, 2)
78+
s3 = rand(2, 10)
7779
laplacian = rand(10, 10)
7880

79-
expected_smoothness = np.dot(signal.T, np.dot(laplacian, signal))
80-
computed_smoothness = metrics.smoothness(laplacian, signal)
81+
expected_smoothness1 = np.dot(s1.T, np.dot(laplacian, s1))
82+
expected_smoothness2 = np.dot(s2.T, np.dot(laplacian, s2))
83+
expected_smoothness3 = np.dot(s3, np.dot(laplacian, s3.T))
84+
85+
computed_smoothness1 = metrics.smoothness(laplacian, s1)
86+
computed_smoothness2 = metrics.smoothness(laplacian, s2)
87+
computed_smoothness3 = metrics.smoothness(laplacian, s3)
8188

82-
assert (expected_smoothness == computed_smoothness).all()
89+
assert (expected_smoothness1 == computed_smoothness1).all()
90+
assert (expected_smoothness2 == computed_smoothness2).all()
91+
assert (expected_smoothness3 == computed_smoothness3).all()
8392

8493

8594
# ### Break tests

0 commit comments

Comments
 (0)