diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1320e7f..1b76182 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,11 +7,11 @@ default_stages: minimum_pre_commit_version: 2.16.0 repos: - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.4 + rev: v3.0.0-alpha.6 hooks: - id: prettier - repo: https://github.com/asottile/blacken-docs @@ -43,8 +43,8 @@ repos: args: [--fix=lf] - id: trailing-whitespace - id: check-case-conflict - - repo: https://github.com/myint/autoflake - rev: v2.0.0 + - repo: https://github.com/PyCQA/autoflake + rev: v2.0.2 hooks: - id: autoflake args: diff --git a/sobolev_alignment/scvi_model_search.py b/sobolev_alignment/scvi_model_search.py index 007472b..d0ea227 100644 --- a/sobolev_alignment/scvi_model_search.py +++ b/sobolev_alignment/scvi_model_search.py @@ -194,10 +194,6 @@ def _objective_function(params): def split_dataset(data_an, test_size=0.1): """Split between training and testing""" train_data_df, test_data_df = train_test_split(data_an.to_df(), test_size=test_size) - train_data_an = data_an[ - train_data_df.index, - ] - test_data_an = data_an[ - test_data_df.index, - ] + train_data_an = data_an[train_data_df.index,] + test_data_an = data_an[test_data_df.index,] return train_data_an, test_data_an diff --git a/sobolev_alignment/sobolev_alignment.py b/sobolev_alignment/sobolev_alignment.py index e103174..85e01f3 100644 --- a/sobolev_alignment/sobolev_alignment.py +++ b/sobolev_alignment/sobolev_alignment.py @@ -329,7 +329,6 @@ def _train_krr( frob_norm_source: bool = False, lib_size_norm: bool = False, ): - if n_krr_clfs == 1: self.approximate_krr_regressions_[data_source] = self._train_one_krr( data_source=data_source, @@ -702,7 +701,6 @@ def _memmap_log_processing( unit_std: bool = False, frob_norm_source: bool = False, ): - # Save embedding if save_mmap is not None and type(save_mmap) == str: self._save_mmap = save_mmap diff --git a/tests/test_krr_approx.py b/tests/test_krr_approx.py index b499b9c..881c2e3 100644 --- a/tests/test_krr_approx.py +++ b/tests/test_krr_approx.py @@ -176,7 +176,6 @@ def test_laplacian_falkon_fit(self, fit_falkon_laplacian_ridge, valid_input, val assert pearson_corr[0] > pearson_threshold def test_ridge_coef_sklearn_fit(self, fit_sklearn_laplacian_ridge, input, valid_input): - pred_reconstruct = fit_sklearn_laplacian_ridge.kernel_( valid_input, input[fit_sklearn_laplacian_ridge.ridge_samples_idx_, :] ) @@ -186,7 +185,6 @@ def test_ridge_coef_sklearn_fit(self, fit_sklearn_laplacian_ridge, input, valid_ ) def test_ridge_coef_falkon_fit(self, fit_falkon_laplacian_ridge, input, valid_input): - pred_reconstruct = fit_falkon_laplacian_ridge.kernel_(valid_input, fit_falkon_laplacian_ridge.anchors()) pred_reconstruct = pred_reconstruct.matmul(fit_falkon_laplacian_ridge.sample_weights_) np.testing.assert_array_almost_equal(