Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Test on macOS arm64 #187

Merged
merged 3 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .flake8

This file was deleted.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
47 changes: 0 additions & 47 deletions .github/workflows/code-style.yaml

This file was deleted.

11 changes: 7 additions & 4 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ jobs:
python-version: "3.9"
mne-version: mne-main
- os: ubuntu-latest
python-version: "3.11"
python-version: "3.12"
mne-version: mne-main
- os: macos-latest
python-version: "3.11"
- os: macos-13 # Intel
python-version: "3.12"
mne-version: mne-main
- os: macos-14 # arm64
python-version: "3.12"
mne-version: mne-main
- os: windows-latest
python-version: "3.11"
python-version: "3.12"
mne-version: mne-main
env:
TZ: Europe/Berlin
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
args: [--quiet]

# Ruff mne_connectivity
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.4.4
hooks:
- id: ruff
name: ruff mne_connectivity
name: ruff lint mne_connectivity
args: ["--fix"]
files: ^mne_connectivity/

Expand All @@ -19,7 +13,7 @@ repos:
rev: v0.1.6
hooks:
- id: ruff
name: ruff tutorials and examples
name: ruff lint tutorials and examples
# D103: missing docstring in public function
# D400: docstring first line must end with period
args: ["--ignore=D103,D400", "--fix"]
Expand Down Expand Up @@ -51,5 +45,11 @@ repos:
- tomli
files: ^doc/.*\.(rst|inc)$

# toml-sort
- repo: https://github.com/pappasam/toml-sort.git
rev: v0.23.1
hooks:
- id: toml-sort-fix

ci:
autofix_prs: false
29 changes: 1 addition & 28 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,7 @@ upload-pipy:
python setup.py sdist bdist_egg register upload

flake:
@if command -v flake8 > /dev/null; then \
echo "Running flake8"; \
flake8 --count mne_connectivity examples; \
else \
echo "flake8 not found, please install it!"; \
exit 1; \
fi;
@echo "flake8 passed"

black:
@if command -v black > /dev/null; then \
echo "Running black"; \
black mne_connectivity examples; \
else \
echo "black not found, please install it!"; \
exit 1; \
fi;
@echo "black passed"
ruff check .

isort:
@if command -v isort > /dev/null; then \
Expand Down Expand Up @@ -140,13 +123,3 @@ build-doc:
make -C doc/ clean
make -C doc/ html-noplot
cd doc/ && make view

run-checks:
isort --check .
black --check mne_connectivity examples
flake8 .
@$(MAKE) pydocstyle
@$(MAKE) codespell-error
ruff .
toml-sort ./pyproject.toml --check
yamllint . -c .yamllint.yml --strict
12 changes: 6 additions & 6 deletions examples/compare_coherency_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ def plot_connectivity_circle():
)
axis.set_xlabel("Frequency (Hz)")
axis.set_ylabel("Connectivity (A.U.)")
axis.annotate("$\pm$45°\ninteraction", xy=(12.5, 0.9))
axis.annotate("$\pm$90°\ninteraction", xy=(26.5, 0.9))
axis.annotate("$\\pm$45°\ninteraction", xy=(12.5, 0.9))
axis.annotate("$\\pm$90°\ninteraction", xy=(26.5, 0.9))
axis.legend(loc="upper left")
fig.suptitle("CaCoh vs. MIC\n$\pm$45° & $\pm$90° interactions")
fig.suptitle("CaCoh vs. MIC\n$\\pm$45° & $\\pm$90° interactions")

###############################################################################
# In situations where non-physiological zero time-lag interactions are present,
Expand Down Expand Up @@ -455,10 +455,10 @@ def plot_connectivity_circle():
axis.plot(imcoh.freqs, imcoh_mean_subbed, linewidth=2, label="ImCoh", linestyle="--")
axis.set_xlabel("Frequency (Hz)")
axis.set_ylabel("Mean-corrected connectivity (A.U.)")
axis.annotate("$\pm$45°\ninteraction", xy=(13, 0.25))
axis.annotate("$\pm$90°\ninteraction", xy=(26.5, 0.25))
axis.annotate("$\\pm$45°\ninteraction", xy=(13, 0.25))
axis.annotate("$\\pm$90°\ninteraction", xy=(26.5, 0.25))
axis.legend(loc="upper left")
fig.suptitle("Coh vs. ImCoh\n$\pm$45° & $\pm$90° interactions")
fig.suptitle("Coh vs. ImCoh\n$\\pm$45° & $\\pm$90° interactions")

###############################################################################
# Bivariate vs. multivariate coherency methods
Expand Down
4 changes: 2 additions & 2 deletions examples/compare_connectivity_over_time_over_trial.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@
#
# License: BSD (3-clause)

import numpy as np
import matplotlib.pyplot as plt
import mne
import numpy as np
from mne.datasets import sample

from mne_connectivity import spectral_connectivity_epochs, spectral_connectivity_time
from mne_connectivity.viz import plot_sensors_connectivity
from mne.datasets import sample

rng = np.random.default_rng(1234) # set seed for reproducibility

Expand Down
5 changes: 3 additions & 2 deletions examples/connectivity_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
# License: BSD (3-clause)

import os.path as op
import numpy as np

import mne
from mne_connectivity import spectral_connectivity_epochs
import numpy as np
from mne.datasets import sample

from mne_connectivity import spectral_connectivity_epochs

# %%
# Set parameters
data_path = sample.data_path()
Expand Down
5 changes: 3 additions & 2 deletions examples/cwt_sensor_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
# License: BSD (3-clause)

import os.path as op
import numpy as np

import mne
import numpy as np
from mne import io
from mne_connectivity import spectral_connectivity_epochs, seed_target_indices
from mne.datasets import sample
from mne.time_frequency import AverageTFR

from mne_connectivity import seed_target_indices, spectral_connectivity_epochs

print(__doc__)

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions examples/dpli_wpli_pli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
# License: BSD (3-clause)


import matplotlib.pyplot as plt
import mne
import numpy as np
import matplotlib.pyplot as plt
from mne.datasets import sample

from mne_connectivity import spectral_connectivity_epochs
from mne.datasets import sample

###############################################################################
# Background
Expand Down
6 changes: 2 additions & 4 deletions examples/dynamic/mne_var_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
# Authors: Adam Li <[email protected]>
#
# License: BSD (3-clause)
import numpy as np

import matplotlib.pyplot as plt
import mne
import numpy as np
from mne import make_fixed_length_epochs
from mne_bids import BIDSPath, read_raw_bids

import matplotlib.pyplot as plt

from mne_connectivity import vector_auto_regression

# %%
Expand Down
4 changes: 2 additions & 2 deletions examples/granger_causality.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

# %%

import mne
import numpy as np
from matplotlib import pyplot as plt

import mne
from mne.datasets.fieldtrip_cmc import data_path

from mne_connectivity import spectral_connectivity_epochs

###############################################################################
Expand Down
6 changes: 3 additions & 3 deletions examples/mic_mim.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

# %%

import mne
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import patheffects as pe

import mne
from matplotlib import pyplot as plt
from mne import EvokedArray, make_fixed_length_epochs
from mne.datasets.fieldtrip_cmc import data_path

from mne_connectivity import seed_target_indices, spectral_connectivity_epochs

###############################################################################
Expand Down
10 changes: 5 additions & 5 deletions examples/mixed_source_space_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
# License: BSD (3-clause)

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

import matplotlib.pyplot as plt
import mne
import numpy as np
from mne import make_forward_solution, setup_source_space, setup_volume_source_space
from mne.datasets import sample
from mne import setup_volume_source_space, setup_source_space
from mne import make_forward_solution
from mne.io import read_raw_fif
from mne.minimum_norm import make_inverse_operator, apply_inverse_epochs
from mne.minimum_norm import apply_inverse_epochs, make_inverse_operator
from mne.viz import circular_layout

from mne_connectivity import spectral_connectivity_epochs
from mne_connectivity.viz import plot_connectivity_circle

Expand Down
4 changes: 2 additions & 2 deletions examples/mne_inverse_coherence_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#
# License: BSD (3-clause)

import numpy as np

import mne
import numpy as np
from mne.datasets import sample
from mne.minimum_norm import apply_inverse, apply_inverse_epochs, read_inverse_operator

from mne_connectivity import seed_target_indices, spectral_connectivity_epochs

print(__doc__)
Expand Down
2 changes: 1 addition & 1 deletion examples/mne_inverse_connectivity_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# License: BSD (3-clause)

import matplotlib.pyplot as plt

import mne
from mne.datasets import sample
from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator

from mne_connectivity import spectral_connectivity_epochs

print(__doc__)
Expand Down
8 changes: 4 additions & 4 deletions examples/mne_inverse_envelope_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@

import os.path as op

import numpy as np
import matplotlib.pyplot as plt

import mne
import numpy as np
from mne.minimum_norm import apply_inverse_epochs, make_inverse_operator
from mne.preprocessing import compute_proj_ecg, compute_proj_eog

import mne_connectivity
from mne_connectivity import envelope_correlation
from mne.minimum_norm import make_inverse_operator, apply_inverse_epochs
from mne.preprocessing import compute_proj_ecg, compute_proj_eog

data_path = mne.datasets.brainstorm.bst_resting.data_path()
subjects_dir = op.join(data_path, "subjects")
Expand Down
Loading
Loading