Skip to content

Commit cdefe67

Browse files
committed
Edits re: alex
1 parent ea035b0 commit cdefe67

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/skmatter/utils/_orthogonalizers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def X_orthogonalizer(x1, c=None, x2=None, tol=1e-12, copy=False):
5656
if np.linalg.norm(col) < tol:
5757
warnings.warn("Column vector contains only zeros.", stacklevel=1)
5858
else:
59-
col /= np.linalg.norm(col, axis=0)
59+
col = np.divide(col, np.linalg.norm(col, axis=0))
6060

61-
xnew -= (col @ (col.T @ xnew)).astype(xnew.dtype)
61+
xnew -= (col @ (col.T @ xnew)).astype(xnew.dtype)
6262

6363
return xnew
6464

src/skmatter/utils/_pcovr_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def pcovr_covariance(
186186
C_Y = C_Y.reshape((C.shape[0], -1))
187187
C_Y = np.real(C_Y)
188188

189-
C += (1 - mixing) * np.array(C_Y @ C_Y.T, dtype=np.float64)
189+
C += (1 - mixing) * np.array(C_Y @ C_Y.T, dtype=np.float64)
190190

191191
if mixing > 0:
192192
C += (mixing) * (X.T @ X)

tests/test_greedy_selector.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,18 @@ def test_size_input(self):
123123
selector_feature = GreedyTester(selection_type="feature")
124124
with self.assertRaises(ValueError) as cm:
125125
selector_feature.fit(X)
126-
self.assertEqual(
127-
str(cm.exception),
128-
f"Found array with 1 feature(s) (shape={X.shape})"
129-
" while a minimum of 2 is required.",
130-
)
126+
self.assertEqual(
127+
str(cm.exception),
128+
f"Found array with 1 feature(s) (shape={X.shape})"
129+
" while a minimum of 2 is required.",
130+
)
131131
with self.assertRaises(ValueError) as cm:
132132
selector_sample.fit(X)
133-
self.assertEqual(
134-
str(cm.exception),
135-
"Found array with 1 sample(s) (shape=(1, 5)) while a minimum of 2 is "
136-
"required.",
137-
)
133+
self.assertEqual(
134+
str(cm.exception),
135+
f"Found array with 1 feature(s) (shape={X.shape}) while a minimum of 2 is "
136+
"required.",
137+
)
138138

139139

140140
if __name__ == "__main__":

0 commit comments

Comments
 (0)