Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into stats
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Jul 29, 2024
2 parents c5eee5d + e06921d commit 01d94c7
Show file tree
Hide file tree
Showing 1,096 changed files with 33,797 additions and 23,941 deletions.
116 changes: 36 additions & 80 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,65 +22,13 @@ _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 python@3.11
which python
which pip
pip install --upgrade pip setuptools wheel
pip install --upgrade --only-binary "numpy,scipy,dipy,statsmodels" -ve . -r requirements.txt -r requirements_testing.txt -r requirements_testing_extra.txt PyQt6
# 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:
type: string
default: "false"
docker:
- image: cimg/base:current-22.04
machine:
image: ubuntu-2404:current
# large 4 vCPUs 15GB mem
# https://discuss.circleci.com/t/changes-to-remote-docker-reporting-pricing/47759
resource_class: large
Expand Down Expand Up @@ -163,7 +111,7 @@ jobs:
# Load pip cache
- restore_cache:
keys:
- pip-cache
- pip-cache-0
- restore_cache:
keys:
- user-install-bin-cache-310
Expand All @@ -175,7 +123,7 @@ jobs:
./tools/circleci_dependencies.sh
- save_cache:
key: pip-cache
key: pip-cache-0
paths:
- ~/.cache/pip
- save_cache:
Expand All @@ -200,6 +148,7 @@ jobs:
which python
QT_DEBUG_PLUGINS=1 mne sys_info -pd
python -c "import numpy; numpy.show_config()"
python -c "import dipy.align.metrics"
LIBGL_DEBUG=verbose python -c "import pyvistaqt; pyvistaqt.BackgroundPlotter(show=True)"
python -c "import mne; mne.set_config('MNE_USE_CUDA', 'false')" # this is needed for the config tutorial
python -c "import mne; mne.set_config('MNE_LOGGING_LEVEL', 'info')"
Expand All @@ -223,13 +172,16 @@ jobs:
- data-cache-fsaverage
- restore_cache:
keys:
- data-cache-bst-phantom-ctf
- data-cache-bst-raw
- restore_cache:
keys:
- data-cache-bst-raw
- data-cache-bst-phantom-ctf
- restore_cache:
keys:
- data-cache-bst-phantom-elekta
- restore_cache:
keys:
- data-cache-bst-phantom-kernel
- restore_cache:
keys:
- data-cache-bst-auditory
Expand Down Expand Up @@ -263,6 +215,9 @@ jobs:
- restore_cache:
keys:
- data-cache-ucl-opm-auditory
- restore_cache:
keys:
- data-cache-phantom-kit
- run:
name: Get data
# This limit could be increased, but this is helpful for finding slow ones
Expand Down Expand Up @@ -290,8 +245,14 @@ jobs:
# Build docs
- run:
name: make html
command: | # we have -o pipefail in #BASH_ENV so we should be okay
set -x
PATTERN=$(cat pattern.txt) make -C doc $(cat build.txt) 2>&1 | tee sphinx_log.txt
- run:
name: Check sphinx log for warnings (which are treated as errors)
when: always
command: |
PATTERN=$(cat pattern.txt) make -C doc $(cat build.txt);
! grep "^.* WARNING: .*$" sphinx_log.txt
- run:
name: Show profiling output
when: always
Expand Down Expand Up @@ -368,18 +329,22 @@ jobs:
key: data-cache-fsaverage
paths:
- ~/mne_data/MNE-fsaverage-data # (762 M)
- save_cache:
key: data-cache-bst-phantom-ctf
paths:
- ~/mne_data/MNE-brainstorm-data/bst_phantom_ctf # (177 M)
- save_cache:
key: data-cache-bst-raw
paths:
- ~/mne_data/MNE-brainstorm-data/bst_raw # (830 M)
- save_cache:
key: data-cache-bst-phantom-ctf
paths:
- ~/mne_data/MNE-brainstorm-data/bst_phantom_ctf # (177 M)
- save_cache:
key: data-cache-bst-phantom-elekta
paths:
- ~/mne_data/MNE-brainstorm-data/bst_phantom_elekta # (1.4 G)
- save_cache:
key: data-cache-bst-phantom-kernel
paths:
- ~/mne_data/MNE-phantom-kernel-data # (362 M)
- save_cache:
key: data-cache-bst-auditory
paths:
Expand Down Expand Up @@ -424,6 +389,10 @@ jobs:
key: data-cache-ucl-opm-auditory
paths:
- ~/mne_data/auditory_OPM_stationary # (4 G)
- save_cache:
key: data-cache-phantom-kit
paths:
- ~/mne_data/MNE-phantom-KIT-data # (1 G)


linkcheck:
Expand All @@ -434,6 +403,7 @@ jobs:
default: "false"
docker:
- image: cimg/base:current-22.04
resource_class: large
steps:
- restore_cache:
keys:
Expand All @@ -452,7 +422,7 @@ jobs:
command: ./tools/circleci_bash_env.sh
- restore_cache:
keys:
- pip-cache
- pip-cache-0
- run:
name: Get Python running
command: |
Expand All @@ -476,8 +446,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 @@ -571,20 +541,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
6 changes: 5 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
e81ec528a42ac687f3d961ed5cf8e25f236925b0 # black
12395f9d9cf6ea3c72b225b62e052dd0d17d9889 # YAML indentation
2261e7652bc3fb0659a8c197d219c1b8141b9436 # codespell
d6d2f8c6a2ed4a0b27357da9ddf8e0cd14931b59 # isort
e7dd1588013179013a50d3f6b8e8f9ae0a185783 # ruff format
e39995d9be6fc831c7a4a59f09b7a7c0a41ae315 # percent formatting
940ac9553ce42c15b4c16ecd013824ca3ea7244a # whitespace
1c5b39ff1d99bbcb2fc0e0071a989b3f3845ff30 # ruff UP028
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
12 changes: 9 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*lcmv*.py @britta-wstnr

# Channels
/mne/channels @agramfort @mscheltienne @dengemann
/mne/channels @agramfort @mscheltienne @dengemann @jasmainak

# Core sensor-space classes
/mne/epochs.py @drammock @agramfort @mscheltienne @dengemann
Expand All @@ -45,13 +45,14 @@

# Decoding
/mne/decoding/csp.py @cbrnr @agramfort @dengemann
/mne/decoding/*.py @jasmainak

# fNIRS
/mne/preprocessing/nirs @rob-luke
*fnirs*.py @rob-luke

# forward
/mne/forward/ @agramfort
/mne/forward/ @agramfort @jasmainak
*forward*.py @agramfort

# Intracranial
Expand All @@ -69,6 +70,8 @@
/mne/io/nirx @rob-luke
/mne/io/snirf @rob-luke
/mne/export @sappelhoff @cbrnr
/mne/io/eeglab.py @jasmainak
/mne/io/eeglab/tests/test_eeglab.py @jasmainak

# Minimum Norm
/mne/minimum_norm @agramfort
Expand All @@ -81,7 +84,7 @@
/mne/preprocessing/e*g.py @mscheltienne

# Report
/mne/report @hoechenberger @dengemann
/mne/report @hoechenberger @dengemann @jasmainak

# Simulation
/mne/simulation/ @agramfort
Expand All @@ -102,6 +105,9 @@
/tutorials/visualization @larsoner @wmvanvliet @dengemann
/examples/visualization @larsoner @dengemann

# Datasets
/mne/datasets/brainstorm @jasmainak

#########################
# Project-level / other #
#########################
Expand Down
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
6 changes: 5 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!--
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 All @@ -11,6 +13,8 @@ case, we ask for your understanding during the review process.
Again, thanks for contributing!
-->

#### Reference issue
Example: Fixes #1234.

Expand Down
54 changes: 54 additions & 0 deletions .github/actions/rename_towncrier/rename_towncrier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env python3

# Adapted from action-towncrier-changelog
import json
import os
import re
import subprocess
import sys
from pathlib import Path

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}")
sys.exit(0)
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"]
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"))
baserepo = g.get_repo(basereponame)

# Grab config from upstream's default branch
toml_cfg = loads(Path("pyproject.toml").read_text("utf-8"))

config = toml_cfg["tool"]["towncrier"]
pr = baserepo.get_pull(pr_num)
modified_files = [f.filename for f in pr.get_files()]

# Get types from config
types = [ent["directory"] for ent in toml_cfg["tool"]["towncrier"]["type"]]
type_pipe = "|".join(types)

# Get files that potentially match the types
directory = toml_cfg["tool"]["towncrier"]["directory"]
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)]
for stub in found_stubs:
fro = stub
to = file_re.sub(rf"{directory}{pr_num}.\1.rst", fro)
print(f"Renaming {fro} to {to}")
if real:
subprocess.check_call(["mv", fro, to])
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ updates:
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
labels:
- no-changelog-entry-needed
Loading

0 comments on commit 01d94c7

Please sign in to comment.