Skip to content

Commit

Permalink
Change n_features_ to n_features_in_ for sklearn compatibility (#59)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
eurunuela authored Feb 6, 2024
1 parent 70aa234 commit e91e16f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mapca/mapca.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

import logging

import nibabel as nib
Expand Down Expand Up @@ -401,7 +402,7 @@ def _fit(self, img, mask, subsample_depth=None):
self.singular_values_ = ppca.singular_values_[:n_components]
self.mean_ = ppca.mean_
self.n_components_ = n_components
self.n_features_ = ppca.n_features_
self.n_features_ = ppca.n_features_in_
self.n_samples_ = ppca.n_samples_
# Commenting out noise variance as it depends on the covariance of the estimation
# self.noise_variance_ = ppca.noise_variance_
Expand Down
1 change: 1 addition & 0 deletions mapca/tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Integration test for mapca.
"""

import shutil
from os.path import split

Expand Down
1 change: 1 addition & 0 deletions mapca/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit tests for utils."""

import numpy as np
from pytest import raises
from scipy.signal import detrend
Expand Down
1 change: 1 addition & 0 deletions mapca/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
PCA based on Moving Average (stationary Gaussian) process
"""

import logging

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ exclude_lines = [
]

[tool.pytest]
log_cli = true
log_cli = true

0 comments on commit e91e16f

Please sign in to comment.