Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#576)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and larsoner authored Sep 11, 2024
1 parent 3da1c4c commit 2b1e977
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# Ruff mne
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
rev: v0.6.4
hooks:
- id: ruff
args: ["--fix"]
Expand Down
2 changes: 2 additions & 0 deletions mne_nirs/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def examples_path():
)


# TODO: Change ax= to axes= once nilearn 0.11 is out
@pytest.mark.filterwarnings('ignore:The parameter "ax" will be removed.*:')
@pytest.mark.filterwarnings("ignore:No bad channels to interpolate.*:")
@pytest.mark.filterwarnings("ignore:divide by zero encountered.*:")
@pytest.mark.filterwarnings("ignore:invalid value encountered.*:")
Expand Down
6 changes: 5 additions & 1 deletion mne_nirs/utils/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def _tidy_Contrast(data, glm_est, design_matrix):
contrast_type = glm_est.stat_type
else: # nilearn < 0.10
contrast_type = glm_est.contrast_type
effect = glm_est.effect
if effect.ndim == 2: # old nilearn
assert effect.shape[0] == 1
effect = effect[0]
for idx, ch in enumerate(data.ch_names):
df = pd.concat(
[
Expand All @@ -79,7 +83,7 @@ def _tidy_Contrast(data, glm_est, design_matrix):
"ch_name": ch,
"ContrastType": contrast_type,
"variable": "effect",
"value": glm_est.effect[0][idx],
"value": effect[idx],
},
index=[0],
),
Expand Down
5 changes: 4 additions & 1 deletion mne_nirs/visualisation/_plot_GLM_topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ def _plot_glm_contrast_topo(inst, contrast, figsize=(12, 7), sphere=None):
types = np.unique(info.get_channel_types())

# Extract values to plot and rescale to uM
estimates = contrast.effect[0]
estimates = contrast.effect
if estimates.ndim == 2: # old nilearn
assert estimates.shape[0] == 1
estimates = estimates[0]
estimates = estimates * 1e6

# Create subplots for figures
Expand Down

0 comments on commit 2b1e977

Please sign in to comment.