From 97571daab3b4e8a083d28a7214cb194f42710137 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Fri, 12 Dec 2025 20:02:00 +0000 Subject: [PATCH 01/45] [MAINT] Post-1.3.0 release update (#183) --- README.md | 6 +++--- docs/source/conf.py | 2 +- pyproject.toml | 2 +- src/pybispectra/__init__.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 104534d..cc8f41e 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Analysis of phase-amplitude coupling, time delays, and non-sinusoidal waveshape ## Installation & Requirements: Install the package into the desired environment using pip: `pip install pybispectra`
or conda: `conda install -c conda-forge pybispectra`
-More information on the [installation](https://pybispectra.readthedocs.io/1.3/installation.html) page. +More information on the [installation](https://pybispectra.readthedocs.io/latest/installation.html) page. ## Use: -To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/1.3/) and [examples](https://pybispectra.readthedocs.io/1.3/examples.html). +To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/latest/) and [examples](https://pybispectra.readthedocs.io/latest/examples.html). For instance, given some epoched time series, `data`, phase-amplitude coupling can be computed as: @@ -29,7 +29,7 @@ pac_results.plot() # plot results ``` ## Contributing & Development: -If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/1.3/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. +If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/latest/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. ## Citing: If you use this toolbox in your work, please include the following citation:
diff --git a/docs/source/conf.py b/docs/source/conf.py index 6d28dc0..20f00ec 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,7 @@ project = "PyBispectra" copyright = "2023-2025, Thomas S. Binns" author = "Thomas S. Binns" -release = "1.3.0" +release = "1.3.1dev" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index 3361588..ae28be2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dynamic = [ ] # check tools/hatch_build.py for details name = "pybispectra" readme = "README.md" -version = "1.3.0" +version = "1.3.1dev" [project.optional-dependencies] dev = ["pybispectra[doc]", "pybispectra[lint]", "pybispectra[test]"] diff --git a/src/pybispectra/__init__.py b/src/pybispectra/__init__.py index b05bf70..d460dc3 100644 --- a/src/pybispectra/__init__.py +++ b/src/pybispectra/__init__.py @@ -1,6 +1,6 @@ """Initialisation of the PyBispectra package.""" -__version__ = "1.3.0" +__version__ = "1.3.1+dev" from .cfc import AAC, PAC, PPC from .general import Bispectrum, Threenorm From de74b7adb607e70efa6a448943818c18f5bba81f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 08:37:22 +0000 Subject: [PATCH 02/45] [pre-commit.ci] pre-commit autoupdate (#184) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9a21d0..6000394 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.8 + rev: v0.14.9 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.8 + rev: v0.14.9 hooks: - id: ruff name: ruff lint examples From 7c71a23bc4c8f1f13fa6554eb74362d6d5f864a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 08:37:53 +0000 Subject: [PATCH 03/45] Bump actions/upload-artifact from 5 to 6 (#185) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd69cb9..8c1796c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: - name: Check env vars run: | echo "Triggered by: ${{ github.event_name }}" - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v6 with: name: dist path: dist From a0b72eff25e7a9ddb9b3e1a9424456c752e6a77a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 08:38:22 +0000 Subject: [PATCH 04/45] Bump actions/download-artifact from 6 to 7 (#186) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c1796c..e553c5a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: permissions: id-token: write steps: - - uses: actions/download-artifact@v6 + - uses: actions/download-artifact@v7 with: name: dist path: dist From 02d710b116013996cf195441cfc8fb8e4502daf4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 09:44:23 +0000 Subject: [PATCH 05/45] [pre-commit.ci] pre-commit autoupdate (#187) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6000394..34a0828 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.9 + rev: v0.14.10 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.9 + rev: v0.14.10 hooks: - id: ruff name: ruff lint examples From cd228cbb096feb129c185ba4dc2c995db3217d81 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 11:25:25 +0000 Subject: [PATCH 06/45] [pre-commit.ci] pre-commit autoupdate (#188) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34a0828..420d593 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.10 + rev: v0.14.11 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.10 + rev: v0.14.11 hooks: - id: ruff name: ruff lint examples From 74d6623d5501a86220b4ce59087de5535b229f99 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Mon, 19 Jan 2026 17:56:16 +0000 Subject: [PATCH 07/45] [MAINT] Update copyright (#190) --- LICENSE.txt | 2 +- docs/source/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index a7d06ae..364d808 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023-2025 Thomas Samuel Binns +Copyright (c) 2023-2026 Thomas Samuel Binns Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/source/conf.py b/docs/source/conf.py index 20f00ec..ed44c45 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,7 @@ from pybispectra.utils._docs import linkcode_resolve project = "PyBispectra" -copyright = "2023-2025, Thomas S. Binns" +copyright = "2023-2026, Thomas S. Binns" author = "Thomas S. Binns" release = "1.3.1dev" From 8347a103ec3ce8ddc5cf210f6dceed96f4bf311d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:30:36 +0000 Subject: [PATCH 08/45] [pre-commit.ci] pre-commit autoupdate (#191) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 420d593..ad3c03f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.11 + rev: v0.14.13 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.11 + rev: v0.14.13 hooks: - id: ruff name: ruff lint examples @@ -29,7 +29,7 @@ repos: # yamllint - repo: https://github.com/adrienverge/yamllint.git - rev: v1.37.1 + rev: v1.38.0 hooks: - id: yamllint args: [--strict, -c, .yamllint.yml] From 3b80d63c2e3b202380e15d60614f7718356a2a12 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 09:15:51 +0000 Subject: [PATCH 09/45] [pre-commit.ci] pre-commit autoupdate (#192) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad3c03f..03df439 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.13 + rev: v0.14.14 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.13 + rev: v0.14.14 hooks: - id: ruff name: ruff lint examples From d75bb3877f8f2fbf2d43cc4268e40a270f292c91 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 09:50:22 +0000 Subject: [PATCH 10/45] [pre-commit.ci] pre-commit autoupdate (#193) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 03df439..7fcc1a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.0 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.0 hooks: - id: ruff name: ruff lint examples From 07e765982309995b9cf6a4d04bfd70461b46a9ef Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 09:28:12 +0000 Subject: [PATCH 11/45] [pre-commit.ci] pre-commit autoupdate (#194) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7fcc1a6..5efe38b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.0 + rev: v0.15.1 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.0 + rev: v0.15.1 hooks: - id: ruff name: ruff lint examples From 9be3e5000eaf63f33508c713a666790994045d24 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:58:49 +0000 Subject: [PATCH 12/45] [pre-commit.ci] pre-commit autoupdate (#195) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5efe38b..f60c0ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.1 + rev: v0.15.2 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.1 + rev: v0.15.2 hooks: - id: ruff name: ruff lint examples From 227633e23daad67f28e6400122c850683f59a7b2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:02:25 +0000 Subject: [PATCH 13/45] [pre-commit.ci] pre-commit autoupdate (#196) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f60c0ae..2b27594 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.2 + rev: v0.15.4 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.2 + rev: v0.15.4 hooks: - id: ruff name: ruff lint examples From 4e6bfe13691450d8f71c3eac287d93d8dc24bc6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:12:51 +0000 Subject: [PATCH 14/45] Bump actions/upload-artifact from 6 to 7 (#198) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e553c5a..7e2b056 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: - name: Check env vars run: | echo "Triggered by: ${{ github.event_name }}" - - uses: actions/upload-artifact@v6 + - uses: actions/upload-artifact@v7 with: name: dist path: dist From deb62d20a1eb195ff1c9ddaf9bae1d747fdf74d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:13:01 +0000 Subject: [PATCH 15/45] Bump actions/download-artifact from 7 to 8 (#197) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e2b056..386f01d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: permissions: id-token: write steps: - - uses: actions/download-artifact@v7 + - uses: actions/download-artifact@v8 with: name: dist path: dist From 653e63528be0662e10055216d67a825d555d1cc2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 09:42:41 +0000 Subject: [PATCH 16/45] [pre-commit.ci] pre-commit autoupdate (#199) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b27594..e021673 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.4 + rev: v0.15.5 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.4 + rev: v0.15.5 hooks: - id: ruff name: ruff lint examples @@ -19,7 +19,7 @@ repos: # codespell - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 + rev: v2.4.2 hooks: - id: codespell additional_dependencies: From 58ca9b2ec9ddfa90cb416ea7df16bc08a7a10618 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Sun, 15 Mar 2026 15:52:56 +0100 Subject: [PATCH 17/45] [MAINT] Update installation info (#200) --- docs/Makefile | 8 +++++ docs/source/installation.rst | 62 ++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index d0c3cbf..06e1859 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -18,3 +18,11 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +clean: + rm -rf $(BUILDDIR)/* + rm -rf $(SOURCEDIR)/auto_examples/* + rm -rf $(SOURCEDIR)/generated/* + +view: + @python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/build/html/index.html')" diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 25998fa..49b25d2 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -1,37 +1,43 @@ Installation ============ -To install PyBispectra, activate the desired environment in which you want the package, -then install it using `pip `_: +PyBispectra is available on `PyPI `_, and +`conda-forge `_ +for version ≥ 1.2.2. + +PyBispectra requires Python ≥ 3.10. + +To install PyBispectra, activate the desired environment or project in which you want +the package, then install it using `pip `_: .. code-block:: pip install pybispectra -or `conda `_ from -`conda-forge `_ (for PyBispectra ≥ 1.2.2): +`uv `_: .. code-block:: - conda install -c conda-forge pybispectra - -PyBispectra requires Python ≥ 3.10. + uv pip install pybispectra -If you need to create an environment in which to install PyBispectra, you can do so -using `conda `_, -`venv `_, or -`uv `_. +`conda `_: -With ``conda`` --------------- +.. code-block:: + + conda install -c conda-forge pybispectra -In a shell with ``conda`` available, run the following commands: +or `pixi `_: .. code-block:: + + pixi add pybispectra - conda create -n pybispectra_env - conda activate pybispectra_env - conda install -c conda-forge pybispectra +| + +If you need to create an environment or project in which to install PyBispectra, you can +do so using `venv `_, +`uv `_, `pixi `_, or +`conda `_. With ``venv`` ------------- @@ -68,3 +74,25 @@ then install the package: .. code-block:: uv pip install pybispectra + +With ``pixi`` +------------- + +In a shell with ``pixi`` available, run the following commands: + +.. code-block:: + + pixi init + pixi shell-hook + pixi add pybispectra + +With ``conda`` +-------------- + +In a shell with ``conda`` available, run the following commands: + +.. code-block:: + + conda create -n pybispectra_env + conda activate pybispectra_env + conda install -c conda-forge pybispectra From 5c179380fba8ba0349e463d5d127a259494f568e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 20:17:39 +0000 Subject: [PATCH 18/45] [pre-commit.ci] pre-commit autoupdate (#202) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e021673..eee3a1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.5 + rev: v0.15.6 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.5 + rev: v0.15.6 hooks: - id: ruff name: ruff lint examples From b8d9b150fc76dbf611655f483667812c1bcc321c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 20:46:45 +0000 Subject: [PATCH 19/45] [pre-commit.ci] pre-commit autoupdate (#203) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eee3a1d..e02d912 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.6 + rev: v0.15.7 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.6 + rev: v0.15.7 hooks: - id: ruff name: ruff lint examples From bd2e5b60fd74e809a102a09cf2826a713afe88cc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 09:31:57 +0100 Subject: [PATCH 20/45] [pre-commit.ci] pre-commit autoupdate (#204) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e02d912..f7aef92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.7 + rev: v0.15.8 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.7 + rev: v0.15.8 hooks: - id: ruff name: ruff lint examples @@ -45,7 +45,7 @@ repos: # toml-sort - repo: https://github.com/pappasam/toml-sort.git - rev: v0.24.3 + rev: v0.24.4 hooks: - id: toml-sort-fix From f6fc6c06080a6183aa2c9e2203c19d4f0b9b042a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 09:32:19 +0100 Subject: [PATCH 21/45] Bump mamba-org/setup-micromamba from 2 to 3 (#205) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 77f0d1b..dad1222 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -79,7 +79,7 @@ jobs: with: qt: true pyvista: false - - uses: mamba-org/setup-micromamba@v2 + - uses: mamba-org/setup-micromamba@v3 with: environment-file: environment.yml create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces From bfb9d43da3daedc64cb83a3e7d6d5be29ed09a7b Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Sat, 4 Apr 2026 19:45:14 +0100 Subject: [PATCH 22/45] [MAINT] Bump conda support to Python 3.14 (#206) --- .github/workflows/unit_tests.yml | 2 +- changelog.md | 3 ++- environment.yml | 4 ++-- tools/hatch_build.py | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index dad1222..8a6d7e8 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -72,7 +72,7 @@ jobs: env: MKL_NUM_THREADS: '1' PYTHONUNBUFFERED: '1' - PYTHON_VERSION: '3.13' + PYTHON_VERSION: '3.14' steps: - uses: actions/checkout@v6 - uses: pyvista/setup-headless-display-action@main diff --git a/changelog.md b/changelog.md index 2f4ac73..3719146 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,8 @@ ## [Development Version](https://pybispectra.readthedocs.io/latest/) -No changes. +##### Dependencies +- Added support for Python 3.14 in the `conda` environment.
diff --git a/environment.yml b/environment.yml index cbb450d..ffc93b9 100644 --- a/environment.yml +++ b/environment.yml @@ -2,10 +2,10 @@ name: pybispectra channels: - conda-forge dependencies: - - python>=3.10,<3.14 + - python>=3.10,<3.15 - joblib>=1.2 - matplotlib>=3.6 - - mne>=1.7 + - mne-base>=1.7 - numba>=0.56 - numpy>=1.22 - scikit-learn>=1.1 diff --git a/tools/hatch_build.py b/tools/hatch_build.py index aac907a..a49c51e 100644 --- a/tools/hatch_build.py +++ b/tools/hatch_build.py @@ -16,6 +16,8 @@ def update(self, metadata): requires_python = ">=3.10" if is_macos_intel: requires_python += ", <3.14" + else: + requires_python += ", <3.15" metadata["requires-python"] = requires_python # dependencies From b50de05781a8310531b13d78803f254216c20599 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Mon, 6 Apr 2026 15:56:18 +0100 Subject: [PATCH 23/45] [MAINT] Document Python >= 3.14 support for macOS-Intel systems (#207) --- .github/workflows/unit_tests.yml | 13 ++++++++++--- docs/source/_static/css/custom.css | 22 ++++++++++++++++++++++ docs/source/conf.py | 1 + docs/source/installation.rst | 8 ++++++++ pyproject.toml | 1 + 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8a6d7e8..cfe4336 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -64,15 +64,22 @@ jobs: run: python -m coverage run && coverage report test_conda: - timeout-minutes: 90 + timeout-minutes: 60 runs-on: ubuntu-latest defaults: run: shell: bash -el {0} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + python-version: "3.14" + - os: macos-15-intel + python-version: "3.14" env: MKL_NUM_THREADS: '1' PYTHONUNBUFFERED: '1' - PYTHON_VERSION: '3.14' steps: - uses: actions/checkout@v6 - uses: pyvista/setup-headless-display-action@main @@ -83,7 +90,7 @@ jobs: with: environment-file: environment.yml create-args: >- # beware the >- instead of |, we don't split on newlines but on spaces - python=${{ env.PYTHON_VERSION }} + python=${{ matrix.python-version }} - name: Install package and test dependencies run: | pip install -e . diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index ca373b3..7b67808 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -4,4 +4,26 @@ div { ul { text-align: left +} + +@media (max-width: 1199.98px) { + .bd-header .navbar-header-items__start { + flex-shrink: 1; + min-width: 0; + max-width: 45%; + } + + .bd-header .navbar-header-items__start .navbar-item, + .bd-header .navbar-brand { + min-width: 0; + max-width: 100%; + flex-shrink: 1; + } + + .bd-header .navbar-brand .logo__title { + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index ed44c45..65fefee 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -36,6 +36,7 @@ "sphinxcontrib.bibtex", "sphinx_gallery.gen_gallery", "sphinx_copybutton", + "sphinx_design", ### Custom "directive_formatting", ] diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 49b25d2..8ea8185 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -34,6 +34,14 @@ or `pixi `_: | +.. dropdown:: Compatibility with Python ≥ 3.14 on macOS Intel systems + + Support for macOS Intel systems is limited to Python < 3.14 due to wheel availability limitations for `llvmlite`, which can lead to installation issues using ``pip`` and ``uv``. + + If you have a macOS Intel system and need to use Python ≥ 3.14, consider using ``conda`` or ``pixi`` for installation. + +| + If you need to create an environment or project in which to install PyBispectra, you can do so using `venv `_, `uv `_, `pixi `_, or diff --git a/pyproject.toml b/pyproject.toml index ae28be2..60b1498 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ doc = [ "pydata-sphinx-theme", "sphinx", "sphinx-copybutton", + "sphinx-design", "sphinx-gallery>=0.18", "sphinxcontrib-bibtex", ] From 6ad6a6cd12b47132ae067d51eeb6c71edc7e3746 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Mon, 6 Apr 2026 16:03:19 +0100 Subject: [PATCH 24/45] [MAINT] Prepare for v1.3.1 release (#208) --- README.md | 6 +++--- changelog.md | 10 ++++++++-- docs/source/_static/versions.json | 4 ++-- docs/source/conf.py | 2 +- pyproject.toml | 2 +- src/pybispectra/__init__.py | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cc8f41e..104534d 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Analysis of phase-amplitude coupling, time delays, and non-sinusoidal waveshape ## Installation & Requirements: Install the package into the desired environment using pip: `pip install pybispectra`
or conda: `conda install -c conda-forge pybispectra`
-More information on the [installation](https://pybispectra.readthedocs.io/latest/installation.html) page. +More information on the [installation](https://pybispectra.readthedocs.io/1.3/installation.html) page. ## Use: -To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/latest/) and [examples](https://pybispectra.readthedocs.io/latest/examples.html). +To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/1.3/) and [examples](https://pybispectra.readthedocs.io/1.3/examples.html). For instance, given some epoched time series, `data`, phase-amplitude coupling can be computed as: @@ -29,7 +29,7 @@ pac_results.plot() # plot results ``` ## Contributing & Development: -If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/latest/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. +If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/1.3/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. ## Citing: If you use this toolbox in your work, please include the following citation:
diff --git a/changelog.md b/changelog.md index 3719146..65cc04b 100644 --- a/changelog.md +++ b/changelog.md @@ -2,13 +2,19 @@ ## [Development Version](https://pybispectra.readthedocs.io/latest/) -##### Dependencies -- Added support for Python 3.14 in the `conda` environment. +No changes.
## [Version 1.3](https://pybispectra.readthedocs.io/1.3/) +### Version 1.3.1 + +##### Dependencies +- Added support for Python 3.14 in the `conda` environment. + +
+ ### Version 1.3.0 ##### Enhancements diff --git a/docs/source/_static/versions.json b/docs/source/_static/versions.json index 2796258..e947050 100644 --- a/docs/source/_static/versions.json +++ b/docs/source/_static/versions.json @@ -1,12 +1,12 @@ [ { "name": "dev", - "version": "1.3.1+dev", + "version": "1.4.0+dev", "url": "https://pybispectra.readthedocs.io/latest/" }, { "name": "1.3 (stable)", - "version": "1.3.0", + "version": "1.3.1", "url": "https://pybispectra.readthedocs.io/1.3/" }, { diff --git a/docs/source/conf.py b/docs/source/conf.py index 65fefee..7a20a04 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,7 @@ project = "PyBispectra" copyright = "2023-2026, Thomas S. Binns" author = "Thomas S. Binns" -release = "1.3.1dev" +release = "1.3.1" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index 60b1498..bcdbd81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dynamic = [ ] # check tools/hatch_build.py for details name = "pybispectra" readme = "README.md" -version = "1.3.1dev" +version = "1.3.1" [project.optional-dependencies] dev = ["pybispectra[doc]", "pybispectra[lint]", "pybispectra[test]"] diff --git a/src/pybispectra/__init__.py b/src/pybispectra/__init__.py index d460dc3..9cd9656 100644 --- a/src/pybispectra/__init__.py +++ b/src/pybispectra/__init__.py @@ -1,6 +1,6 @@ """Initialisation of the PyBispectra package.""" -__version__ = "1.3.1+dev" +__version__ = "1.3.1" from .cfc import AAC, PAC, PPC from .general import Bispectrum, Threenorm From 6a31d1bf4b74636830de3472e618151c099da202 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Mon, 6 Apr 2026 16:25:30 +0100 Subject: [PATCH 25/45] [MAINT] Post-1.3.1 release update (#210) --- README.md | 6 +++--- docs/source/conf.py | 2 +- pyproject.toml | 2 +- src/pybispectra/__init__.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 104534d..cc8f41e 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Analysis of phase-amplitude coupling, time delays, and non-sinusoidal waveshape ## Installation & Requirements: Install the package into the desired environment using pip: `pip install pybispectra`
or conda: `conda install -c conda-forge pybispectra`
-More information on the [installation](https://pybispectra.readthedocs.io/1.3/installation.html) page. +More information on the [installation](https://pybispectra.readthedocs.io/latest/installation.html) page. ## Use: -To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/1.3/) and [examples](https://pybispectra.readthedocs.io/1.3/examples.html). +To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/latest/) and [examples](https://pybispectra.readthedocs.io/latest/examples.html). For instance, given some epoched time series, `data`, phase-amplitude coupling can be computed as: @@ -29,7 +29,7 @@ pac_results.plot() # plot results ``` ## Contributing & Development: -If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/1.3/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. +If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/latest/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. ## Citing: If you use this toolbox in your work, please include the following citation:
diff --git a/docs/source/conf.py b/docs/source/conf.py index 7a20a04..e91a226 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,7 @@ project = "PyBispectra" copyright = "2023-2026, Thomas S. Binns" author = "Thomas S. Binns" -release = "1.3.1" +release = "1.4.0dev" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index bcdbd81..124bc6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dynamic = [ ] # check tools/hatch_build.py for details name = "pybispectra" readme = "README.md" -version = "1.3.1" +version = "1.4.0dev" [project.optional-dependencies] dev = ["pybispectra[doc]", "pybispectra[lint]", "pybispectra[test]"] diff --git a/src/pybispectra/__init__.py b/src/pybispectra/__init__.py index 9cd9656..69d76fd 100644 --- a/src/pybispectra/__init__.py +++ b/src/pybispectra/__init__.py @@ -1,6 +1,6 @@ """Initialisation of the PyBispectra package.""" -__version__ = "1.3.1" +__version__ = "1.4.0+dev" from .cfc import AAC, PAC, PPC from .general import Bispectrum, Threenorm From b6f866360e57fc6d991b7197d9d85911fe8270cf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:51:29 +0100 Subject: [PATCH 26/45] [pre-commit.ci] pre-commit autoupdate (#211) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7aef92..66bfa84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.8 + rev: v0.15.9 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.8 + rev: v0.15.9 hooks: - id: ruff name: ruff lint examples From 1a8cf939673ec38c5f731315594f37d96ae11715 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Mon, 13 Apr 2026 20:15:26 +0100 Subject: [PATCH 27/45] [MAINT] Drop pin for max support Python version (#213) --- changelog.md | 3 ++- docs/source/installation.rst | 34 +++++++++++++++++++++++++++------- environment.yml | 2 +- tools/hatch_build.py | 2 -- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 65cc04b..accd0ea 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,8 @@ ## [Development Version](https://pybispectra.readthedocs.io/latest/) -No changes. +##### Dependencies +- Dropped max supported Python version being pinned.
diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 8ea8185..04ee5e6 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -7,6 +7,10 @@ for version ≥ 1.2.2. PyBispectra requires Python ≥ 3.10. + +Package installation +-------------------- + To install PyBispectra, activate the desired environment or project in which you want the package, then install it using `pip `_: @@ -34,13 +38,29 @@ or `pixi `_: | +.. dropdown:: Compatibility for newly released Python versions + :icon: alert + :color: info + + If you encounter issues installing PyBispectra in environments with newly released Python versions, this may be due to a lack of compatible ``numba`` releases, one of PyBispectra's core dependencies. + + ``numba`` is not always immediately compatible with new Python versions, and there may be a delay of several weeks before a compatible version is released. + + You can find the supported Python versions for ``numba`` in this `table `_. + + If a compatible ``numba`` release is available for your environment's Python version and you are still encountering installation issues, please report this on the `PyBispectra issue page `_. + .. dropdown:: Compatibility with Python ≥ 3.14 on macOS Intel systems + :icon: alert + :color: info - Support for macOS Intel systems is limited to Python < 3.14 due to wheel availability limitations for `llvmlite`, which can lead to installation issues using ``pip`` and ``uv``. + Due to wheel availability limitations for ``llvmlite`` on macOS Intel systems with Python ≥ 3.14, installation issues can arise when using ``pip`` and ``uv``. - If you have a macOS Intel system and need to use Python ≥ 3.14, consider using ``conda`` or ``pixi`` for installation. + If you have a macOS Intel system and need to use Python ≥ 3.14, consider using ``conda`` or ``pixi`` for an easier installation. -| + +Creating an environment or project for installation +--------------------------------------------------- If you need to create an environment or project in which to install PyBispectra, you can do so using `venv `_, @@ -48,7 +68,7 @@ do so using `venv `_, `conda `_. With ``venv`` -------------- +~~~~~~~~~~~~~ In a shell with Python available, navigate to your project location and create the environment: @@ -66,7 +86,7 @@ then install the package: pip install pybispectra With ``uv`` ------------ +~~~~~~~~~~~ In a shell with ``uv`` available, navigate to your project location and create the environment: @@ -84,7 +104,7 @@ then install the package: uv pip install pybispectra With ``pixi`` -------------- +~~~~~~~~~~~~~ In a shell with ``pixi`` available, run the following commands: @@ -95,7 +115,7 @@ In a shell with ``pixi`` available, run the following commands: pixi add pybispectra With ``conda`` --------------- +~~~~~~~~~~~~~~ In a shell with ``conda`` available, run the following commands: diff --git a/environment.yml b/environment.yml index ffc93b9..631712f 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: pybispectra channels: - conda-forge dependencies: - - python>=3.10,<3.15 + - python>=3.10 - joblib>=1.2 - matplotlib>=3.6 - mne-base>=1.7 diff --git a/tools/hatch_build.py b/tools/hatch_build.py index a49c51e..aac907a 100644 --- a/tools/hatch_build.py +++ b/tools/hatch_build.py @@ -16,8 +16,6 @@ def update(self, metadata): requires_python = ">=3.10" if is_macos_intel: requires_python += ", <3.14" - else: - requires_python += ", <3.15" metadata["requires-python"] = requires_python # dependencies From 6ba1188379fa25f02cddab921fd3ce5e702f4441 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Mon, 13 Apr 2026 21:29:29 +0100 Subject: [PATCH 28/45] [MAINT] Update old CI steps (#214) --- .github/workflows/unit_tests.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index cfe4336..d1bd5df 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -126,17 +126,14 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip setuptools wheel - pip install --upgrade --upgrade-strategy eager .[test] + pip install -e . --no-deps + pip install -r tools/requirements_old.txt - name: Display versions and environment information run: | echo $TZ date - python --version which python - - run: | - pip install -e . --no-deps - pip install -r tools/requirements_old.txt - - run: python -c "import pybispectra; import mne; print(f'PyBispectra {pybispectra.__version__}\n'); mne.sys_info()" + python -c "import pybispectra; import mne; print(f'PyBispectra {pybispectra.__version__}\n'); mne.sys_info()" - name: Download testing data run: python -c "from pybispectra.utils import DATASETS, get_example_data_paths; (get_example_data_paths(data) for data in DATASETS.keys())" - name: Run pytest From 240ba3c138c6f6773c7166f5b9182779c6ef7e14 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Apr 2026 12:59:27 +0100 Subject: [PATCH 29/45] [pre-commit.ci] pre-commit autoupdate (#215) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66bfa84..54bc0f7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.9 + rev: v0.15.10 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.9 + rev: v0.15.10 hooks: - id: ruff name: ruff lint examples From 2fabdab7355a183a37905f9d5d181fb63d5c1f56 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 11:45:26 +0100 Subject: [PATCH 30/45] [pre-commit.ci] pre-commit autoupdate (#216) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54bc0f7..31fa058 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.10 + rev: v0.15.11 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.10 + rev: v0.15.11 hooks: - id: ruff name: ruff lint examples From 1e4ae7e69fc9b13dc6eaabde2fd240bcec1c2301 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 13:27:50 +0100 Subject: [PATCH 31/45] [pre-commit.ci] pre-commit autoupdate (#217) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 31fa058..dfaba5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.11 + rev: v0.15.12 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.11 + rev: v0.15.12 hooks: - id: ruff name: ruff lint examples From b46a4359700ab45b7e6143b86818f2f111a22551 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 10:10:20 +0100 Subject: [PATCH 32/45] [pre-commit.ci] pre-commit autoupdate (#218) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dfaba5e..d4be18a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.12 + rev: v0.15.13 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.12 + rev: v0.15.13 hooks: - id: ruff name: ruff lint examples From 4b1274b2f7d5077f04b446e16c9d91c36763076e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 11:35:17 +0100 Subject: [PATCH 33/45] [pre-commit.ci] pre-commit autoupdate (#219) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d4be18a..cebb652 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.13 + rev: v0.15.14 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.13 + rev: v0.15.14 hooks: - id: ruff name: ruff lint examples From 55d2561a8044570b4828426224e1e673470d66dc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 08:01:46 +0100 Subject: [PATCH 34/45] [pre-commit.ci] pre-commit autoupdate (#220) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cebb652..3ac99c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.14 + rev: v0.15.15 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.14 + rev: v0.15.15 hooks: - id: ruff name: ruff lint examples From 1cb3deccb31ac0e83262d06c2c7051a7ae878980 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 09:57:22 +0100 Subject: [PATCH 35/45] [pre-commit.ci] pre-commit autoupdate (#221) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ac99c6..cedf37a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.15 + rev: v0.15.16 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.15 + rev: v0.15.16 hooks: - id: ruff name: ruff lint examples From 7a3b947e393e156c63630c6e27fd240ee2f1f8c7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 10:30:25 +0100 Subject: [PATCH 36/45] [pre-commit.ci] pre-commit autoupdate (#222) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cedf37a..91eba5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.16 + rev: v0.15.17 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.16 + rev: v0.15.17 hooks: - id: ruff name: ruff lint examples From 5e06e896001b0db3c41205dca38021bc30fb85c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 09:25:14 +0100 Subject: [PATCH 37/45] Bump actions/checkout from 6 to 7 (#224) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- .github/workflows/unit_tests.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 386f01d..78f5579 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: package: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Set up Python uses: actions/setup-python@v6 with: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d1bd5df..7b028b0 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: pyvista/setup-headless-display-action@main with: qt: true @@ -81,7 +81,7 @@ jobs: MKL_NUM_THREADS: '1' PYTHONUNBUFFERED: '1' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: pyvista/setup-headless-display-action@main with: qt: true @@ -118,7 +118,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: "3.10" - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: pyvista/setup-headless-display-action@main with: qt: true From b7e0a5aa5aed125f3a98bb5c56d7a6a52e8a6bc9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 09:26:14 +0100 Subject: [PATCH 38/45] [pre-commit.ci] pre-commit autoupdate (#223) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91eba5f..1a92c54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.17 + rev: v0.15.18 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.17 + rev: v0.15.18 hooks: - id: ruff name: ruff lint examples From f6388f2a4817ebcec0eb5a7b2bb1ab6a197fa250 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 09:50:20 +0100 Subject: [PATCH 39/45] [pre-commit.ci] pre-commit autoupdate (#225) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a92c54..6ee38e2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.18 + rev: v0.15.20 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.18 + rev: v0.15.20 hooks: - id: ruff name: ruff lint examples From 418d1e1b8fb39b3f87f07929d2848de6dfb5f997 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 09:54:46 +0100 Subject: [PATCH 40/45] [pre-commit.ci] pre-commit autoupdate (#226) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ee38e2..c46ebb6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.15.21 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.15.21 hooks: - id: ruff name: ruff lint examples From c86c8631c4de8caaa529b04bd6b16616adbafc1a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 10:57:28 +0100 Subject: [PATCH 41/45] [pre-commit.ci] pre-commit autoupdate (#227) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c46ebb6..91655c0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.21 + rev: v0.15.22 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.21 + rev: v0.15.22 hooks: - id: ruff name: ruff lint examples @@ -19,7 +19,7 @@ repos: # codespell - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell additional_dependencies: From b8f89ea4bedb30803e9fe9fc2dcd2fb06d46c9ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 12:36:22 +0100 Subject: [PATCH 42/45] Bump actions/setup-python from 6 to 7 (#228) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- .github/workflows/unit_tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78f5579..ab3381c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v6 + uses: actions/setup-python@v7 with: python-version: '3.10' - name: Install dependencies diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7b028b0..4570f90 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -38,7 +38,7 @@ jobs: OPENBLAS_NUM_THREADS: "1" PYTHONUNBUFFERED: "1" steps: - - uses: actions/setup-python@v6 + - uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - uses: actions/checkout@v7 @@ -115,7 +115,7 @@ jobs: OPENBLAS_NUM_THREADS: "1" PYTHONUNBUFFERED: "1" steps: - - uses: actions/setup-python@v6 + - uses: actions/setup-python@v7 with: python-version: "3.10" - uses: actions/checkout@v7 From dfa998403852c7668fb953a148ba6955b0bc842b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 20:25:09 +0100 Subject: [PATCH 43/45] [pre-commit.ci] pre-commit autoupdate (#229) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Thomas S. Binns --- .pre-commit-config.yaml | 4 +- examples/plot_compute_time_resolved.py | 2 +- pyproject.toml | 6 +- src/pybispectra/cfc/aac.py | 10 +-- src/pybispectra/cfc/pac.py | 8 +-- src/pybispectra/cfc/ppc.py | 8 +-- src/pybispectra/general/general.py | 32 +++++---- src/pybispectra/tde/tde.py | 19 +++--- src/pybispectra/utils/_defaults.py | 2 +- src/pybispectra/utils/_plot.py | 92 +++++++++++++------------- src/pybispectra/utils/_process.py | 76 ++++++++++----------- src/pybispectra/utils/_utils.py | 3 +- src/pybispectra/utils/ged.py | 37 ++++++----- src/pybispectra/utils/results.py | 61 ++++++++--------- src/pybispectra/utils/utils.py | 36 +++++----- src/pybispectra/waveshape/waveshape.py | 10 +-- 16 files changed, 200 insertions(+), 206 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91655c0..1c5f94e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # ruff PyBispectra - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.22 + rev: v0.16.0 hooks: - id: ruff name: ruff lint pybispectra @@ -10,7 +10,7 @@ repos: # ruff examples - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.22 + rev: v0.16.0 hooks: - id: ruff name: ruff lint examples diff --git a/examples/plot_compute_time_resolved.py b/examples/plot_compute_time_resolved.py index ba9cd46..7759b03 100644 --- a/examples/plot_compute_time_resolved.py +++ b/examples/plot_compute_time_resolved.py @@ -18,7 +18,7 @@ from matplotlib import pyplot as plt from numpy.random import RandomState -from pybispectra import WaveShape, get_example_data_paths, compute_tfr +from pybispectra import WaveShape, compute_tfr, get_example_data_paths ######################################################################################## # Background diff --git a/pyproject.toml b/pyproject.toml index 124bc6e..8162ac2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -126,7 +126,11 @@ ignore_roles = [ report_level = "WARNING" [tool.ruff] -extend-exclude = ["docs", "examples/compute_*.py"] +extend-exclude = [ + "docs", + "examples/compute_*.py", + "src/pybispectra/utils/_docs.py", +] line-length = 88 [tool.ruff.lint.per-file-ignores] diff --git a/src/pybispectra/cfc/aac.py b/src/pybispectra/cfc/aac.py index 9335d8c..5067b9f 100644 --- a/src/pybispectra/cfc/aac.py +++ b/src/pybispectra/cfc/aac.py @@ -7,9 +7,9 @@ from pybispectra.utils._defaults import _precision from pybispectra.utils._process import _ProcessFreqBase from pybispectra.utils._utils import ( + _compute_in_parallel, _compute_pearsonr_2d, _fast_find_first, - _compute_in_parallel, ) @@ -61,7 +61,7 @@ class AAC(_ProcessFreqBase): verbose : bool Whether or not to report the progress of the processing. - """ # noqa: E501 + """ _data_precision: type = _precision.real # Real-valued TFR power @@ -72,9 +72,9 @@ class AAC(_ProcessFreqBase): def compute( self, indices: tuple[tuple[int]] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_jobs: int = 1, ) -> None: r"""Compute AAC, averaged over epochs. diff --git a/src/pybispectra/cfc/pac.py b/src/pybispectra/cfc/pac.py index 937b69c..feaab72 100644 --- a/src/pybispectra/cfc/pac.py +++ b/src/pybispectra/cfc/pac.py @@ -80,9 +80,9 @@ class PAC(_ProcessBispectrum): def compute( self, indices: tuple[tuple[int]] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, antisym: bool | tuple[bool] = False, norm: bool | tuple[bool] = False, n_jobs: int = 1, @@ -181,7 +181,7 @@ def compute( References ---------- .. footbibliography:: - """ # noqa: E501 + """ self._reset_attrs() self._sort_metrics(antisym, norm) diff --git a/src/pybispectra/cfc/ppc.py b/src/pybispectra/cfc/ppc.py index b09f280..361eab2 100644 --- a/src/pybispectra/cfc/ppc.py +++ b/src/pybispectra/cfc/ppc.py @@ -6,7 +6,7 @@ from pybispectra.utils import ResultsCFC from pybispectra.utils._defaults import _precision from pybispectra.utils._process import _ProcessFreqBase -from pybispectra.utils._utils import _fast_find_first, _compute_in_parallel +from pybispectra.utils._utils import _compute_in_parallel, _fast_find_first class PPC(_ProcessFreqBase): @@ -73,9 +73,9 @@ class PPC(_ProcessFreqBase): def compute( self, indices: tuple[tuple[int]] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_jobs: int = 1, ) -> None: r"""Compute PPC, averaged over epochs. diff --git a/src/pybispectra/general/general.py b/src/pybispectra/general/general.py index 98d3be8..fdbacc2 100644 --- a/src/pybispectra/general/general.py +++ b/src/pybispectra/general/general.py @@ -22,16 +22,14 @@ class _General(_ProcessBispectrum): def _sort_indices(self, indices: tuple[tuple[int]] | None) -> None: """Sort kmn channel indices inputs.""" if indices is None: - indices = tuple( - [ - tuple(np.tile(range(self._n_chans), self._n_chans**2).tolist()), - tuple( - np.repeat( - np.tile(range(self._n_chans), self._n_chans), self._n_chans - ).tolist() - ), - tuple(np.repeat(range(self._n_chans), self._n_chans**2).tolist()), - ] + indices = ( + tuple(np.tile(range(self._n_chans), self._n_chans**2).tolist()), + tuple( + np.repeat( + np.tile(range(self._n_chans), self._n_chans), self._n_chans + ).tolist() + ), + tuple(np.repeat(range(self._n_chans), self._n_chans**2).tolist()), ) if not isinstance(indices, tuple): raise TypeError("`indices` must be a tuple.") @@ -118,9 +116,9 @@ class Bispectrum(_General): def compute( self, indices: tuple[tuple[int]] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_jobs: int = 1, ) -> None: r"""Compute the bispectrum, averaged over epochs. @@ -167,7 +165,7 @@ def compute( .. warning:: For values of ``f1s`` higher than ``f2s`` or where ``f2s + f1s`` exceeds the Nyquist frequency, a :obj:`numpy.nan` value is returned. - """ # noqa: E501 + """ self._reset_attrs() self._sort_indices(indices) @@ -305,9 +303,9 @@ class Threenorm(_General): def compute( self, indices: tuple[tuple[int]] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_jobs: int = 1, ) -> None: r"""Compute the threenorm, averaged over epochs. diff --git a/src/pybispectra/tde/tde.py b/src/pybispectra/tde/tde.py index 748cfff..bfffea5 100644 --- a/src/pybispectra/tde/tde.py +++ b/src/pybispectra/tde/tde.py @@ -1,7 +1,8 @@ """Tools for handling TDE analysis.""" +from collections.abc import Callable from copy import deepcopy -from typing import Callable +from typing import ClassVar import numpy as np from numba import njit @@ -10,7 +11,7 @@ from pybispectra.utils import ResultsTDE from pybispectra.utils._defaults import _precision from pybispectra.utils._process import _ProcessBispectrum -from pybispectra.utils._utils import _compute_in_parallel, _number_like, _int_like +from pybispectra.utils._utils import _compute_in_parallel, _int_like, _number_like class TDE(_ProcessBispectrum): @@ -97,7 +98,7 @@ class TDE(_ProcessBispectrum): _tde_iv_nosym: np.ndarray = None _tde_iv_antisym: np.ndarray = None - _kmn: dict = { + _kmn: ClassVar[dict] = { "xxx": (0, 0, 0), "yyy": (1, 1, 1), "xyx": (0, 1, 0), @@ -109,9 +110,9 @@ def __init__( self, data: np.ndarray, freqs: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, verbose: bool = True, - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, freqs, sampling_freq, times=None, verbose=verbose) self._sort_fft_coeffs() @@ -130,8 +131,8 @@ def _sort_fft_coeffs(self) -> None: def compute( self, indices: tuple[tuple[int]] | None = None, - fmin: int | float | tuple[int | float] = 0.0, - fmax: int | float | tuple[int | float] = np.inf, + fmin: float | tuple[float] = 0.0, + fmax: float | tuple[float] = np.inf, antisym: bool | tuple[bool] = False, method: int | tuple[int] = 1, n_jobs: int = 1, @@ -284,9 +285,7 @@ def _reset_attrs(self) -> None: self._xyz = None def _sort_freq_bands( - self, - fmin: int | float | tuple[int | float], - fmax: int | float | tuple[int | float], + self, fmin: float | tuple[float], fmax: float | tuple[float] ) -> None: """Sort inputs for the frequency bounds.""" if not isinstance(fmin, _number_like + (tuple,)): diff --git a/src/pybispectra/utils/_defaults.py b/src/pybispectra/utils/_defaults.py index fc35a9b..14156cf 100644 --- a/src/pybispectra/utils/_defaults.py +++ b/src/pybispectra/utils/_defaults.py @@ -9,7 +9,7 @@ class _Precision: Double precision (i.e., float64 and complex128) used by default. """ - def __init__(self) -> None: # noqa: D107 + def __init__(self) -> None: self.type = "double" self.real = np.float64 self.complex = np.complex128 diff --git a/src/pybispectra/utils/_plot.py b/src/pybispectra/utils/_plot.py index e7eb70d..c28a3e9 100644 --- a/src/pybispectra/utils/_plot.py +++ b/src/pybispectra/utils/_plot.py @@ -44,8 +44,8 @@ def _sort_plot_inputs( nodes: int | tuple[int] | None, n_rows: int, n_cols: int, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, ) -> tuple[int]: """Sort the plotting inputs. @@ -142,7 +142,7 @@ def _sort_freq_inputs( return f1s, f2s, f1_idcs, f2_idcs def _sort_time_inputs( - self, times: tuple[int | float] | None + self, times: tuple[float] | None ) -> tuple[np.ndarray | None, np.ndarray | None]: """Sort `times` input. @@ -234,7 +234,7 @@ def __init__( f2s: np.ndarray, times: np.ndarray | None, name: str, - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, indices, name) self.f1s = f1s.copy() @@ -244,13 +244,13 @@ def __init__( def plot( self, nodes: int | tuple[int] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_rows: int = 1, n_cols: int = 1, - major_tick_intervals: int | float = 5.0, - minor_tick_intervals: int | float = 1.0, + major_tick_intervals: float = 5.0, + minor_tick_intervals: float = 1.0, plot_absolute: bool = False, mirror_cbar_range: bool = True, cbar_range_abs: tuple[float] | list[tuple[float]] | None = None, @@ -400,13 +400,13 @@ def plot( def _sort_plot_inputs( self, nodes: int | tuple[int] | None, - f1s: tuple[int | float] | None, - f2s: tuple[int | float] | None, - times: tuple[int | float] | None, + f1s: tuple[float] | None, + f2s: tuple[float] | None, + times: tuple[float] | None, n_rows: int, n_cols: int, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, plot_absolute: bool, mirror_cbar_range: bool, cbar_range_abs: tuple[float] | list[tuple[float]] | None, @@ -469,8 +469,9 @@ def _sort_plot_inputs( cbar_range_phase, ] cbar_names = ["abs", "real", "imag", "phase"] - cbar_idx = 0 - for cbar_range, cbar_name in zip(cbar_ranges, cbar_names): + for cbar_idx, (cbar_range, cbar_name) in enumerate( + zip(cbar_ranges, cbar_names) + ): if not isinstance(cbar_range, (list, tuple, type(None))): raise TypeError( f"`cbar_range_{cbar_name}` must be a list, tuple, or None." @@ -490,7 +491,6 @@ def _sort_plot_inputs( f"Limits in `cbar_range_{cbar_name}` must have length of 2." ) cbar_ranges[cbar_idx] = cbar_range - cbar_idx += 1 return (nodes, f1s, f2s, f1_idcs, f2_idcs, times, time_idcs, cbar_ranges) @@ -555,8 +555,8 @@ def _plot_results( time_idcs: np.ndarray | None, n_rows: int, n_cols: int, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, plot_absolute: bool, mirror_cbar_range: bool, cbar_ranges: list[list[tuple[float | None]]], @@ -711,8 +711,8 @@ def _plot_results( def _set_axis_ticks( self, axis: plt.Axes, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, ) -> None: """Set major and minor tick intervals of x- and y-axes.""" axis.xaxis.set_major_locator(plt.MultipleLocator(major_tick_intervals)) @@ -757,7 +757,7 @@ def __init__( f2s: np.ndarray, times: np.ndarray | None, name: str, - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, indices, name) self.f1s = f1s.copy() @@ -767,13 +767,13 @@ def __init__( def plot( self, nodes: int | tuple[int] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_rows: int = 1, n_cols: int = 1, - major_tick_intervals: int | float = 5.0, - minor_tick_intervals: int | float = 1.0, + major_tick_intervals: float = 5.0, + minor_tick_intervals: float = 1.0, cbar_range: tuple[float] | list[tuple[float]] | None = None, show: bool = True, ) -> tuple[list[Figure], list[np.ndarray]]: @@ -836,7 +836,7 @@ def plot( ----- ``n_rows`` and ``n_cols`` of ``1`` will plot the results for each node on a new figure. - """ # noqa: E501 + """ nodes, f1s, f2s, f1_idcs, f2_idcs, times, time_idcs, cbar_range = ( self._sort_plot_inputs( nodes, @@ -876,13 +876,13 @@ def plot( def _sort_plot_inputs( self, nodes: int | tuple[int] | None, - f1s: tuple[int | float] | None, - f2s: tuple[int | float] | None, - times: tuple[int | float] | None, + f1s: tuple[float] | None, + f2s: tuple[float] | None, + times: tuple[float] | None, n_rows: int, n_cols: int, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, cbar_range: tuple[float] | list[tuple[float]] | None, ) -> tuple[ tuple[int], @@ -956,8 +956,8 @@ def _plot_results( time_idcs: np.ndarray | None, n_rows: int, n_cols: int, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, cbar_range: list[tuple[float | None]], ) -> tuple[list[Figure], list[np.ndarray]]: """Plot results on the relevant figures/subplots.""" @@ -1043,8 +1043,8 @@ def _plot_results( def _set_axis_ticks( self, axis: plt.Axes, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, ) -> None: """Set major and minor tick intervals of x- and y-axes.""" axis.xaxis.set_major_locator(plt.MultipleLocator(major_tick_intervals)) @@ -1086,7 +1086,7 @@ def __init__( freq_bands: tuple[tuple[float]] | None, times: np.ndarray, name: str, - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, indices, name) self.tau = tau @@ -1102,11 +1102,11 @@ def plot( self, nodes: int | tuple[int] | None = None, freq_bands: int | tuple[int] | None = None, - times: tuple[int | float] | None = None, + times: tuple[float] | None = None, n_rows: int = 1, n_cols: int = 1, - major_tick_intervals: int | float = 500.0, - minor_tick_intervals: int | float = 100.0, + major_tick_intervals: float = 500.0, + minor_tick_intervals: float = 100.0, show: bool = True, ) -> tuple[list[Figure], list[np.ndarray]]: """Plot the results. @@ -1189,7 +1189,7 @@ def _sort_plot_inputs( self, nodes: int | tuple[int] | None, freq_bands: int | tuple[int] | None, - times: tuple[int | float] | None, + times: tuple[float] | None, n_rows: int, n_cols: int, major_tick_intervals: float, @@ -1290,8 +1290,8 @@ def _plot_results( time_idcs: np.ndarray, n_rows: int, n_cols: int, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, ) -> tuple[list[Figure], list[np.ndarray]]: """Plot results on the relevant figures/subplots.""" fig_i = 0 @@ -1385,8 +1385,8 @@ def _mark_delay( def _set_axis_ticks( self, axis: plt.Axes, - major_tick_intervals: int | float, - minor_tick_intervals: int | float, + major_tick_intervals: float, + minor_tick_intervals: float, ) -> None: """Set major and minor tick intervals of the x-axis.""" axis.xaxis.set_major_locator(plt.MultipleLocator(major_tick_intervals)) diff --git a/src/pybispectra/utils/_process.py b/src/pybispectra/utils/_process.py index ddc49f2..6a66dc5 100644 --- a/src/pybispectra/utils/_process.py +++ b/src/pybispectra/utils/_process.py @@ -39,7 +39,7 @@ def __init__( self, data: np.ndarray, freqs: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, times: np.ndarray | None = None, verbose: bool = True, ) -> None: @@ -49,7 +49,7 @@ def _sort_init_inputs( self, data: np.ndarray, freqs: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, times: np.ndarray | None, verbose: bool, ) -> None: @@ -135,11 +135,9 @@ def _sort_init_inputs( def _sort_indices(self, indices: tuple[tuple[int]] | None) -> None: """Sort seed-target indices inputs.""" if indices is None: - indices = tuple( - [ - tuple(np.tile(range(self._n_chans), self._n_chans).tolist()), - tuple(np.repeat(range(self._n_chans), self._n_chans).tolist()), - ] + indices = ( + tuple(np.tile(range(self._n_chans), self._n_chans).tolist()), + tuple(np.repeat(range(self._n_chans), self._n_chans).tolist()), ) if not isinstance(indices, tuple): raise TypeError("`indices` must be a tuple.") @@ -167,9 +165,7 @@ def _sort_indices(self, indices: tuple[tuple[int]] | None) -> None: self._n_cons = len(seeds) - def _sort_freqs( - self, f1s: tuple[int | float] | None, f2s: tuple[int | float] | None - ) -> None: + def _sort_freqs(self, f1s: tuple[float] | None, f2s: tuple[float] | None) -> None: """Sort frequency inputs.""" check_f1s = True check_f2s = True @@ -208,15 +204,14 @@ def _sort_freqs( ) self._f2s = self.freqs[f2_idcs] - if self.verbose: - if self._f1s.max() >= self._f2s.min(): - warn( - "At least one value in `f1s` is >= a value in `f2s`. The " - "corresponding result(s) will have a value of NaN.", - UserWarning, - ) + if self.verbose and self._f1s.max() >= self._f2s.min(): + warn( + "At least one value in `f1s` is >= a value in `f2s`. The corresponding " + "result(s) will have a value of NaN.", + UserWarning, + ) - def _sort_tmin_tmax(self, times: tuple[int | float] | None) -> None: + def _sort_tmin_tmax(self, times: tuple[float] | None) -> None: """Sort time range inputs.""" if times is None: times = (-np.inf, np.inf) @@ -308,34 +303,33 @@ def _sort_indices(self, indices: tuple[tuple[int]]) -> None: """Sort seed-target indices inputs.""" super()._sort_indices(indices) - if self.verbose: - if self._return_antisym and ( + if ( + self.verbose + and self._return_antisym + and ( any(seed == target for seed, target in zip(self._seeds, self._targets)) - ): - warn( - "The seed and target for at least one connection is the same " - "channel. The corresponding antisymmetrised result(s) will be " - "NaN-valued.", - UserWarning, - ) + ) + ): + warn( + "The seed and target for at least one connection is the same channel. " + "The corresponding antisymmetrised result(s) will be NaN-valued.", + UserWarning, + ) - def _sort_freqs( - self, f1s: tuple[int | float] | None, f2s: tuple[int | float] | None - ) -> None: + def _sort_freqs(self, f1s: tuple[float] | None, f2s: tuple[float] | None) -> None: """Sort frequency inputs.""" super()._sort_freqs(f1s, f2s) - if self.verbose: - if any( - hfreq + lfreq not in self.freqs - for hfreq in self._f2s - for lfreq in self._f1s - ): - warn( - "At least one value of `f2s` + `f1s` is not present in the " - "frequencies. The corresponding result(s) will be NaN-valued.", - UserWarning, - ) + if self.verbose and any( + hfreq + lfreq not in self.freqs + for hfreq in self._f2s + for lfreq in self._f1s + ): + warn( + "At least one value of `f2s` + `f1s` is not present in the " + "frequencies. The corresponding result(s) will be NaN-valued.", + UserWarning, + ) @njit diff --git a/src/pybispectra/utils/_utils.py b/src/pybispectra/utils/_utils.py index d455351..f1eedb3 100644 --- a/src/pybispectra/utils/_utils.py +++ b/src/pybispectra/utils/_utils.py @@ -8,7 +8,6 @@ from pybispectra.utils._defaults import _precision - # Aliases for type checking _int_like = (int, np.integer) _float_like = (float, np.floating) @@ -109,7 +108,7 @@ def _get_block_indices(block_i: int, limit: int, n_jobs: int) -> np.ndarray: @njit def _fast_find_first( - vector: np.ndarray, value: int | float, start_idx: int = 0 + vector: np.ndarray, value: float, start_idx: int = 0 ) -> int: # pragma: no cover """Quickly find the first index of a value in a 1D array using Numba. diff --git a/src/pybispectra/utils/ged.py b/src/pybispectra/utils/ged.py index b04db4c..9131313 100644 --- a/src/pybispectra/utils/ged.py +++ b/src/pybispectra/utils/ged.py @@ -1,14 +1,15 @@ """Tools for performing generalised eigendecompositions.""" -from packaging.version import Version from multiprocessing import cpu_count from warnings import warn import numpy as np import scipy as sp -from mne import Info, __version__ as mne_version +from mne import Info +from mne import __version__ as mne_version from mne.decoding import SSD from mne.time_frequency import csd_array_fourier, csd_array_multitaper +from packaging.version import Version from pybispectra.utils._defaults import _precision from pybispectra.utils._utils import _create_mne_info, _int_like, _number_like @@ -168,9 +169,9 @@ class SpatioSpectralFilter: def __init__( self, data: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, verbose: bool = True, - ) -> None: # noqa: D107 + ) -> None: self.verbose = verbose self._sort_init_inputs(data, sampling_freq) @@ -193,9 +194,9 @@ def _sort_init_inputs(self, data: np.ndarray, sampling_freq: float) -> None: def _sort_freq_bounds( self, - signal_bounds: tuple[int | float], - noise_bounds: tuple[int | float], - signal_noise_gap: int | float, + signal_bounds: tuple[float], + noise_bounds: tuple[float], + signal_noise_gap: float, ) -> None: """Sort frequency bound inputs.""" if not isinstance(signal_bounds, tuple) or not all( @@ -307,9 +308,9 @@ def _sort_csd_method(self, csd_method: str) -> None: def fit_ssd( self, - signal_bounds: tuple[int | float], - noise_bounds: tuple[int | float], - signal_noise_gap: int | float = 1.0, + signal_bounds: tuple[float], + noise_bounds: tuple[float], + signal_noise_gap: float = 1.0, bandpass_filter: bool = False, indices: tuple[int] | None = None, rank: int | None = None, @@ -373,9 +374,9 @@ def fit_ssd( def _create_mne_filt_params( self, - signal_bounds: tuple[int | float], - noise_bounds: tuple[int | float], - signal_noise_gap: int | float, + signal_bounds: tuple[float], + noise_bounds: tuple[float], + signal_noise_gap: float, ) -> tuple[dict, dict]: """Create filter parameters for use with MNE's SSD implementation. @@ -452,14 +453,14 @@ def _compute_ssd( def fit_hpmax( self, - signal_bounds: tuple[int | float], - noise_bounds: tuple[int | float], + signal_bounds: tuple[float], + noise_bounds: tuple[float], n_harmonics: int = -1, indices: tuple[int] | None = None, rank: int | None = None, csd_method: str = "multitaper", n_fft: int | None = None, - mt_bandwidth: int | float = 5.0, + mt_bandwidth: float = 5.0, mt_adaptive: bool = True, mt_low_bias: bool = True, n_jobs: int = 1, @@ -563,7 +564,7 @@ def _compute_csd( self, csd_method: str, n_fft: int | None, - mt_bandwidth: int | float, + mt_bandwidth: float, mt_adaptive: bool, mt_low_bias: bool, n_jobs: int, @@ -837,7 +838,7 @@ def fit_transform_hpmax(self, *args: tuple, **kwargs: dict) -> np.ndarray: return self.transform() def get_transformed_data( - self, min_ratio: int | float = -np.inf, copy: bool = True + self, min_ratio: float = -np.inf, copy: bool = True ) -> np.ndarray: """Return the transformed data. diff --git a/src/pybispectra/utils/results.py b/src/pybispectra/utils/results.py index 8cf3569..184fdd6 100644 --- a/src/pybispectra/utils/results.py +++ b/src/pybispectra/utils/results.py @@ -5,9 +5,9 @@ import numpy as np from matplotlib.figure import Figure +from pybispectra.utils._defaults import _precision from pybispectra.utils._plot import _PlotCFC, _PlotGeneral, _PlotTDE, _PlotWaveShape from pybispectra.utils._utils import _int_like -from pybispectra.utils._defaults import _precision class _ResultsBase(ABC): @@ -316,7 +316,7 @@ def __init__( f2s: np.ndarray, times: np.ndarray | None = None, name: str = "CFC", - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, (3, 4), name) self._sort_init_inputs(indices, f1s, f2s, times) @@ -368,13 +368,13 @@ def _get_compact_results_child(self) -> tuple[np.ndarray, tuple[tuple[int]]]: def plot( self, nodes: int | tuple[int] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_rows: int = 1, n_cols: int = 1, - major_tick_intervals: int | float = 5.0, - minor_tick_intervals: int | float = 1.0, + major_tick_intervals: float = 5.0, + minor_tick_intervals: float = 1.0, cbar_range: tuple[float] | list[tuple[float]] | None = None, show: bool = True, ) -> tuple[list[Figure], list[np.ndarray]]: @@ -509,9 +509,9 @@ class ResultsTDE(_ResultsBase): tau : ~numpy.ndarray, shape of [nodes, frequency_bands] Estimated time delay (in ms) for each connection and frequency band. - """ # noqa: E501 + """ - freq_bands: tuple[tuple[int | float]] = None + freq_bands: tuple[tuple[float]] = None _n_fbands: int = None def __repr__(self) -> str: @@ -535,9 +535,9 @@ def __init__( data: np.ndarray, indices: tuple[tuple[int]], times: np.ndarray, - freq_bands: tuple[tuple[int | float]] | None = None, + freq_bands: tuple[tuple[float]] | None = None, name: str = "TDE", - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, (3,), name) self._sort_init_inputs(indices, times, freq_bands) @@ -553,10 +553,7 @@ def __init__( ) def _sort_init_inputs( - self, - indices: tuple[tuple[int]], - times: np.ndarray, - freq_bands: tuple[int | float], + self, indices: tuple[tuple[int]], times: np.ndarray, freq_bands: tuple[float] ) -> None: """Sort inputs to the object.""" super()._sort_indices_seeds_targets(indices) @@ -575,7 +572,7 @@ def _sort_times(self, times: np.ndarray) -> None: self.times = times - def _sort_freq_bands(self, freq_bands: tuple[tuple[int | float]]) -> None: + def _sort_freq_bands(self, freq_bands: tuple[tuple[float]]) -> None: """Sort ``freq_bands`` input.""" if freq_bands is not None: if not isinstance(freq_bands, tuple): @@ -621,11 +618,11 @@ def plot( self, nodes: int | tuple[int] | None = None, freq_bands: int | tuple[int] | None = None, - times: tuple[int | float] | None = None, + times: tuple[float] | None = None, n_rows: int = 1, n_cols: int = 1, - major_tick_intervals: int | float = 500.0, - minor_tick_intervals: int | float = 100.0, + major_tick_intervals: float = 500.0, + minor_tick_intervals: float = 100.0, show: bool = True, ) -> tuple[list[Figure], list[np.ndarray]]: """Plot the results. @@ -780,7 +777,7 @@ def __init__( f2s: np.ndarray, times: np.ndarray | None = None, name: str = "Waveshape", - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, (3, 4), name) self._sort_init_inputs(indices, f1s, f2s, times) @@ -831,13 +828,13 @@ def get_results(self, copy: bool = True) -> np.ndarray: def plot( self, nodes: int | tuple[int] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_rows: int = 1, n_cols: int = 1, - major_tick_intervals: int | float = 5.0, - minor_tick_intervals: int | float = 1.0, + major_tick_intervals: float = 5.0, + minor_tick_intervals: float = 1.0, plot_absolute: bool = False, mirror_cbar_range: bool = True, cbar_range_abs: tuple[float] | list[tuple[float]] | None = None, @@ -1048,7 +1045,7 @@ def __init__( f2s: np.ndarray, times: np.ndarray | None = None, name: str = "General", - ) -> None: # noqa: D107 + ) -> None: super().__init__(data, (3, 4), name) self._sort_init_inputs(indices, f1s, f2s, times) @@ -1145,13 +1142,13 @@ def _get_compact_results_child(self) -> tuple[np.ndarray, tuple[tuple[int]]]: def plot( self, nodes: int | tuple[int] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, n_rows: int = 1, n_cols: int = 1, - major_tick_intervals: int | float = 5.0, - minor_tick_intervals: int | float = 1.0, + major_tick_intervals: float = 5.0, + minor_tick_intervals: float = 1.0, plot_absolute: bool = False, mirror_cbar_range: bool = True, cbar_range_abs: tuple[float] | list[tuple[float]] | None = None, @@ -1254,7 +1251,7 @@ def plot( ----- ``n_rows`` and ``n_cols`` of ``1`` will plot the results for each node on a new figure. - """ # noqa: E501 + """ figures, axes = self._plotting.plot( nodes=nodes, f1s=f1s, diff --git a/src/pybispectra/utils/utils.py b/src/pybispectra/utils/utils.py index aa7635b..9ab2080 100644 --- a/src/pybispectra/utils/utils.py +++ b/src/pybispectra/utils/utils.py @@ -1,13 +1,14 @@ """Public tools for handling data and processing results.""" +from collections.abc import Callable from multiprocessing import cpu_count -from typing import Callable -from packaging.version import Version -import pooch import numpy as np +import pooch import scipy as sp -from mne import time_frequency, __version__ as mne_version +from mne import __version__ as mne_version +from mne import time_frequency +from packaging.version import Version from pybispectra import __version__ as version from pybispectra.utils._defaults import _precision @@ -16,7 +17,7 @@ def compute_fft( data: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, n_points: int | None = None, window: str = "hanning", n_jobs: int = 1, @@ -100,7 +101,7 @@ def compute_fft( def _compute_fft_input_checks( data: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, n_points: int | None, window: str, n_jobs: int, @@ -156,13 +157,13 @@ def _compute_fft_input_checks( def compute_tfr( data: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, freqs: np.ndarray, tfr_mode: str = "morlet", - n_cycles: np.ndarray | int | float = 7.0, + n_cycles: np.ndarray | float = 7.0, zero_mean_wavelets: bool | None = None, use_fft: bool = True, - multitaper_time_bandwidth: int | float = 4.0, + multitaper_time_bandwidth: float = 4.0, output: str = "power", n_jobs: int = 1, verbose: bool = True, @@ -290,13 +291,13 @@ def compute_tfr( def _compute_tfr_input_checks( data: np.ndarray, - sampling_freq: int | float, + sampling_freq: float, freqs: np.ndarray, tfr_mode: str, - n_cycles: np.ndarray | int | float, + n_cycles: np.ndarray | float, zero_mean_wavelets: bool | None, use_fft: bool, - multitaper_time_bandwidth: int | float, + multitaper_time_bandwidth: float, output: str, n_jobs: int, verbose: bool, @@ -362,9 +363,10 @@ def _compute_tfr_input_checks( if not isinstance(use_fft, bool): raise TypeError("`use_fft` must be a bool.") - if tfr_mode == "multitaper": - if not isinstance(multitaper_time_bandwidth, _number_like): - raise TypeError("`multitaper_time_bandwidth` must be an int or a float.") + if tfr_mode == "multitaper" and not isinstance( + multitaper_time_bandwidth, _number_like + ): + raise TypeError("`multitaper_time_bandwidth` must be an int or a float.") outputs = ["power", "complex"] if not isinstance(output, str): @@ -394,7 +396,7 @@ def _compute_tfr_input_checks( return tfr_func, return_weights, n_jobs -def compute_rank(data: np.ndarray, sv_tol: int | float = 1e-5) -> int: +def compute_rank(data: np.ndarray, sv_tol: float = 1e-5) -> int: """Compute the minimum rank of data from non-zero singular values. Parameters @@ -536,7 +538,7 @@ def get_example_data_paths(name: str, verbose: bool = False) -> str: If the file is not found in the local cache (see :func:`pooch.os_cache` for the location), it will be downloaded automatically. """ - if name not in DATASETS.keys(): + if name not in DATASETS: raise ValueError(f"`name` must be one of: {list(DATASETS.keys())}") return _pooch.fetch(fname=DATASETS[name], progressbar=verbose) diff --git a/src/pybispectra/waveshape/waveshape.py b/src/pybispectra/waveshape/waveshape.py index 61bd186..79a9641 100644 --- a/src/pybispectra/waveshape/waveshape.py +++ b/src/pybispectra/waveshape/waveshape.py @@ -8,8 +8,8 @@ _compute_threenorm, _ProcessBispectrum, ) -from pybispectra.utils.results import ResultsWaveShape from pybispectra.utils._utils import _compute_in_parallel, _int_like +from pybispectra.utils.results import ResultsWaveShape np.seterr(divide="ignore", invalid="ignore") # no warning for NaN division @@ -78,7 +78,7 @@ class WaveShape(_ProcessBispectrum): References ---------- .. footbibliography:: - """ # noqa: E501 + """ _return_nonorm = False _return_threenorm = False @@ -86,9 +86,9 @@ class WaveShape(_ProcessBispectrum): def compute( self, indices: tuple[int] | None = None, - f1s: tuple[int | float] | None = None, - f2s: tuple[int | float] | None = None, - times: tuple[int | float] | None = None, + f1s: tuple[float] | None = None, + f2s: tuple[float] | None = None, + times: tuple[float] | None = None, norm: bool | tuple[bool] = True, n_jobs: int = 1, ) -> None: From e538681cfc46b6c80938b8e0021c1f57306377b7 Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Sun, 2 Aug 2026 16:21:58 +0100 Subject: [PATCH 44/45] Update CSS (#230) --- docs/source/_static/css/custom.css | 23 +++++++++++++++++++++++ src/pybispectra/utils/utils.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index 7b67808..d4d7a90 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -6,6 +6,29 @@ ul { text-align: left } +/* widen main content area */ +.bd-page-width { + max-width: 100rem; +} + +/* make versionadded smaller and inline with param name */ +/* don't do for deprecated / versionchanged; they have extra info (too long to fit) */ +div.versionadded>p { + margin-top: 0; + margin-bottom: 0; +} + +div.versionadded { + margin: 0; + margin-left: 0.5rem; + display: inline-block; +} + +/* when FF supports :has(), change to → dd > p:has(+div.versionadded) */ +dd>p { + display: inline; +} + @media (max-width: 1199.98px) { .bd-header .navbar-header-items__start { flex-shrink: 1; diff --git a/src/pybispectra/utils/utils.py b/src/pybispectra/utils/utils.py index 9ab2080..0ba7134 100644 --- a/src/pybispectra/utils/utils.py +++ b/src/pybispectra/utils/utils.py @@ -207,10 +207,10 @@ def compute_tfr( output : ``"power"`` | ``"complex"`` (default ``"power"``) Type of TFR output to return. + .. versionadded:: 1.3 .. note:: If ``output = "complex"`` and ``tfr_mode = "multitaper"``, returning weights for each taper requires MNE version 1.10 or higher. - .. versionadded:: 1.3 n_jobs : int (default ``1``) Number of jobs to run in parallel. If ``-1``, all available CPUs are used. From ad17c097beed958602f29f7d2b53342ad628f6aa Mon Sep 17 00:00:00 2001 From: "Thomas S. Binns" Date: Sun, 2 Aug 2026 16:49:26 +0100 Subject: [PATCH 45/45] [MAINT] Prepare for 1.3.2 release (#231) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- README.md | 6 +++--- changelog.md | 10 ++++++++-- docs/source/_static/versions.json | 2 +- docs/source/conf.py | 2 +- pyproject.toml | 2 +- src/pybispectra/__init__.py | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cc8f41e..104534d 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Analysis of phase-amplitude coupling, time delays, and non-sinusoidal waveshape ## Installation & Requirements: Install the package into the desired environment using pip: `pip install pybispectra`
or conda: `conda install -c conda-forge pybispectra`
-More information on the [installation](https://pybispectra.readthedocs.io/latest/installation.html) page. +More information on the [installation](https://pybispectra.readthedocs.io/1.3/installation.html) page. ## Use: -To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/latest/) and [examples](https://pybispectra.readthedocs.io/latest/examples.html). +To get started with the toolbox, check out the [documentation](https://pybispectra.readthedocs.io/1.3/) and [examples](https://pybispectra.readthedocs.io/1.3/examples.html). For instance, given some epoched time series, `data`, phase-amplitude coupling can be computed as: @@ -29,7 +29,7 @@ pac_results.plot() # plot results ``` ## Contributing & Development: -If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/latest/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. +If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the [development](https://pybispectra.readthedocs.io/1.3/development.html) page. A unit test suite is included and must be expanded where necessary to validate any changes. ## Citing: If you use this toolbox in your work, please include the following citation:
diff --git a/changelog.md b/changelog.md index accd0ea..0311962 100644 --- a/changelog.md +++ b/changelog.md @@ -2,13 +2,19 @@ ## [Development Version](https://pybispectra.readthedocs.io/latest/) -##### Dependencies -- Dropped max supported Python version being pinned. +No changes.
## [Version 1.3](https://pybispectra.readthedocs.io/1.3/) +### Version 1.3.2 + +##### Dependencies +- Dropped max supported Python version being pinned. + +
+ ### Version 1.3.1 ##### Dependencies diff --git a/docs/source/_static/versions.json b/docs/source/_static/versions.json index e947050..ec275f0 100644 --- a/docs/source/_static/versions.json +++ b/docs/source/_static/versions.json @@ -6,7 +6,7 @@ }, { "name": "1.3 (stable)", - "version": "1.3.1", + "version": "1.3.2", "url": "https://pybispectra.readthedocs.io/1.3/" }, { diff --git a/docs/source/conf.py b/docs/source/conf.py index e91a226..5a1ac63 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,7 +16,7 @@ project = "PyBispectra" copyright = "2023-2026, Thomas S. Binns" author = "Thomas S. Binns" -release = "1.4.0dev" +release = "1.3.2" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index 8162ac2..2b80b9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dynamic = [ ] # check tools/hatch_build.py for details name = "pybispectra" readme = "README.md" -version = "1.4.0dev" +version = "1.3.2" [project.optional-dependencies] dev = ["pybispectra[doc]", "pybispectra[lint]", "pybispectra[test]"] diff --git a/src/pybispectra/__init__.py b/src/pybispectra/__init__.py index 69d76fd..1a66d0f 100644 --- a/src/pybispectra/__init__.py +++ b/src/pybispectra/__init__.py @@ -1,6 +1,6 @@ """Initialisation of the PyBispectra package.""" -__version__ = "1.4.0+dev" +__version__ = "1.3.2" from .cfc import AAC, PAC, PPC from .general import Bispectrum, Threenorm