Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into egi_annots_from_stim
Browse files Browse the repository at this point in the history
* upstream/main: (252 commits)
  Disable the "Back to top" button in the documentation (mne-tools#12688)
  DOC: match_channel_orders works on Epochs and Evoked, too (mne-tools#12699)
  Scale points and labels in montage plot (mne-tools#12703)
  Add license header to mne.stats.erp (mne-tools#12712)
  Update license year to 2024 (mne-tools#12713)
  Add standardized measurement error (SME) (mne-tools#12707)
  ENH: Parallel example execution in doc build (mne-tools#12708)
  MAINT: Update PR template (mne-tools#12692)
  MAINT: Fix doc build (mne-tools#12706)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#12702)
  Improve documentation of ylim argument through Evoked plotting function (mne-tools#12697)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#12696)
  BUG: Fix bug with CSP rank="full" (mne-tools#12694)
  MRG: Add epochs metadata summary to HTML representation (mne-tools#12686)
  Correct `Epochs.apply_function` docstring (mne-tools#12691)
  FIX: Gracefully handle missing datetime in Eyelink File (mne-tools#12687)
  MAINT: Restore SciPy pre (mne-tools#12689)
  Enh single channel annotation (mne-tools#12669)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#12682)
  Bump autofix-ci/action from 1.2 to 1.3 in the actions group (mne-tools#12681)
  ...
  • Loading branch information
larsoner committed Jul 16, 2024
2 parents 4182539 + c9f9bd5 commit b2e21aa
Show file tree
Hide file tree
Showing 607 changed files with 17,916 additions and 11,349 deletions.
82 changes: 9 additions & 73 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 [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:
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 Down Expand Up @@ -454,6 +403,7 @@ jobs:
default: "false"
docker:
- image: cimg/base:current-22.04
resource_class: large
steps:
- restore_cache:
keys:
Expand All @@ -472,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 @@ -496,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 @@ -591,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
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
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
6 changes: 6 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
- github-actions
21 changes: 21 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: autofix.ci

on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize, labeled, unlabeled]

permissions:
contents: read

jobs:
autofix:
name: Autoupdate changelog entry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install --upgrade towncrier pygithub
- run: python ./.github/actions/rename_towncrier/rename_towncrier.py
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
16 changes: 16 additions & 0 deletions .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Changelog

on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize, labeled, unlabeled]
branches: ["main"]

jobs:
changelog_checker:
name: Check towncrier entry in doc/changes/devel/
runs-on: ubuntu-latest
steps:
- uses: scientific-python/action-towncrier-changelog@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BOT_USERNAME: changelog-bot
2 changes: 1 addition & 1 deletion .github/workflows/circle_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
uses: larsoner/circleci-artifacts-redirector-action@master
uses: scientific-python/circleci-artifacts-redirector-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
api-token: ${{ secrets.CIRCLECI_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -56,7 +56,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -69,4 +69,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ on: # yamllint disable-line rule:truthy
release:
types: [published]
push:
branches:
- main
branches: ["main", "maint/*"]
pull_request:
branches:
- main
branches: ["main", "maint/*"]

permissions:
contents: read
Expand All @@ -28,7 +26,7 @@ jobs:
pip install build twine
- run: python -m build --sdist --wheel
- run: twine check --strict dist/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
Expand All @@ -43,7 +41,7 @@ jobs:
name: pypi
url: https://pypi.org/p/mne
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand Down
Loading

0 comments on commit b2e21aa

Please sign in to comment.