Skip to content

Commit

Permalink
Merge branch 'main' into layout
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored May 29, 2024
2 parents aadcf70 + 9a222ba commit a02305a
Show file tree
Hide file tree
Showing 575 changed files with 15,966 additions and 10,813 deletions.
71 changes: 3 additions & 68 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,58 +22,6 @@ _check_skip: &check_skip
fi
jobs:
pytest-macos-arm64:
parameters:
scheduled:
type: string
default: "false"
macos:
xcode: "14.2.0"
resource_class: macos.m1.medium.gen1
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
steps:
- checkout
- run:
<<: *check_skip
- run:
name: Install Python and dependencies
command: |
set -eo pipefail
brew install [email protected]
which python
which pip
pip install --upgrade pip
pip install --upgrade --only-binary "numpy,scipy,dipy,statsmodels" -ve .[full,test_extra]
# 3D too slow on Apple's software renderer, and numba causes us problems
pip uninstall -y vtk pyvista pyvistaqt numba
mkdir -p test-results
echo "set -eo pipefail" >> $BASH_ENV
- run:
command: mne sys_info
- run:
command: ./tools/get_testing_version.sh && cat testing_version.txt
- restore_cache:
keys:
- data-cache-testing-{{ checksum "testing_version.txt" }}
- run:
command: python -c "import mne; mne.datasets.testing.data_path(verbose=True)"
- save_cache:
key: data-cache-testing-{{ checksum "testing_version.txt" }}
paths:
- ~/mne_data/MNE-testing-data # (2.5 G)
- run:
command: pytest -m "not slowtest" --tb=short --cov=mne --cov-report xml -vv mne
- run:
name: Prepare test data upload
command: cp -av junit-results.xml test-results/junit.xml
- store_test_results:
path: ./test-results
# Codecov orb has bugs on macOS (gpg issues)
# - codecov/upload
- run:
command: bash <(curl -s https://codecov.io/bash)

build_docs:
parameters:
scheduled:
Expand Down Expand Up @@ -454,6 +402,7 @@ jobs:
default: "false"
docker:
- image: cimg/base:current-22.04
resource_class: large
steps:
- restore_cache:
keys:
Expand Down Expand Up @@ -496,8 +445,8 @@ jobs:


deploy:
machine:
image: ubuntu-2004:202111-01
docker:
- image: cimg/base:current-22.04
steps:
- attach_workspace:
at: /tmp/build
Expand Down Expand Up @@ -591,20 +540,6 @@ workflows:
only:
- main

weekly:
jobs:
- pytest-macos-arm64:
name: pytest_macos_arm64_weekly
scheduled: "true"
triggers:
- schedule:
# "At 6:00 AM GMT every Monday"
cron: "0 6 * * 1"
filters:
branches:
only:
- main

monthly:
jobs:
- linkcheck:
Expand Down
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ e81ec528a42ac687f3d961ed5cf8e25f236925b0 # black
12395f9d9cf6ea3c72b225b62e052dd0d17d9889 # YAML indentation
d6d2f8c6a2ed4a0b27357da9ddf8e0cd14931b59 # isort
e7dd1588013179013a50d3f6b8e8f9ae0a185783 # ruff format
e39995d9be6fc831c7a4a59f09b7a7c0a41ae315 # percent formatting
940ac9553ce42c15b4c16ecd013824ca3ea7244a # whitespace
1c5b39ff1d99bbcb2fc0e0071a989b3f3845ff30 # ruff UP028
1 change: 0 additions & 1 deletion .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ This project and everyone participating in it is governed by the [MNE-Python's C

## How to contribute

Before contributing make sure you are familiar with [our contributing guide](https://mne.tools/dev/install/contributing.html).
Before contributing make sure you are familiar with [our contributing guide](https://mne.tools/dev/development/contributing.html).
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ body:
Paste here a code snippet or minimal working example
([MWE](https://en.wikipedia.org/wiki/Minimal_Working_Example))
to replicate your problem, using one of the
[datasets shipped with MNE-Python](https://mne.tools/dev/overview/datasets_index.html),
preferably the one called [sample](https://mne.tools/dev/overview/datasets_index.html#sample).
[datasets shipped with MNE-Python](https://mne.tools/stable/documentation/datasets.html#datasets),
preferably the one called [sample](https://mne.tools/stable/documentation/datasets.html#sample).
render: Python
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Thanks for contributing a pull request! Please make sure you have read the
[contribution guidelines](https://mne.tools/dev/install/contributing.html)
[contribution guidelines](https://mne.tools/dev/development/contributing.html)
before submitting.

Please be aware that we are a loose team of volunteers so patience is
Expand Down
20 changes: 9 additions & 11 deletions .github/actions/rename_towncrier/rename_towncrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
from github import Github
from tomllib import loads

event_name = os.getenv('GITHUB_EVENT_NAME', 'pull_request')
if not event_name.startswith('pull_request'):
print(f'No-op for {event_name}')
event_name = os.getenv("GITHUB_EVENT_NAME", "pull_request")
if not event_name.startswith("pull_request"):
print(f"No-op for {event_name}")
sys.exit(0)
if 'GITHUB_EVENT_PATH' in os.environ:
with open(os.environ['GITHUB_EVENT_PATH'], encoding='utf-8') as fin:
if "GITHUB_EVENT_PATH" in os.environ:
with open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8") as fin:
event = json.load(fin)
pr_num = event['number']
basereponame = event['pull_request']['base']['repo']['full_name']
pr_num = event["number"]
basereponame = event["pull_request"]["base"]["repo"]["full_name"]
real = True
else: # local testing
pr_num = 12318 # added some towncrier files
basereponame = "mne-tools/mne-python"
real = False

g = Github(os.environ.get('GITHUB_TOKEN'))
g = Github(os.environ.get("GITHUB_TOKEN"))
baserepo = g.get_repo(basereponame)

# Grab config from upstream's default branch
Expand All @@ -45,9 +45,7 @@
assert directory.endswith("/"), directory

file_re = re.compile(rf"^{directory}({type_pipe})\.rst$")
found_stubs = [
f for f in modified_files if file_re.match(f)
]
found_stubs = [f for f in modified_files if file_re.match(f)]
for stub in found_stubs:
fro = stub
to = file_re.sub(rf"{directory}{pr_num}.\1.rst", fro)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
python-version: '3.12'
- run: pip install --upgrade towncrier pygithub
- run: python ./.github/actions/rename_towncrier/rename_towncrier.py
- uses: autofix-ci/action@ea32e3a12414e6d3183163c3424a7d7a8631ad84
- uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc
45 changes: 30 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ concurrency:
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
push:
branches:
- '*'
branches: ["main", "maint/*"]
pull_request:
branches:
- '*'
branches: ["main", "maint/*"]

permissions:
contents: read
Expand All @@ -22,15 +20,18 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: pre-commit/[email protected]
python-version: '3.12'
- uses: pre-commit/[email protected]
- run: pip install mypy numpy scipy vulture
- run: mypy
- run: vulture

bandit:
name: Bandit
needs: style
runs-on: ubuntu-latest
steps:
- uses: davidslusser/[email protected].0
- uses: davidslusser/[email protected].1
with:
src: "mne"
options: "-c pyproject.toml -ll -r"
Expand All @@ -56,13 +57,16 @@ jobs:
matrix:
include:
- os: ubuntu-latest
python: '3.10'
kind: conda
- os: ubuntu-latest
python: '3.11'
python: '3.12'
kind: pip-pre
- os: macos-latest
python: '3.9'
- os: ubuntu-latest
python: '3.12'
kind: conda
- os: macos-14 # arm64
python: '3.12'
kind: mamba
- os: macos-latest # intel
python: '3.12'
kind: mamba
- os: windows-latest
python: '3.10'
Expand All @@ -89,6 +93,12 @@ jobs:
python-version: ${{ matrix.python }}
if: startswith(matrix.kind, 'pip')
# Python (if conda)
- name: Remove numba and dipy
run: | # TODO: Remove when numba 0.59 and dipy 1.8 land on conda-forge
sed -i '/numba/d' environment.yml
sed -i '/dipy/d' environment.yml
sed -i 's/- mne$/- mne-base/' environment.yml
if: matrix.os == 'ubuntu-latest' && startswith(matrix.kind, 'conda') && matrix.python == '3.12'
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.CONDA_ENV }}
Expand All @@ -98,6 +108,9 @@ jobs:
mamba
fmt!=10.2.0
if: ${{ !startswith(matrix.kind, 'pip') }}
# Make sure we have the right Python
- run: python -c "import platform; assert platform.machine() == 'arm64', platform.machine()"
if: matrix.os == 'macos-14'
- run: ./tools/github_actions_dependencies.sh
# Minimal commands on Linux (macOS stalls)
- run: ./tools/get_minimal_commands.sh
Expand All @@ -110,11 +123,13 @@ jobs:
run: MNE_SKIP_TESTING_DATASET_TESTS=true pytest -m "not (ultraslowtest or pgtest)" --tb=short --cov=mne --cov-report xml -vv -rfE mne/
if: matrix.kind == 'minimal'
- run: ./tools/get_testing_version.sh
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
- run: ./tools/github_actions_download.sh
- run: ./tools/github_actions_test.sh
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: success()
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ Giorgio Marinato <[email protected]> neurogima <76406896+neurogima@users
Guillaume Dumas <[email protected]> deep-introspection <[email protected]>
Guillaume Dumas <[email protected]> Guillaume Dumas <[email protected]>
Hamid Maymandi <[email protected]> Hamid <[email protected]>
Hasrat Ali Arzoo <[email protected]> hasrat17 <[email protected]>
Hongjiang Ye <[email protected]> YE Hongjiang <[email protected]>
Hubert Banville <[email protected]> hubertjb <[email protected]>
Hüseyin Orkun Elmas <[email protected]> Hüseyin <[email protected]>
Hyonyoung Shin <[email protected]> mcvain <[email protected]>
Ingoo Lee <[email protected]> dlsrnsi <[email protected]>
Ivo de Jong <[email protected]> ivopascal <[email protected]>
Jaakko Leppakangas <[email protected]> Jaakko Leppakangas <[email protected]>
Jaakko Leppakangas <[email protected]> jaeilepp <[email protected]>
Jaakko Leppakangas <[email protected]> jaeilepp <[email protected]>
Expand Down Expand Up @@ -220,6 +222,7 @@ Mikołaj Magnuski <[email protected]> Mikolaj Magnuski <[email protected]
Mikołaj Magnuski <[email protected]> mmagnuski <[email protected]>
Mohamed Sherif <[email protected]> mohdsherif <[email protected]>
Mohammad Daneshzand <[email protected]> mdaneshzand <[email protected]>
Motofumi Fushimi <[email protected]> motofumi-fushimi <[email protected]>
Natalie Klein <[email protected]> natalieklein <[email protected]>
Nathalie Gayraud <[email protected]> Nathalie <[email protected]>
Nathalie Gayraud <[email protected]> Nathalie <[email protected]>
Expand Down
42 changes: 20 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
repos:
# Ruff mne
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.4.5
hooks:
- id: ruff
name: ruff lint mne
args: ["--fix"]
files: ^mne/
- id: ruff-format
name: ruff format mne
- id: ruff
name: ruff lint mne preview
args: ["--fix", "--preview", "--select=NPY201"]
files: ^mne/

# Ruff tutorials and examples
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
name: ruff lint tutorials and examples
name: ruff lint doc, tutorials, and examples
# D103: missing docstring in public function
# D400: docstring first line must end with period
args: ["--ignore=D103,D400", "--fix"]
files: ^tutorials/|^examples/
files: ^doc/|^tutorials/|^examples/
- id: ruff-format
name: ruff format tutorials and examples
files: ^tutorials/|^examples/
files: ^mne/|^doc/|^tutorials/|^examples/

# Codespell
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -37,7 +32,7 @@ repos:

# yamllint
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict, -c, .yamllint.yml]
Expand All @@ -51,11 +46,14 @@ repos:
- tomli
files: ^doc/.*\.(rst|inc)$

# mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
# Avoid the conflict between mne/__init__.py and mne/__init__.pyi by ignoring the former
exclude: ^mne/(beamformer|channels|commands|datasets|decoding|export|forward|gui|html_templates|inverse_sparse|io|minimum_norm|preprocessing|report|simulation|source_space|stats|time_frequency|utils|viz)?/?__init__\.py$
additional_dependencies: ["numpy==1.26.2"]
# The following are too slow to run on local commits, so let's only run on CIs:
#
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.9.0
# hooks:
# - id: mypy
#
# - repo: https://github.com/jendrikseipp/vulture
# rev: 'v2.11' # or any later Vulture version
# hooks:
# - id: vulture
Loading

0 comments on commit a02305a

Please sign in to comment.