Skip to content

Commit e91e16f

Browse files
authored
Change n_features_ to n_features_in_ for sklearn compatibility (#59)
* Changed n_features_ for n_features_in_ * Added dependencies * Add name and description to project toml * Added versioneer to project toml * Wrote full project toml * Revert "Wrote full project toml" This reverts commit b7a7ae0. * Revert "Added versioneer to project toml" This reverts commit efc47b8. * Revert "Add name and description to project toml" This reverts commit a769556. * Revert "Added dependencies" This reverts commit 70aca9b. * Found where we had the versions outside of the project toml. Leaving the project.toml editing for another PR * Fixed package publishing action * Trigger tests * Ran pre-commit * Update max-line-length to make black happy * Fixed the style errors It looks like running `black .` didn't pick up the errors but `flake8 --select BLK` did. Using `python -m black .` fixed the style errors.
1 parent 70aa234 commit e91e16f

5 files changed

Lines changed: 6 additions & 2 deletions

File tree

mapca/mapca.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
with this program; if not, write to the Free Software Foundation, Inc.,
1818
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1919
"""
20+
2021
import logging
2122

2223
import nibabel as nib
@@ -401,7 +402,7 @@ def _fit(self, img, mask, subsample_depth=None):
401402
self.singular_values_ = ppca.singular_values_[:n_components]
402403
self.mean_ = ppca.mean_
403404
self.n_components_ = n_components
404-
self.n_features_ = ppca.n_features_
405+
self.n_features_ = ppca.n_features_in_
405406
self.n_samples_ = ppca.n_samples_
406407
# Commenting out noise variance as it depends on the covariance of the estimation
407408
# self.noise_variance_ = ppca.noise_variance_

mapca/tests/test_integration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Integration test for mapca.
33
"""
4+
45
import shutil
56
from os.path import split
67

mapca/tests/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Unit tests for utils."""
2+
23
import numpy as np
34
from pytest import raises
45
from scipy.signal import detrend

mapca/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
PCA based on Moving Average (stationary Gaussian) process
33
"""
4+
45
import logging
56

67
import numpy as np

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ exclude_lines = [
138138
]
139139

140140
[tool.pytest]
141-
log_cli = true
141+
log_cli = true

0 commit comments

Comments
 (0)