Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 2, 2024
1 parent 0ece42a commit 51579f8
Show file tree
Hide file tree
Showing 68 changed files with 316 additions and 330 deletions.
21 changes: 11 additions & 10 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# project-template documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 18 14:44:12 2016.
Expand All @@ -12,19 +11,21 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

from datetime import datetime, timezone
import sys
import os
import sys
import warnings
from datetime import datetime, timezone

import sphinx.util.logging
from sphinx_gallery.sorting import FileNameSortKey

sys.path.append("../")
import mne
from mne.fixes import _compare_version
import mne_nirs
from mne.tests.test_docstring_parameters import error_ignores

import mne_nirs

sphinx_logger = sphinx.util.logging.getLogger("mne")

# -- Path setup --------------------------------------------------------------
Expand Down Expand Up @@ -291,8 +292,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'project-template.tex', u'project-template Documentation',
u'Robert Luke', 'manual'),
('index', 'project-template.tex', 'project-template Documentation',
'Robert Luke', 'manual'),
]


Expand All @@ -301,8 +302,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'project-template', u'project-template Documentation',
[u'Robert Luke'], 1)
('index', 'project-template', 'project-template Documentation',
['Robert Luke'], 1)
]


Expand All @@ -312,8 +313,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'project-template', u'project-template Documentation',
u'Robert Luke', 'project-template', 'One line description of project.',
('index', 'project-template', 'project-template Documentation',
'Robert Luke', 'project-template', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
4 changes: 2 additions & 2 deletions examples/general/plot_01_data_io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
r"""
.. _tut-importing-fnirs-data:
Expand Down Expand Up @@ -166,9 +165,10 @@
# %%

import os.path as op

import mne
import numpy as np
import pandas as pd
import mne

# sphinx_gallery_thumbnail_number = 2

Expand Down
2 changes: 1 addition & 1 deletion examples/general/plot_05_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
# License: BSD (3-clause)


import mne_nirs
import mne_bids.stats

import mne_nirs

# %%
# *******************
Expand Down
12 changes: 5 additions & 7 deletions examples/general/plot_06_gowerlabs.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
r"""
.. _tut-gowerlabs-data:
========================
Read Gowerlabs LUMO data
========================
`LUMO <https://www.gowerlabs.co.uk/lumo>`__ is a modular, wearable,
`LUMO <https://www.gowerlabs.co.uk/lumo>`__ is a modular, wearable,
high-density diffuse optical tomography (HD-DOT) system produced by
`Gowerlabs <https://www.gowerlabs.co.uk>`__. This tutorial demonstrates
how to load data from LUMO, and how to utilise 3D digitisation
Expand All @@ -31,12 +30,11 @@
# License: BSD (3-clause)

import os.path as op

import mne
from mne.datasets.testing import data_path

from mne.viz import set_3d_view


# %%
# Import Gowerlabs Example File
# -----------------------------
Expand Down Expand Up @@ -81,7 +79,7 @@
#
# We observe valid data in each channel, and note that the file includes a
# number of event annotations.
# Annotations are a flexible tool to represent events in your experiment.
# Annotations are a flexible tool to represent events in your experiment.
# They can also be used to annotate other useful information such as bad
# segments of data, participant movements, etc. We can inspect the
# annotations to ensure they match what we expect from our experiment.
Expand All @@ -93,8 +91,8 @@
# The implementation of annotations varies between manufacturers. Rather
# than recording the onset and duration of a stimulus condition, LUMO records
# discrete event markers which have a nominal one second duration. Each
# marker can consist of an arbitrary character or string. In this sample,
# there were six `A` annotations, one `Cat` annotation, and two `Dog`
# marker can consist of an arbitrary character or string. In this sample,
# there were six `A` annotations, one `Cat` annotation, and two `Dog`
# annotations. We can view the specific data for each annotation by converting
# the annotations to a dataframe.

Expand Down
8 changes: 5 additions & 3 deletions examples/general/plot_10_hrf_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
#
# License: BSD (3-clause)

import mne
import mne_nirs
import matplotlib.pylab as plt
import mne
import numpy as np
from nilearn.plotting import plot_design_matrix

import mne_nirs
from mne_nirs.experimental_design import make_first_level_design_matrix
from mne_nirs.statistics import run_glm
from nilearn.plotting import plot_design_matrix

np.random.seed(1)


Expand Down
16 changes: 6 additions & 10 deletions examples/general/plot_11_hrf_measured.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,16 @@
# License: BSD (3-clause)

import os
import numpy as np
import matplotlib.pyplot as plt

import matplotlib.pyplot as plt
import mne
import mne_nirs
import numpy as np
from nilearn.plotting import plot_design_matrix

import mne_nirs
from mne_nirs.channels import get_long_channels, get_short_channels, picks_pair_to_idx
from mne_nirs.experimental_design import make_first_level_design_matrix
from mne_nirs.statistics import run_glm
from mne_nirs.channels import (get_long_channels,
get_short_channels,
picks_pair_to_idx)

from nilearn.plotting import plot_design_matrix


# %%
# Import raw NIRS data
Expand Down Expand Up @@ -141,7 +137,7 @@
fig, ax = plt.subplots(figsize=(15, 6), constrained_layout=True)
ax.plot(raw_haemo.times, s)
ax.legend(["Control", "Left", "Right"], loc="upper right")
ax.set_xlabel("Time (s)");
ax.set_xlabel("Time (s)")


# %%
Expand Down
37 changes: 17 additions & 20 deletions examples/general/plot_12_group_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,31 @@


# Import common libraries
import matplotlib as mpl

# Import Plotting Library
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

# Import MNE processing
from mne.preprocessing.nirs import optical_density, beer_lambert_law
# Import StatsModels
import statsmodels.formula.api as smf

# Import MNE-NIRS processing
from mne_nirs.statistics import run_glm
from mne_nirs.experimental_design import make_first_level_design_matrix
from mne_nirs.statistics import statsmodels_to_results
from mne_nirs.channels import get_short_channels, get_long_channels
from mne_nirs.channels import picks_pair_to_idx
from mne_nirs.visualisation import plot_glm_group_topo
from mne_nirs.datasets import fnirs_motor_group
from mne_nirs.visualisation import plot_glm_surface_projection
from mne_nirs.io.fold import fold_channel_specificity
# Import MNE processing
from mne.preprocessing.nirs import beer_lambert_law, optical_density

# Import MNE-BIDS processing
from mne_bids import BIDSPath, read_raw_bids, get_entity_vals

# Import StatsModels
import statsmodels.formula.api as smf
from mne_bids import BIDSPath, get_entity_vals, read_raw_bids

# Import Plotting Library
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
from mne_nirs.channels import get_long_channels, get_short_channels, picks_pair_to_idx
from mne_nirs.datasets import fnirs_motor_group
from mne_nirs.experimental_design import make_first_level_design_matrix
from mne_nirs.io.fold import fold_channel_specificity

# Import MNE-NIRS processing
from mne_nirs.statistics import run_glm, statsmodels_to_results
from mne_nirs.visualisation import plot_glm_group_topo, plot_glm_surface_projection

# %%
# Set up directories
Expand Down
24 changes: 11 additions & 13 deletions examples/general/plot_13_fir_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,26 @@


# Import common libraries
# Import Plotting Library
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

# Import MNE processing
from mne.preprocessing.nirs import optical_density, beer_lambert_law
# Import StatsModels
import statsmodels.formula.api as smf

# Import MNE-NIRS processing
from mne_nirs.statistics import run_glm
from mne_nirs.experimental_design import make_first_level_design_matrix
from mne_nirs.statistics import statsmodels_to_results
from mne_nirs.datasets import fnirs_motor_group
from mne_nirs.channels import get_short_channels, get_long_channels
# Import MNE processing
from mne.preprocessing.nirs import beer_lambert_law, optical_density

# Import MNE-BIDS processing
from mne_bids import BIDSPath, read_raw_bids

# Import StatsModels
import statsmodels.formula.api as smf

# Import Plotting Library
import matplotlib.pyplot as plt
from mne_nirs.channels import get_long_channels, get_short_channels
from mne_nirs.datasets import fnirs_motor_group
from mne_nirs.experimental_design import make_first_level_design_matrix

# Import MNE-NIRS processing
from mne_nirs.statistics import run_glm, statsmodels_to_results

# %%
# Define FIR analysis
Expand Down
21 changes: 12 additions & 9 deletions examples/general/plot_14_glm_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,24 @@

# Import common libraries
import os
import numpy as np
import mne

# Import MNE-NIRS processing
from mne_nirs.experimental_design import make_first_level_design_matrix, \
longest_inter_annotation_interval, drift_high_pass
import matplotlib as mpl

# Import Plotting Library
import matplotlib.pyplot as plt
import mne
import numpy as np

# Import Nilearn
from nilearn.glm import first_level
from nilearn.plotting import plot_design_matrix

# Import Plotting Library
import matplotlib.pyplot as plt
import matplotlib as mpl

# Import MNE-NIRS processing
from mne_nirs.experimental_design import (
drift_high_pass,
longest_inter_annotation_interval,
make_first_level_design_matrix,
)

# %%
# Haemodynamic Response Function
Expand Down
39 changes: 21 additions & 18 deletions examples/general/plot_16_waveform_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,33 +76,36 @@
# License: BSD (3-clause)

# Import common libraries
import pandas as pd
from itertools import compress
from collections import defaultdict
from copy import deepcopy
from itertools import compress
from pprint import pprint

# Import MNE processing
from mne.viz import plot_compare_evokeds
# Import Plotting Library
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns

# Import StatsModels
import statsmodels.formula.api as smf
from mne import Epochs, events_from_annotations, set_log_level
from mne.preprocessing.nirs import (
beer_lambert_law,
optical_density,
scalp_coupling_index,
temporal_derivative_distribution_repair,
)

# Import MNE-NIRS processing
from mne_nirs.channels import get_long_channels
from mne_nirs.channels import picks_pair_to_idx
from mne_nirs.datasets import fnirs_motor_group
from mne.preprocessing.nirs import beer_lambert_law, optical_density,\
temporal_derivative_distribution_repair, scalp_coupling_index
from mne_nirs.signal_enhancement import enhance_negative_correlation
# Import MNE processing
from mne.viz import plot_compare_evokeds

# Import MNE-BIDS processing
from mne_bids import BIDSPath, read_raw_bids

# Import StatsModels
import statsmodels.formula.api as smf

# Import Plotting Library
import matplotlib.pyplot as plt
import seaborn as sns
# Import MNE-NIRS processing
from mne_nirs.channels import get_long_channels, picks_pair_to_idx
from mne_nirs.datasets import fnirs_motor_group
from mne_nirs.signal_enhancement import enhance_negative_correlation

# Set general parameters
set_log_level("WARNING") # Don't show info, as it is repetitive for many subjects
Expand Down Expand Up @@ -215,7 +218,7 @@ def individual_analysis(bids_path):
picks=pick, axes=axes[idx], show=False,
colors=[color], legend=False, ylim=lims, ci=0.95,
show_sensors=idx == 2)
axes[idx].set_title('{}'.format(evoked))
axes[idx].set_title(f'{evoked}')
axes[0].legend(["Oxyhaemoglobin", "Deoxyhaemoglobin"])

# %%
Expand Down
Loading

0 comments on commit 51579f8

Please sign in to comment.