Skip to content

Commit 22b1942

Browse files
victorprincipeagoscinski
authored andcommitted
Changed formatting of files for black 23.1.0
1 parent 99618cd commit 22b1942

File tree

11 files changed

+0
-27
lines changed

11 files changed

+0
-27
lines changed

skcosmo/_selection.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ def __init__(
9999
full=False,
100100
random_state=0,
101101
):
102-
103102
self.selection_type = selection_type
104103
self.n_to_select = n_to_select
105104
self.score_threshold = score_threshold
@@ -209,7 +208,6 @@ def fit(self, X, y=None, warm_start=False):
209208
n_iterations -= self.n_selected_
210209

211210
for n in self.report_progress(range(n_iterations)):
212-
213211
new_idx = self._get_best_new_selection(self.score, X, y)
214212
if new_idx is not None:
215213
self._update_post_selection(X, y, new_idx)
@@ -479,7 +477,6 @@ def __init__(
479477
full=False,
480478
random_state=0,
481479
):
482-
483480
self.k = k
484481
self.tolerance = tolerance
485482
self.recompute_every = recompute_every
@@ -537,7 +534,6 @@ def _continue_greedy_search(self, X, y, n_to_select):
537534
"""
538535

539536
for c in self.selected_idx_:
540-
541537
if self.recompute_every != 0 and (
542538
np.linalg.norm(np.take(self.X_current_, [c], axis=self._axis))
543539
> self.tolerance
@@ -612,7 +608,6 @@ def _update_post_selection(self, X, y, last_selected):
612608
self.pi_[last_selected] = 0.0
613609

614610
def _orthogonalize(self, last_selected):
615-
616611
if self._axis == 1:
617612
self.X_current_ = X_orthogonalizer(
618613
x1=self.X_current_, c=last_selected, tol=self.tolerance
@@ -739,7 +734,6 @@ def _continue_greedy_search(self, X, y, n_to_select):
739734
"""
740735

741736
for c in self.selected_idx_:
742-
743737
if self.recompute_every != 0 and (
744738
np.linalg.norm(np.take(self.X_current_, [c], axis=self._axis))
745739
> self.tolerance
@@ -834,7 +828,6 @@ def _compute_pi(self, X, y=None):
834828
return pi
835829

836830
def _orthogonalize(self, last_selected):
837-
838831
if self._axis == 1:
839832
self.X_current_ = X_orthogonalizer(
840833
x1=self.X_current_, c=last_selected, tol=self.tolerance
@@ -992,7 +985,6 @@ def _init_greedy_search(self, X, y, n_to_select):
992985
raise ValueError("Invalid value of the initialize parameter")
993986

994987
def _update_haussdorf(self, X, y, last_selected):
995-
996988
self.haussdorf_at_select_[last_selected] = self.haussdorf_[last_selected]
997989

998990
# distances of all points to the new point
@@ -1147,7 +1139,6 @@ def _init_greedy_search(self, X, y, n_to_select):
11471139
self._update_post_selection(X, y, self.selected_idx_[0])
11481140

11491141
def _update_haussdorf(self, X, y, last_selected):
1150-
11511142
self.haussdorf_at_select_[last_selected] = self.haussdorf_[last_selected]
11521143

11531144
# distances of all points to the new point

skcosmo/decomposition/_kernel_pcovr.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ def __init__(
211211
iterated_power="auto",
212212
random_state=None,
213213
):
214-
215214
self.mixing = mixing
216215
self.n_components = n_components
217216

@@ -542,7 +541,6 @@ def score(self, X, Y):
542541
return -sum([Lkpca, Lkrr])
543542

544543
def _decompose_truncated(self, mat):
545-
546544
if not 1 <= self.n_components <= self.n_samples_:
547545
raise ValueError(
548546
"n_components=%r must be between 1 and "
@@ -601,7 +599,6 @@ def _decompose_truncated(self, mat):
601599
return U, S, Vt
602600

603601
def _decompose_full(self, mat):
604-
605602
if self.n_components != "mle":
606603
if not (0 <= self.n_components <= self.n_samples_):
607604
raise ValueError(

skcosmo/decomposition/_pcovr.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def __init__(
216216
iterated_power="auto",
217217
random_state=None,
218218
):
219-
220219
self.mixing = mixing
221220
self.n_components = n_components
222221
self.space = space
@@ -481,7 +480,6 @@ def _fit_sample_space(self, X, Y, Yhat, W):
481480
self.ptx_ = T.T @ X
482481

483482
def _decompose_truncated(self, mat):
484-
485483
if not 1 <= self.n_components <= min(self.n_samples_, self.n_features_):
486484
raise ValueError(
487485
"n_components=%r must be between 1 and "

skcosmo/preprocessing/_data.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ def fit(self, K=None, y=None, sample_weight=None):
344344
K_pred_cols = np.zeros((Kc.shape[0], 1))
345345

346346
if self.with_trace:
347-
348347
Kc -= self.K_fit_rows_
349348
Kc -= K_pred_cols
350349
Kc += self.K_fit_all_

skcosmo/sample_selection/_voronoi_fps.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class VoronoiFPS(GreedySelector):
5959
def __init__(
6060
self, n_trial_calculation=4, full_fraction=None, initialize=0, **kwargs
6161
):
62-
6362
self.n_trial_calculation = n_trial_calculation
6463
self.full_fraction = full_fraction
6564
self.initialize = initialize

skcosmo/utils/_orthogonalizers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def X_orthogonalizer(x1, c=None, x2=None, tol=1e-12, copy=False):
5050
xnew = x1
5151

5252
for i in range(cols.shape[-1]):
53-
5453
col = cols[:, [i]]
5554

5655
if np.linalg.norm(col) < tol:

skcosmo/utils/_pcovr_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def pcovr_covariance(
157157
C = np.zeros((X.shape[1], X.shape[1]), dtype=np.float64)
158158

159159
if mixing < 1 or return_isqrt:
160-
161160
if rank is None:
162161
rank = min(X.shape)
163162

tests/test_kernel_pcovr.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def test_lr_with_x_errors(self):
6363
prev_error = -1.0
6464

6565
for i, mixing in enumerate(np.linspace(0, 1, 6)):
66-
6766
kpcovr = KernelPCovR(mixing=mixing, n_components=2, tol=1e-12)
6867
kpcovr.fit(self.X, self.Y)
6968

@@ -260,7 +259,6 @@ def test_none_regressor(self):
260259
self.assertTrue(kpcovr.regressor_ is not None)
261260

262261
def test_incompatible_coef_shape(self):
263-
264262
# self.Y is 2D with two targets
265263
# Don't need to test X shape, since this should
266264
# be caught by sklearn's _validate_data
@@ -437,7 +435,6 @@ def test_good_n_components(self):
437435
kpcovr.fit(self.X, self.Y)
438436

439437
for svd_solver in ["auto", "full"]:
440-
441438
# this one should pass
442439
kpcovr = self.model(n_components=2, svd_solver=svd_solver)
443440
kpcovr.fit(self.X, self.Y)

tests/test_orthogonalizers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def __init__(self, *args, **kwargs):
1919
self.random_state = np.random.RandomState(0)
2020

2121
def setUp(self):
22-
2322
self.n_samples = 100
2423
self.n_features = 100
2524

tests/test_pcovr.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def test_lr_with_x_errors(self):
9797
prev_error = -1.0
9898

9999
for i, mixing in enumerate(np.linspace(0, 1, 11)):
100-
101100
pcovr = self.model(mixing=mixing, n_components=2, tol=1e-12)
102101
pcovr.fit(self.X, self.Y)
103102

@@ -206,7 +205,6 @@ def test_spaces_equivalent(self):
206205
are equivalent.
207206
"""
208207
for alpha in np.linspace(0.01, 0.99, 11):
209-
210208
with self.subTest(alpha=alpha, type="prediction"):
211209
pcovr_ss = self.model(
212210
n_components=2, mixing=alpha, tol=1e-12, space="sample"
@@ -285,7 +283,6 @@ def test_good_n_components(self):
285283
pcovr.fit(self.X, self.Y)
286284

287285
for svd_solver in ["auto", "full"]:
288-
289286
# this one should pass
290287
pcovr = self.model(n_components=2, svd_solver=svd_solver)
291288
pcovr.fit(self.X, self.Y)
@@ -489,7 +486,6 @@ def test_none_regressor(self):
489486
self.assertTrue(pcovr.regressor_ is not None)
490487

491488
def test_incompatible_coef_shape(self):
492-
493489
# self.Y is 2D with one target
494490
# Don't need to test X shape, since this should
495491
# be caught by sklearn's _validate_data

0 commit comments

Comments
 (0)