Skip to content

Commit

Permalink
update precommit config (nilearn#4391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau authored Apr 24, 2024
1 parent ea3641e commit 9552896
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
35 changes: 21 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ exclude: |
| nilearn/externals/.*
| nilearn/plotting/data/js/.*js
| nilearn/_version.py
| examples/01_plotting/plot_3d_map_to_surface_projection.py
| examples/01_plotting/plot_surf_atlas.py
| examples/01_plotting/plot_surf_stat_map.py
| examples/01_plotting/plot_surface_projection_strategies.py
| examples/04_glm_first_level/plot_localizer_surface_analysis.py
| examples/07_advanced/plot_surface_bids_analysis.py
| nilearn/_utils/helpers.py
| nilearn/plotting/html_surface.py
| nilearn/plotting/js_plotting_utils.py
| nilearn/plotting/surf_plotting.py
| nilearn/plotting/tests/test_html_surface.py
| nilearn/plotting/tests/test_surf_plotting.py
| nilearn/surface/surface.py
| nilearn/surface/tests/test_surface.py
)$
repos:
Expand Down Expand Up @@ -66,6 +52,27 @@ repos:
hooks:
- id: black
args: [--config, pyproject.toml]
exclude: |
(?x)^(
nilearn/datasets/tests/data/localizer_behavioural.tsv
| nilearn/externals/.*
| nilearn/plotting/data/js/.*js
| nilearn/_version.py
| examples/01_plotting/plot_3d_map_to_surface_projection.py
| examples/01_plotting/plot_surf_atlas.py
| examples/01_plotting/plot_surf_stat_map.py
| examples/01_plotting/plot_surface_projection_strategies.py
| examples/04_glm_first_level/plot_localizer_surface_analysis.py
| examples/07_advanced/plot_surface_bids_analysis.py
| nilearn/_utils/helpers.py
| nilearn/plotting/html_surface.py
| nilearn/plotting/js_plotting_utils.py
| nilearn/plotting/surf_plotting.py
| nilearn/plotting/tests/test_html_surface.py
| nilearn/plotting/tests/test_surf_plotting.py
| nilearn/surface/surface.py
| nilearn/surface/tests/test_surface.py
)$
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@

# %%
# At first, we create basic contrasts.
basic_contrasts = dict([(column, contrast_matrix[i])
for i, column in enumerate(design_matrix.columns)])
basic_contrasts = {column: contrast_matrix[i]
for i, column in enumerate(design_matrix.columns)}

# %%
# Next, we add some intermediate contrasts and
Expand Down
2 changes: 1 addition & 1 deletion examples/07_advanced/plot_surface_bids_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
'sub-01' /
'func' /
'sub-01_task-languagelocalizer_desc-preproc_bold.json')
with open(json_file, 'r') as f:
with open(json_file) as f:
t_r = json.load(f)['RepetitionTime']

# %%
Expand Down
8 changes: 4 additions & 4 deletions nilearn/plotting/surf_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,10 @@ def plot_surf(surf_mesh, surf_map=None, bg_map=None,
for parameter, value in parameters_not_implemented_in_plotly.items():
if value is not None:
warn(
(f"'{parameter}' is not implemented "
"for the plotly engine.\n"
f"Got '{parameter} = {value}'.\n"
f"Use '{parameter} = None' to silence this warning."))
f"'{parameter}' is not implemented "
"for the plotly engine.\n"
f"Got '{parameter} = {value}'.\n"
f"Use '{parameter} = None' to silence this warning.")

coords, faces = load_surf_mesh(surf_mesh)

Expand Down

0 comments on commit 9552896

Please sign in to comment.