From 8768c83ed9bcbeac1f98927ad4aa2dad16828994 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Tue, 21 Nov 2023 13:42:50 +0100 Subject: [PATCH 01/62] added metadata to pyproject.toml --- pyproject.toml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..daac105f5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[project] +name = "elephant" +dynamic = ["version"] +description = "Elephant is a package for analysis of electrophysiology data in Python" +license = {file = "LICENSE.txt"} +classifiers = ["Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering"] +authors = [{[name = "Elephant authors and contributors", email = "contact@python-elephant.org"]}] +readme = {file = "README.md", content-type = "text/markdown"} +requires-python = ">= 3.8" + +[project.urls] +Homepage = "http://python-elephant.org" +Documentation = "https://elephant.readthedocs.io/en/latest/" +Repository = "https://github.com/NeuralEnsemble/elephant" +Issues = "https://github.com/NeuralEnsemble/elephant/issues" +Changelog = "https://github.com/NeuralEnsemble/elephant/releases" + +# This file was created follwing this guide: +# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml \ No newline at end of file From 80d8d8f1e3e72a26c8f98b598c9ab5650292dc04 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Tue, 21 Nov 2023 14:07:27 +0100 Subject: [PATCH 02/62] added dependencies --- pyproject.toml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index daac105f5..d920f3925 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,9 +14,41 @@ classifiers = ["Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering"] -authors = [{[name = "Elephant authors and contributors", email = "contact@python-elephant.org"]}] +authors = [{name = "Elephant authors and contributors", email = "contact@python-elephant.org"}] readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">= 3.8" +dependencies = [ + "neo>=0.10.0", + "numpy>=1.19.5", + "quantities>=0.14.1", + "scipy>=1.5.4", + "six>=1.10.0", + "tqdm", + ] + +[project.optional-dependencies] +docs = ["numpydoc>=1.1.0", + "jupyter>=1.0.0", + "sphinx>=3.3.0", + "nbsphinx>=0.8.0", + "sphinxcontrib-bibtex>1.0.0", + "sphinx-tabs>=1.3.0", + "matplotlib>=3.3.2", + ] +extras = ["scikit-learn>=0.23.2", + "statsmodels>=0.12.1", + "jinja2>=2.11.2", + ] +opencl = ["pyopencl>=2020.2.2"] +cuda = ["pycuda>=2020.1"] +tests = ["pytest", + "nixio>=1.5.0", + ] +tutorials = ["matplotlib>=3.3.2", + "h5py>=3.1.0", + "nixio>=1.5.0", + ] + [project.urls] Homepage = "http://python-elephant.org" From 3ea8531233cfbdb08987ddf4ebc66ad9824a7627 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Tue, 21 Nov 2023 14:11:46 +0100 Subject: [PATCH 03/62] added build-system --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d920f3925..bfab98903 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + [project] name = "elephant" dynamic = ["version"] @@ -49,7 +53,6 @@ tutorials = ["matplotlib>=3.3.2", "nixio>=1.5.0", ] - [project.urls] Homepage = "http://python-elephant.org" Documentation = "https://elephant.readthedocs.io/en/latest/" From f9199d1a9b3ee37607c71b20f78f2c5746713c42 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Tue, 21 Nov 2023 14:50:18 +0100 Subject: [PATCH 04/62] fix formatting --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bfab98903..4114874a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,8 +21,7 @@ classifiers = ["Development Status :: 5 - Production/Stable", authors = [{name = "Elephant authors and contributors", email = "contact@python-elephant.org"}] readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">= 3.8" -dependencies = [ - "neo>=0.10.0", +dependencies = ["neo>=0.10.0", "numpy>=1.19.5", "quantities>=0.14.1", "scipy>=1.5.4", @@ -60,5 +59,5 @@ Repository = "https://github.com/NeuralEnsemble/elephant" Issues = "https://github.com/NeuralEnsemble/elephant/issues" Changelog = "https://github.com/NeuralEnsemble/elephant/releases" -# This file was created follwing this guide: +# This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml \ No newline at end of file From 444a7c37d34ddab07732b6567316f7991712809e Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Tue, 21 Nov 2023 15:35:51 +0100 Subject: [PATCH 05/62] build fim module using setup.py --- pyproject.toml | 3 +++ setup.py | 50 +------------------------------------------------- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4114874a6..7cd5aaa01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,5 +59,8 @@ Repository = "https://github.com/NeuralEnsemble/elephant" Issues = "https://github.com/NeuralEnsemble/elephant/issues" Changelog = "https://github.com/NeuralEnsemble/elephant/releases" +[tool.setuptools.dynamic] +version = {file = "elephant/VERSION"} + # This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml \ No newline at end of file diff --git a/setup.py b/setup.py index a5abae0ed..f4e3a50fa 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -import os.path import platform import sys @@ -7,19 +5,6 @@ from setuptools.command.install import install from setuptools.command.develop import develop -with open(os.path.join(os.path.dirname(__file__), - "elephant", "VERSION")) as version_file: - version = version_file.read().strip() - -with open("README.md") as f: - long_description = f.read() -with open('requirements/requirements.txt') as fp: - install_requires = fp.read().splitlines() -extras_require = {} -for extra in ['extras', 'docs', 'tests', 'tutorials', 'cuda', 'opencl']: - with open('requirements/requirements-{0}.txt'.format(extra)) as fp: - extras_require[extra] = fp.read() - if platform.system() == "Windows": fim_module = Extension( name='elephant.spade_src.fim', @@ -62,40 +47,7 @@ optional=True ) -setup_kwargs = { - "name": "elephant", - "version": version, - "packages": ['elephant', 'elephant.test'], - "include_package_data": True, - "install_requires": install_requires, - "extras_require": extras_require, - "author": "Elephant authors and contributors", - "author_email": "contact@python-elephant.org", - "description": "Elephant is a package for analysis of electrophysiology data in Python", # noqa - "long_description": long_description, - "long_description_content_type": "text/markdown", - "license": "BSD", - "url": 'http://python-elephant.org', - "project_urls": { - "Bug Tracker": "https://github.com/NeuralEnsemble/elephant/issues", - "Documentation": "https://elephant.readthedocs.io/en/latest/", - "Source Code": "https://github.com/NeuralEnsemble/elephant", - }, - "python_requires": ">=3.8", - "classifiers": [ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3 :: Only', - 'Topic :: Scientific/Engineering'] -} +setup_kwargs = {} # no compile options and corresponding extensions options = {"--no-compile": None, "--no-compile-spade": fim_module} From 9952f5cbb9810f8030eb116d10d7c5a2e043f045 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 11:24:07 +0100 Subject: [PATCH 06/62] remove description from CITATION.txt, leave reference to docs --- CITATION.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CITATION.txt b/CITATION.txt index c3423bb41..5a029b43b 100644 --- a/CITATION.txt +++ b/CITATION.txt @@ -1,4 +1 @@ -To refer to the Elephant software package in publications, please use - Elephant (RRID:SCR_003833) - To cite Elephant, please see doc/citation.rst. From 2053676c25fcb12fffaa835143623b93c9ae3bc8 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 11:24:27 +0100 Subject: [PATCH 07/62] fix formatting of pyproject.toml --- pyproject.toml | 83 ++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7cd5aaa01..88a3c39ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,50 +7,55 @@ name = "elephant" dynamic = ["version"] description = "Elephant is a package for analysis of electrophysiology data in Python" license = {file = "LICENSE.txt"} -classifiers = ["Development Status :: 5 - Production/Stable", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Scientific/Engineering"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering"] authors = [{name = "Elephant authors and contributors", email = "contact@python-elephant.org"}] readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">= 3.8" -dependencies = ["neo>=0.10.0", - "numpy>=1.19.5", - "quantities>=0.14.1", - "scipy>=1.5.4", - "six>=1.10.0", - "tqdm", - ] +dependencies = [ + "neo>=0.10.0", + "numpy>=1.19.5", + "quantities>=0.14.1", + "scipy>=1.5.4", + "six>=1.10.0", + "tqdm"] [project.optional-dependencies] -docs = ["numpydoc>=1.1.0", - "jupyter>=1.0.0", - "sphinx>=3.3.0", - "nbsphinx>=0.8.0", - "sphinxcontrib-bibtex>1.0.0", - "sphinx-tabs>=1.3.0", - "matplotlib>=3.3.2", - ] -extras = ["scikit-learn>=0.23.2", - "statsmodels>=0.12.1", - "jinja2>=2.11.2", - ] -opencl = ["pyopencl>=2020.2.2"] -cuda = ["pycuda>=2020.1"] -tests = ["pytest", - "nixio>=1.5.0", - ] -tutorials = ["matplotlib>=3.3.2", - "h5py>=3.1.0", - "nixio>=1.5.0", - ] +docs = [ + "numpydoc>=1.1.0", + "jupyter>=1.0.0", + "sphinx>=3.3.0", + "nbsphinx>=0.8.0", + "sphinxcontrib-bibtex>1.0.0", + "sphinx-tabs>=1.3.0", + "matplotlib>=3.3.2"] + +extras = [ + "scikit-learn>=0.23.2", + "statsmodels>=0.12.1", + "jinja2>=2.11.2"] + +opencl = [ + "pyopencl>=2020.2.2"] +cuda = [ + "pycuda>=2020.1"] +tests = [ + "pytest", + "nixio>=1.5.0"] +tutorials = [ + "matplotlib>=3.3.2", + "h5py>=3.1.0", + "nixio>=1.5.0"] [project.urls] Homepage = "http://python-elephant.org" From 51fe31e3144062edd72a822787013347fb1a87a6 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 11:48:12 +0100 Subject: [PATCH 08/62] use requirement files for dependencies --- pyproject.toml | 46 +++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 88a3c39ab..de8a54895 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "elephant" -dynamic = ["version"] +dynamic = [ + "version", + "dependencies", + "optional-dependencies"] description = "Elephant is a package for analysis of electrophysiology data in Python" license = {file = "LICENSE.txt"} classifiers = [ @@ -22,40 +25,15 @@ classifiers = [ authors = [{name = "Elephant authors and contributors", email = "contact@python-elephant.org"}] readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">= 3.8" -dependencies = [ - "neo>=0.10.0", - "numpy>=1.19.5", - "quantities>=0.14.1", - "scipy>=1.5.4", - "six>=1.10.0", - "tqdm"] -[project.optional-dependencies] -docs = [ - "numpydoc>=1.1.0", - "jupyter>=1.0.0", - "sphinx>=3.3.0", - "nbsphinx>=0.8.0", - "sphinxcontrib-bibtex>1.0.0", - "sphinx-tabs>=1.3.0", - "matplotlib>=3.3.2"] +[tool.setuptools.dynamic.optional-dependencies] -extras = [ - "scikit-learn>=0.23.2", - "statsmodels>=0.12.1", - "jinja2>=2.11.2"] - -opencl = [ - "pyopencl>=2020.2.2"] -cuda = [ - "pycuda>=2020.1"] -tests = [ - "pytest", - "nixio>=1.5.0"] -tutorials = [ - "matplotlib>=3.3.2", - "h5py>=3.1.0", - "nixio>=1.5.0"] +docs = {file = ["requirements/requirements-docs.txt"]} +extras = {file = ["requirements/requirements-extras.txt"]} +opencl = {file = ["requirements/requirements-opencl.txt"]} +cuda = {file = ["requirements/requirements-cuda.txt"]} +tests = {file = ["requirements/requirements-tests.txt"]} +tutorials = {file = ["requirements/requirements-tutorials.txt"]} [project.urls] Homepage = "http://python-elephant.org" @@ -66,6 +44,8 @@ Changelog = "https://github.com/NeuralEnsemble/elephant/releases" [tool.setuptools.dynamic] version = {file = "elephant/VERSION"} +dependencies = {file = ["requirements/requirements.txt"]} + # This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml \ No newline at end of file From 60933ee61da9be013c0d68f789cd1df489fc74c0 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 12:16:03 +0100 Subject: [PATCH 09/62] add somesy config --- pyproject.toml | 62 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 17 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index de8a54895..69205c7cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,29 +5,28 @@ build-backend = "setuptools.build_meta" [project] name = "elephant" dynamic = [ - "version", - "dependencies", - "optional-dependencies"] + "version", + "dependencies", + "optional-dependencies"] description = "Elephant is a package for analysis of electrophysiology data in Python" license = {file = "LICENSE.txt"} classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Scientific/Engineering"] + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering"] authors = [{name = "Elephant authors and contributors", email = "contact@python-elephant.org"}] readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">= 3.8" [tool.setuptools.dynamic.optional-dependencies] - docs = {file = ["requirements/requirements-docs.txt"]} extras = {file = ["requirements/requirements-extras.txt"]} opencl = {file = ["requirements/requirements-opencl.txt"]} @@ -46,6 +45,35 @@ Changelog = "https://github.com/NeuralEnsemble/elephant/releases" version = {file = "elephant/VERSION"} dependencies = {file = ["requirements/requirements.txt"]} - # This file was created following this guide: -# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml \ No newline at end of file +# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml + +[tool.somesy.project] +name = "Elephant" +version = "1.0.0" +description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." +license = "BSD" +keywords = [ + "neuroscience", + "neurophysiology", + "electrophysiology", + "statistics", + "data-analysis"] + +[[tool.somesy.project.people]] +given-names = "Michael" +family-names = "Denker" +orcid = "https://orcid.org/0000-0003-1255-7300" +author = true # is a full author of the project (i.e. appears in citations) +maintainer = true # currently maintains the project (i.e. is a contact person) + + +[[tool.somesy.project.people]] +given-names = "Moritz" +family-names = "Kern" +orcid = "https://orcid.org/0000-0001-7292-1982" +author = true # is a full author of the project (i.e. appears in citations) +maintainer = true # currently maintains the project (i.e. is a contact person) + +[tool.somesy.config] +verbose = true # show detailed information about what somesy is doing \ No newline at end of file From 210a994c88023928a81c9db7396a07fc5eb57324 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 15:18:03 +0100 Subject: [PATCH 10/62] update somesy config --- pyproject.toml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 69205c7cf..ba4760d9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,13 +3,13 @@ requires = ["setuptools >= 61.0"] build-backend = "setuptools.build_meta" [project] -name = "elephant" +name = "Elephant" dynamic = [ "version", "dependencies", "optional-dependencies"] -description = "Elephant is a package for analysis of electrophysiology data in Python" -license = {file = "LICENSE.txt"} +description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." +license = "BSD-3-Clause" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", @@ -22,7 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering"] -authors = [{name = "Elephant authors and contributors", email = "contact@python-elephant.org"}] +keywords = ["neuroscience", "neurophysiology", "electrophysiology", "statistics", "data-analysis"] readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">= 3.8" @@ -52,7 +52,7 @@ dependencies = {file = ["requirements/requirements.txt"]} name = "Elephant" version = "1.0.0" description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." -license = "BSD" +license = "BSD-3-Clause" keywords = [ "neuroscience", "neurophysiology", @@ -64,16 +64,14 @@ keywords = [ given-names = "Michael" family-names = "Denker" orcid = "https://orcid.org/0000-0003-1255-7300" -author = true # is a full author of the project (i.e. appears in citations) -maintainer = true # currently maintains the project (i.e. is a contact person) + [[tool.somesy.project.people]] given-names = "Moritz" family-names = "Kern" orcid = "https://orcid.org/0000-0001-7292-1982" -author = true # is a full author of the project (i.e. appears in citations) -maintainer = true # currently maintains the project (i.e. is a contact person) + [tool.somesy.config] verbose = true # show detailed information about what somesy is doing \ No newline at end of file From c7bfe259c871810b8c0d5cc1b478c4fa606adc0e Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 15:20:16 +0100 Subject: [PATCH 11/62] remove somesy config --- pyproject.toml | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ba4760d9b..ed23246b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools >= 61.0"] build-backend = "setuptools.build_meta" [project] -name = "Elephant" +name = "elephant" dynamic = [ "version", "dependencies", @@ -47,31 +47,3 @@ dependencies = {file = ["requirements/requirements.txt"]} # This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml - -[tool.somesy.project] -name = "Elephant" -version = "1.0.0" -description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." -license = "BSD-3-Clause" -keywords = [ - "neuroscience", - "neurophysiology", - "electrophysiology", - "statistics", - "data-analysis"] - -[[tool.somesy.project.people]] -given-names = "Michael" -family-names = "Denker" -orcid = "https://orcid.org/0000-0003-1255-7300" - - - -[[tool.somesy.project.people]] -given-names = "Moritz" -family-names = "Kern" -orcid = "https://orcid.org/0000-0001-7292-1982" - - -[tool.somesy.config] -verbose = true # show detailed information about what somesy is doing \ No newline at end of file From b8a9f80b2b635c64594e0a463288ce9208d2be42 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 15:29:29 +0100 Subject: [PATCH 12/62] update license field --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ed23246b5..559309ec4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ dynamic = [ "dependencies", "optional-dependencies"] description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." -license = "BSD-3-Clause" +license = {file = "LICENSE.txt"} classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", From f60257aa50cb82b8b969d9e3b3c8b2de12ff178e Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 15:48:10 +0100 Subject: [PATCH 13/62] add wheel to build dependencies --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 559309ec4..7f858a96f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 61.0"] +requires = ["setuptools >= 61.0", "wheel"] build-backend = "setuptools.build_meta" [project] From 0db66d482c10e072b0a949c12f0be0f98bec343b Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern Date: Wed, 22 Nov 2023 15:54:39 +0100 Subject: [PATCH 14/62] define packages for setuptools --- pyproject.toml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7f858a96f..b336a5cb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,13 @@ keywords = ["neuroscience", "neurophysiology", "electrophysiology", "statistics" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">= 3.8" +[project.urls] +Homepage = "http://python-elephant.org" +Documentation = "https://elephant.readthedocs.io/en/latest/" +Repository = "https://github.com/NeuralEnsemble/elephant" +Issues = "https://github.com/NeuralEnsemble/elephant/issues" +Changelog = "https://github.com/NeuralEnsemble/elephant/releases" + [tool.setuptools.dynamic.optional-dependencies] docs = {file = ["requirements/requirements-docs.txt"]} extras = {file = ["requirements/requirements-extras.txt"]} @@ -34,16 +41,13 @@ cuda = {file = ["requirements/requirements-cuda.txt"]} tests = {file = ["requirements/requirements-tests.txt"]} tutorials = {file = ["requirements/requirements-tutorials.txt"]} -[project.urls] -Homepage = "http://python-elephant.org" -Documentation = "https://elephant.readthedocs.io/en/latest/" -Repository = "https://github.com/NeuralEnsemble/elephant" -Issues = "https://github.com/NeuralEnsemble/elephant/issues" -Changelog = "https://github.com/NeuralEnsemble/elephant/releases" - [tool.setuptools.dynamic] version = {file = "elephant/VERSION"} dependencies = {file = ["requirements/requirements.txt"]} +[tool.setuptools] +packages = ["elephant", "elephant.test"] + + # This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml From f89e1cf3d2bfd968f057ae976b18fdb944df7382 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:41:34 +0200 Subject: [PATCH 15/62] remove setup.py --- pyproject.toml | 4 +++- setup.py => setup_old.py | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename setup.py => setup_old.py (100%) diff --git a/pyproject.toml b/pyproject.toml index b336a5cb2..e7fdbca51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,9 @@ dependencies = {file = ["requirements/requirements.txt"]} [tool.setuptools] packages = ["elephant", "elephant.test"] - +ext-modules = [ + {name = "elephant.spade_src.fim", sources = ["elephant/spade_src/src/fim.cpp"],include-dirs=["elephant/spade_src/include"],language="c++", extra-compile-args=["-DMODULE_NAME=fim", "-DUSE_OPENMP", "-DWITH_SIG_TERM","-Dfim_EXPORTS", "-fopenmp", "/std:c++17"], optional=true} +] # This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml diff --git a/setup.py b/setup_old.py similarity index 100% rename from setup.py rename to setup_old.py From db354a216659d6cbf077eb2558e2f51924682684 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:50:49 +0200 Subject: [PATCH 16/62] update ci build wheel action --- .github/workflows/build_wheels.yml | 4 ++-- .gitignore | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index b5dbea1f9..59fd62613 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -37,8 +37,8 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* pp*" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" + CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* cp38-* pp*" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" CIBW_ARCHS: "auto64" - uses: actions/upload-artifact@v3 diff --git a/.gitignore b/.gitignore index 6f6651146..f201f8a60 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,9 @@ env/ .pytest_cache/ **/*/__pycache__ *.vscode - +.mypy_cache +.ruff_cache +.venv # Compiled source # ################### *.a From d47ba190f939d0de305ce4bad2418f17710b5318 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:53:02 +0200 Subject: [PATCH 17/62] update build wheel action --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 59fd62613..151fd066f 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -37,8 +37,8 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* cp38-* pp*" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" + CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* cp38-* cp39-* pp*" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10" CIBW_ARCHS: "auto64" - uses: actions/upload-artifact@v3 From beab2e4e4359b8038964d6d800eebc54a6179860 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:55:02 +0200 Subject: [PATCH 18/62] update ci build wheel action --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 151fd066f..203699aa4 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -28,7 +28,7 @@ jobs: - name: Install cibuildwheel run: | python -m pip install --upgrade pip - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel - name: Install libomp if: runner.os == 'macOS' From b7e4fa097c9d921a3567d83d4cf9076153c06fb2 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:57:18 +0200 Subject: [PATCH 19/62] update cibuildwheel action --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 203699aa4..004c5c9dd 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -37,8 +37,8 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* cp38-* cp39-* pp*" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10" + CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* cp38-* cp39-* cp310-* pp*" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.11" CIBW_ARCHS: "auto64" - uses: actions/upload-artifact@v3 From f6a043fb5e48f8b843006c3cfaf92231a670eaa2 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:58:36 +0200 Subject: [PATCH 20/62] update os for building wheels --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 004c5c9dd..37e7d313c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019] + os: [ubuntu-latest, windows-2019] steps: - uses: actions/checkout@v4 From 24e225a1cd2a455b328d31e7be70d5b6142efab2 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:15:26 +0200 Subject: [PATCH 21/62] change compile args for linux --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e7fdbca51..0b35ca909 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,9 +46,9 @@ version = {file = "elephant/VERSION"} dependencies = {file = ["requirements/requirements.txt"]} [tool.setuptools] -packages = ["elephant", "elephant.test"] +packages = ["elephant", "elephant.test", "elephant.spade_src.src"] ext-modules = [ - {name = "elephant.spade_src.fim", sources = ["elephant/spade_src/src/fim.cpp"],include-dirs=["elephant/spade_src/include"],language="c++", extra-compile-args=["-DMODULE_NAME=fim", "-DUSE_OPENMP", "-DWITH_SIG_TERM","-Dfim_EXPORTS", "-fopenmp", "/std:c++17"], optional=true} + {name = "elephant.spade_src.fim", sources = ["elephant/spade_src/src/fim.cpp"],include-dirs=["elephant/spade_src/include"],language="c++",libraries=["pthread", "gomp"], extra-compile-args=['-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM','-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra','-Weffc++', '-Wunused-result', '-Werror','-fopenmp', '-std=gnu++17']} ] # This file was created following this guide: From 158aa29889f7038443a5aa66f326dda059fc38d8 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:17:36 +0200 Subject: [PATCH 22/62] update python version for cibuildwheels --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 37e7d313c..60ca08edc 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -37,8 +37,8 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* cp38-* cp39-* cp310-* pp*" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.11" + CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* pp*" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" CIBW_ARCHS: "auto64" - uses: actions/upload-artifact@v3 From 3533692bc02302731435869009230a531a8f0aaa Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:20:38 +0200 Subject: [PATCH 23/62] update ci buildwheel action --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 60ca08edc..d4a8127ac 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-2019] + os: [ubuntu-22.04, windows-2019] steps: - uses: actions/checkout@v4 @@ -37,7 +37,7 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* pp*" + CIBW_SKIP: cp36-* cp37-* pp*" CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" CIBW_ARCHS: "auto64" From d5b929f87689f651fef4ce26bba6c892467fe015 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:50:25 +0200 Subject: [PATCH 24/62] update compile args --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0b35ca909..ec53cfd0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,9 +46,9 @@ version = {file = "elephant/VERSION"} dependencies = {file = ["requirements/requirements.txt"]} [tool.setuptools] -packages = ["elephant", "elephant.test", "elephant.spade_src.src"] +packages = ["elephant", "elephant.test"] ext-modules = [ - {name = "elephant.spade_src.fim", sources = ["elephant/spade_src/src/fim.cpp"],include-dirs=["elephant/spade_src/include"],language="c++",libraries=["pthread", "gomp"], extra-compile-args=['-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM','-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra','-Weffc++', '-Wunused-result', '-Werror','-fopenmp', '-std=gnu++17']} + {name = "elephant.spade_src.fim", sources = ["elephant/spade_src/src/fim.cpp"],include-dirs=["elephant/spade_src/include"],language="c++", extra-compile-args=['-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM','-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra','-Weffc++', '-Wunused-result', '-Werror','-fopenmp', '-std=gnu++17']} ] # This file was created following this guide: From 77069b8d2f21883e203cc8744dc7be05898f62ec Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:07:48 +0200 Subject: [PATCH 25/62] re add setup.py --- pyproject.toml | 3 --- setup_old.py => setup.py | 0 2 files changed, 3 deletions(-) rename setup_old.py => setup.py (100%) diff --git a/pyproject.toml b/pyproject.toml index ec53cfd0c..bfc880eda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,9 +47,6 @@ dependencies = {file = ["requirements/requirements.txt"]} [tool.setuptools] packages = ["elephant", "elephant.test"] -ext-modules = [ - {name = "elephant.spade_src.fim", sources = ["elephant/spade_src/src/fim.cpp"],include-dirs=["elephant/spade_src/include"],language="c++", extra-compile-args=['-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM','-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra','-Weffc++', '-Wunused-result', '-Werror','-fopenmp', '-std=gnu++17']} -] # This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml diff --git a/setup_old.py b/setup.py similarity index 100% rename from setup_old.py rename to setup.py From 83de7f282a8a1366e4834a87b0cca9a9caa6ea70 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:09:39 +0200 Subject: [PATCH 26/62] update cibuildwheel version --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d4a8127ac..744eadb83 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -28,7 +28,7 @@ jobs: - name: Install cibuildwheel run: | python -m pip install --upgrade pip - python -m pip install cibuildwheel + python -m pip install cibuildwheel==2.20.0 - name: Install libomp if: runner.os == 'macOS' From c0b4899d072f647ec57f7ac559ab8c87b8f8f137 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:10:24 +0200 Subject: [PATCH 27/62] typo --- CITATION.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CITATION.txt b/CITATION.txt index 5a029b43b..3f12dc344 100644 --- a/CITATION.txt +++ b/CITATION.txt @@ -1 +1,4 @@ -To cite Elephant, please see doc/citation.rst. +To refer to the Elephant software package in publications, please use + Elephant (RRID:SCR_003833) + +To cite Elephant, please see doc/citation.rst. \ No newline at end of file From 571605d1644e1abf6e33e5074d1b25e710dcef87 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:11:40 +0200 Subject: [PATCH 28/62] typo --- CITATION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CITATION.txt b/CITATION.txt index 3f12dc344..c3423bb41 100644 --- a/CITATION.txt +++ b/CITATION.txt @@ -1,4 +1,4 @@ To refer to the Elephant software package in publications, please use Elephant (RRID:SCR_003833) -To cite Elephant, please see doc/citation.rst. \ No newline at end of file +To cite Elephant, please see doc/citation.rst. From 8140864da285074df3c8fa57549b1721fc5acdcc Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:20:06 +0200 Subject: [PATCH 29/62] build wheels --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index f4e3a50fa..9fc62c74b 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ extra_compile_args=[ '-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM', '-Dfim_EXPORTS', '-fopenmp', '/std:c++17'], - optional=True + #optional=True ) elif platform.system() == "Darwin": fim_module = Extension( @@ -30,7 +30,7 @@ '-Weffc++', '-Wunused-result', '-Werror', '-Werror=return-type', '-Xpreprocessor', '-fopenmp', '-std=gnu++17'], - optional=True + #optional=True ) elif platform.system() == "Linux": fim_module = Extension( @@ -44,7 +44,7 @@ '-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra', '-Weffc++', '-Wunused-result', '-Werror', '-fopenmp', '-std=gnu++17'], - optional=True + #optional=True ) setup_kwargs = {} From eebdb06687b17f44d990bd16dfb35e61505273a6 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:24:40 +0200 Subject: [PATCH 30/62] update python version --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 744eadb83..1a28f2d2c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -37,8 +37,8 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: cp36-* cp37-* pp*" - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" + CIBW_SKIP: cp36-* cp37-* cp38-* pp*" + CIBW_PROJECT_REQUIRES_PYTHON: ">3.8" CIBW_ARCHS: "auto64" - uses: actions/upload-artifact@v3 From 5c3fb6e2dcb898dadbf1f2b50e87812f6720e64c Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:30:36 +0200 Subject: [PATCH 31/62] update cibuildwheel --- .github/workflows/build_wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 1a28f2d2c..deaead7cb 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -28,7 +28,7 @@ jobs: - name: Install cibuildwheel run: | python -m pip install --upgrade pip - python -m pip install cibuildwheel==2.20.0 + python -m pip install cibuildwheel==2.21.0 - name: Install libomp if: runner.os == 'macOS' @@ -37,8 +37,8 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: cp36-* cp37-* cp38-* pp*" - CIBW_PROJECT_REQUIRES_PYTHON: ">3.8" + CIBW_SKIP: cp36-* cp37-* pp*" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" CIBW_ARCHS: "auto64" - uses: actions/upload-artifact@v3 From f77a62158b11f4e414282350b4e193eb6a5e56d1 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 21 Apr 2026 15:36:10 +0200 Subject: [PATCH 32/62] Removed wheels as build requirement. Wheels was historically listed, no longer needed according to setuptools doc pages, unless imported in setup.py --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bfc880eda..ffc701d0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools >= 61.0", "wheel"] +requires = ["setuptools >= 61.0"] build-backend = "setuptools.build_meta" [project] From 540e20f84ad841671c75f5407b251822aeeb9a59 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 22 Apr 2026 09:16:14 +0200 Subject: [PATCH 33/62] Replaced requirements.txt with dependencies in pyproject.toml, making pyproject.toml file the source of truth for dependencies --- pyproject.toml | 74 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ffc701d0d..d1f4c2363 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,14 +4,11 @@ build-backend = "setuptools.build_meta" [project] name = "elephant" -dynamic = [ - "version", - "dependencies", - "optional-dependencies"] +dynamic = ["version"] description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." license = {file = "LICENSE.txt"} classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", @@ -24,29 +21,66 @@ classifiers = [ "Topic :: Scientific/Engineering"] keywords = ["neuroscience", "neurophysiology", "electrophysiology", "statistics", "data-analysis"] readme = {file = "README.md", content-type = "text/markdown"} -requires-python = ">= 3.8" +requires-python = ">=3.8" -[project.urls] -Homepage = "http://python-elephant.org" -Documentation = "https://elephant.readthedocs.io/en/latest/" -Repository = "https://github.com/NeuralEnsemble/elephant" -Issues = "https://github.com/NeuralEnsemble/elephant/issues" -Changelog = "https://github.com/NeuralEnsemble/elephant/releases" +dependencies = [ + "neo>=0.10.0", + "numpy>=2.0.0", + "quantities>=0.14.1", + "scipy>=1.10.0", + "six>=1.10.0", + "tqdm", +] + +[project.optional-dependencies] +cuda = [ + "pycuda>=2020.1", # used in ASSET +] + +docs = [ + "numpydoc>=1.1.0", + "jupyter>=1.0.0", + "sphinx>=3.3.0", + "nbsphinx>=0.8.0", + "sphinxcontrib-bibtex>1.0.0", + "sphinx-tabs>=1.3.0", + "matplotlib>=3.3.2,<3.9.0", + "docutils<0.22", +] + +extras = [ + "scikit-learn>=0.23.2", + "statsmodels>=0.12.1", + "jinja2>=2.11.2", +] -[tool.setuptools.dynamic.optional-dependencies] -docs = {file = ["requirements/requirements-docs.txt"]} -extras = {file = ["requirements/requirements-extras.txt"]} -opencl = {file = ["requirements/requirements-opencl.txt"]} -cuda = {file = ["requirements/requirements-cuda.txt"]} -tests = {file = ["requirements/requirements-tests.txt"]} -tutorials = {file = ["requirements/requirements-tutorials.txt"]} +opencl = [ + "pyopencl>=2020.2.2", +] + +tests = [ + "pytest", + "nixio>=1.5.0", +] + +tutorials = [ + "matplotlib>=3.3.2,<3.9.0", + "h5py>=3.1.0", + "nixio>=1.5.0", +] [tool.setuptools.dynamic] version = {file = "elephant/VERSION"} -dependencies = {file = ["requirements/requirements.txt"]} [tool.setuptools] packages = ["elephant", "elephant.test"] +[project.urls] +Homepage = "http://python-elephant.org" +Documentation = "https://elephant.readthedocs.io/en/latest/" +Repository = "https://github.com/NeuralEnsemble/elephant" +Issues = "https://github.com/NeuralEnsemble/elephant/issues" +Changelog = "https://github.com/NeuralEnsemble/elephant/releases" + # This file was created following this guide: # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml From f26cb5fede428b28baffcecdae3ccc21ca95283a Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 22 Apr 2026 11:13:00 +0200 Subject: [PATCH 34/62] moved to new SPDX licence expression specified by PEP 639, removed legacy classifier string for licence --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d1f4c2363..d6fd87f73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,11 +6,11 @@ build-backend = "setuptools.build_meta" name = "elephant" dynamic = ["version"] description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." -license = {file = "LICENSE.txt"} +license = "BSD-3-Clause" +license-files = [ "LICENSE.txt"] classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", From 87de99ca151da07f45fc3c7404ddb9be473ab3bb Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 22 Apr 2026 11:18:08 +0200 Subject: [PATCH 35/62] Removed newline in desc as per warning from setuptools that newlines are not allowed in summary --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d6fd87f73..634e04b0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "elephant" dynamic = ["version"] -description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." +description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. Elephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." license = "BSD-3-Clause" license-files = [ "LICENSE.txt"] classifiers = [ From 13a2aec3355a28b628d197eb01cd4a8eafd90226 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 22 Apr 2026 14:17:53 +0200 Subject: [PATCH 36/62] replaced hardcoded package location with auto discovery using setuptools.find, this picks up (includes) subpackages ike asset etc. into wheels --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 634e04b0d..3fcfbf680 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,8 +72,10 @@ tutorials = [ [tool.setuptools.dynamic] version = {file = "elephant/VERSION"} -[tool.setuptools] -packages = ["elephant", "elephant.test"] +# Include source files; uses a flat layout +[tool.setuptools.packages.find] +where = ["."] +include = ["elephant*"] [project.urls] Homepage = "http://python-elephant.org" From 48f375b1b3996f619ed7f6cafeea9783485a0b5f Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 22 Apr 2026 14:25:39 +0200 Subject: [PATCH 37/62] Added option to include non py data in wheel using include-package-data --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3fcfbf680..90811ba0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,10 @@ version = {file = "elephant/VERSION"} where = ["."] include = ["elephant*"] +# Include package data as per MANIFEST.in +[tool.setuptools] +include-package-data = true + [project.urls] Homepage = "http://python-elephant.org" Documentation = "https://elephant.readthedocs.io/en/latest/" From 8e1e2e1e1a137af20c7b25d869d54e1c351ba738 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 22 Apr 2026 17:10:49 +0200 Subject: [PATCH 38/62] Reset option=True to continue install in case compilation fails --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 9fc62c74b..f4e3a50fa 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ extra_compile_args=[ '-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM', '-Dfim_EXPORTS', '-fopenmp', '/std:c++17'], - #optional=True + optional=True ) elif platform.system() == "Darwin": fim_module = Extension( @@ -30,7 +30,7 @@ '-Weffc++', '-Wunused-result', '-Werror', '-Werror=return-type', '-Xpreprocessor', '-fopenmp', '-std=gnu++17'], - #optional=True + optional=True ) elif platform.system() == "Linux": fim_module = Extension( @@ -44,7 +44,7 @@ '-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra', '-Weffc++', '-Wunused-result', '-Werror', '-fopenmp', '-std=gnu++17'], - #optional=True + optional=True ) setup_kwargs = {} From c46285c315212f9bbbc908a3444d7e5a8458b47c Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Sun, 17 May 2026 10:04:30 +0200 Subject: [PATCH 39/62] Added classifiers for newer python versions; Removed unused dependency six, was removed in an old commit 2333599 --- pyproject.toml | 4 +++- requirements/requirements.txt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90811ba0c..46713033f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,9 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering"] keywords = ["neuroscience", "neurophysiology", "electrophysiology", "statistics", "data-analysis"] @@ -28,7 +31,6 @@ dependencies = [ "numpy>=2.0.0", "quantities>=0.14.1", "scipy>=1.10.0", - "six>=1.10.0", "tqdm", ] diff --git a/requirements/requirements.txt b/requirements/requirements.txt index bdcdac60a..15f34e161 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -2,5 +2,4 @@ neo>=0.10.0 numpy>=2.0.0 quantities>=0.14.1 scipy>=1.10.0 -six>=1.10.0 tqdm From 92fe739e448cf7f720ebcbbea9d104a53a2e63dc Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Sun, 17 May 2026 12:48:56 +0200 Subject: [PATCH 40/62] Cleaned up triggers for CI.yml --- .github/workflows/CI.yml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 73ae47286..c7dba6f66 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,10 +1,10 @@ -# This workflow will set up GitHub-hosted runners and install the required dependencies for elephant tests. -# On a pull requests and on pushes to master it will run different tests for elephant. +# This workflow sets up GitHub runners and runs unit tests +# Triggered on pull requests, pushes to master and manual trigger from github web +# Triggers name: tests -# define events that trigger workflow 'tests' on: - workflow_dispatch: # enables manual triggering of workflow + workflow_dispatch: inputs: logLevel: description: 'Log level' @@ -20,23 +20,9 @@ on: branches: - master types: - #- assigned - #- unassigned - #- labeled - #- unlabeled - opened - #- edited - #- closed - reopened - synchronize - #- converted_to_draft - #- ready_for_review - #- locked - #- unlocked - #- review_requested - #- review_request_removed - #- auto_merge_enabled - #- auto_merge_disabled push: branches: From 942b758195249a4016df5c0d82b0cae03441d0f0 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Sun, 17 May 2026 20:59:40 +0200 Subject: [PATCH 41/62] Combined pip install and test for all OS jobs in CI.yml, relying on git bash as shell for windows --- .github/workflows/CI.yml | 175 ++++++--------------------------------- 1 file changed, 25 insertions(+), 150 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c7dba6f66..c1ed236e5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,7 +33,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -# jobs define the steps that will be executed on the runner jobs: # _ @@ -43,17 +42,17 @@ jobs: # | .__/|_| .__/ # |_| |_| - # install dependencies and elephant with pip and run tests with pytest build-and-test-pip: + name: pip (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - # python versions for elephant: [3.8, 3.9, "3.10", 3.11, 3.12, 3.13] - python-version: [3.9, "3.10", 3.11, 3.12, 3.13] - # OS [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] - # do not cancel all in-progress jobs if any matrix job fails - fail-fast: false + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + include: + - { os: macos-latest, python-version: "3.12" } + - { os: windows-latest, python-version: "3.12" } steps: - uses: actions/checkout@v4.1.6 @@ -64,13 +63,11 @@ jobs: python-version: ${{ matrix.python-version }} check-latest: true cache: 'pip' - cache-dependency-path: | - **/requirements.txt - **/requirements-extras.txt - **/requirements-tests.txt + cache-dependency-path: pyproject.toml - name: Get current hash (SHA) of the elephant_data repo id: elephant-data + shell: bash run: | echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT @@ -81,162 +78,40 @@ jobs: path: ~/elephant-data key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} restore-keys: datasets- - enableCrossOsArchive: true - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install coveralls - pip install -e .[extras,tests] + enableCrossOsArchive: true - - name: List packages - run: | - pip list - python --version - - - name: Test with pytest + - name: Export Data Location + shell: bash run: | if [ -d ~/elephant-data ]; then - export ELEPHANT_DATA_LOCATION=~/elephant-data - echo $ELEPHANT_DATA_LOCATION + ELEPHANT_DATA_LOCATION=~/elephant-data + echo "ELEPHANT_DATA_LOCATION=$ELEPHANT_DATA_LOCATION" >> $GITHUB_ENV + echo $ELEPHANT_DATA_LOCATION fi - - coverage run --source=elephant -m pytest - coveralls --service=github || echo "Coveralls submission failed" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # ___ ____ - # _ __ ___ __ _ ___ / _ \/ ___| - # | '_ ` _ \ / _` |/ __| | | \___ \ - # | | | | | | (_| | (__| |_| |___) | - # |_| |_| |_|\__,_|\___|\___/|____/ - - test-macOS: - name: conda (${{ matrix.python-version }}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - # do not cancel all in-progress jobs if any matrix job fails - fail-fast: false - matrix: - # OS [ubuntu-latest, macos-latest, windows-latest] - os: [macos-14,macos-15] - python-version: [3.12] - steps: - - name: Get current year-month - id: date - run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT - - - uses: actions/checkout@v4.1.6 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - cache: 'pip' - cache-dependency-path: | - **/requirements.txt - **/requirements-extras.txt - **/requirements-tests.txt - - - name: Get current hash (SHA) of the elephant_data repo - id: elephant-data - run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT - - - uses: actions/cache/restore@v4.2.2 - # Loading cache of elephant-data - id: cache-datasets - with: - path: ~/elephant-data - key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} - restore-keys: datasets- - name: Install dependencies run: | - python --version python -m pip install --upgrade pip - pip install pytest-cov coveralls + pip install coveralls pip install -e .[extras,tests] - name: List packages - shell: bash -l {0} run: | pip list python --version - name: Test with pytest - shell: bash -l {0} - run: | - if [ -d ~/elephant-data ]; then - export ELEPHANT_DATA_LOCATION=~/elephant-data - echo $ELEPHANT_DATA_LOCATION - fi - pytest --cov=elephant - - # __ ___ _ - # \ \ / (_)_ __ __| | _____ _____ - # \ \ /\ / /| | '_ \ / _` |/ _ \ \ /\ / / __| - # \ V V / | | | | | (_| | (_) \ V V /\__ \ - # \_/\_/ |_|_| |_|\__,_|\___/ \_/\_/ |___/ - - # install dependencies with pip and run tests with pytest - test-pip: - runs-on: ${{ matrix.os }} - strategy: - matrix: - # python versions for elephant: [3.8, 3.9, 3.10, 3.11] - python-version: [3.11,] - # OS [ubuntu-latest, macos-latest, windows-latest] - os: [windows-latest] - - steps: - - uses: actions/checkout@v4.1.6 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.1.0 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - cache: 'pip' - cache-dependency-path: | - **/requirements.txt - **/requirements-extras.txt - **/requirements-tests.txt - - - name: Get current hash (SHA) of the elephant_data repo - id: elephant-data - run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT - - - uses: actions/cache/restore@v4.2.2 - # Loading cache of elephant-data - id: cache-datasets - with: - path: ~/elephant-data - key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} - restore-keys: datasets- - enableCrossOsArchive: true - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest-cov coveralls - pip install -e .[extras,tests] - - - name: List packages - run: | - pip list - python --version + shell: bash + run: pytest + env: + ELEPHANT_DATA_LOCATION: ${{ env.ELEPHANT_DATA_LOCATION }} - - name: Test with pytest - run: | - if (Test-Path "$env:USERPROFILE\elephant-data") { - $env:ELEPHANT_DATA_LOCATION = "$env:USERPROFILE\elephant-data" - Write-Output $env:ELEPHANT_DATA_LOCATION - } - pytest --cov=elephant + - name: Submit Coveralls + if: runner.os == 'Linux' && matrix.python-version == '3.12' + run: coveralls --service=github || echo "Coveralls submission failed" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ELEPHANT_DATA_LOCATION: ${{ env.ELEPHANT_DATA_LOCATION }} # __ __ ____ ___ # | \/ | _ \_ _| From 4390c666f16f61df9f486a4de3bb4c44c4de131a Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Mon, 18 May 2026 14:44:23 +0200 Subject: [PATCH 42/62] Bumbed cache action restore to v5; removed redundant lines that set env vars --- .github/workflows/CI.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c1ed236e5..d56c2ea4c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -71,7 +71,7 @@ jobs: run: | echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT - - uses: actions/cache/restore@v4.2.2 + - uses: actions/cache/restore@v5 # Loading cache of elephant-data id: cache-datasets with: @@ -103,15 +103,12 @@ jobs: - name: Test with pytest shell: bash run: pytest - env: - ELEPHANT_DATA_LOCATION: ${{ env.ELEPHANT_DATA_LOCATION }} - name: Submit Coveralls if: runner.os == 'Linux' && matrix.python-version == '3.12' run: coveralls --service=github || echo "Coveralls submission failed" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ELEPHANT_DATA_LOCATION: ${{ env.ELEPHANT_DATA_LOCATION }} # __ __ ____ ___ # | \/ | _ \_ _| From f672f5a50e0e90cbad0072b52caabe89e5da351f Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 19 May 2026 11:10:07 +0200 Subject: [PATCH 43/62] Updated MPI job to use newer python version; Removed coverage for MPI job, as there is a race condition now with pip coverage (can later combine them with a job that combines coveralls reports); Moved dependency to toml file --- .github/workflows/CI.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d56c2ea4c..c344e9c8d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -121,12 +121,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - # python versions for elephant: [3.8, 3.9, 3.10, 3.11] - python-version: [3.9] - # OS [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.12"] os: [ubuntu-latest] - - # do not cancel all in-progress jobs if any matrix job fails fail-fast: false steps: @@ -138,10 +134,7 @@ jobs: python-version: ${{ matrix.python-version }} check-latest: true cache: 'pip' - cache-dependency-path: | - **/requirements.txt - **/requirements-extras.txt - **/requirements-tests.txt + cache-dependency-path: pyproject.toml - name: Get current hash (SHA) of the elephant_data repo id: elephant-data @@ -149,22 +142,19 @@ jobs: echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT - uses: actions/cache/restore@v4.2.2 - # Loading cache of elephant-data id: cache-datasets with: path: ~/elephant-data key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} restore-keys: datasets- - enableCrossOsArchive: true + enableCrossOsArchive: true - name: Setup environment run: | sudo apt-get update sudo apt install -y libopenmpi-dev openmpi-bin - python -m pip install --upgrade pip pip install mpi4py - pip install pytest-cov coveralls pip install -e .[extras,tests] - name: List packages @@ -178,8 +168,7 @@ jobs: export ELEPHANT_DATA_LOCATION=~/elephant-data echo $ELEPHANT_DATA_LOCATION fi - mpiexec -n 1 python -m mpi4py -m coverage run --source=elephant -m pytest - coveralls --service=github || echo "Coveralls submission failed" + mpiexec -n 1 python -m mpi4py -m pytest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 27ba18027050bc167ea5aa211ae2bd9eace16bec Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 19 May 2026 12:15:51 +0200 Subject: [PATCH 44/62] Replacing dataset restore steps in PIP job with a composite action that can be reused accross jobs --- .../actions/restore-elephant-data/action.yml | 35 +++++++++++++++++++ .github/workflows/CI.yml | 24 +------------ 2 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 .github/actions/restore-elephant-data/action.yml diff --git a/.github/actions/restore-elephant-data/action.yml b/.github/actions/restore-elephant-data/action.yml new file mode 100644 index 000000000..e801a4ed0 --- /dev/null +++ b/.github/actions/restore-elephant-data/action.yml @@ -0,0 +1,35 @@ +# Composite action: restore the elephant-data cache and set ELEPHANT_DATA_LOCATION. +name: Restore elephant-data cache +runs: + using: "composite" + steps: + - name: Get elephant_data hash + id: elephant-data + shell: bash + run: echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT + + - uses: actions/cache/restore@v5 + with: + path: ~/elephant-data + key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} + restore-keys: datasets- + enableCrossOsArchive: true + + - name: Export Data Location (Unix) + shell: bash + if: runner.os != 'Windows' + run: | + DATA_DIR="$HOME/elephant-data" + if [ -d "$DATA_DIR" ]; then + echo "ELEPHANT_DATA_LOCATION=$DATA_DIR" >> "$GITHUB_ENV" + echo "$DATA_DIR" + fi + + - name: Export Data Location (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + if (Test-Path "$env:USERPROFILE\elephant-data") { + "ELEPHANT_DATA_LOCATION=$env:USERPROFILE\elephant-data" >> $env:GITHUB_ENV + Write-Output $env:USERPROFILE\elephant-data + } diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c344e9c8d..a15cf172d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -65,29 +65,7 @@ jobs: cache: 'pip' cache-dependency-path: pyproject.toml - - name: Get current hash (SHA) of the elephant_data repo - id: elephant-data - shell: bash - run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT - - - uses: actions/cache/restore@v5 - # Loading cache of elephant-data - id: cache-datasets - with: - path: ~/elephant-data - key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} - restore-keys: datasets- - enableCrossOsArchive: true - - - name: Export Data Location - shell: bash - run: | - if [ -d ~/elephant-data ]; then - ELEPHANT_DATA_LOCATION=~/elephant-data - echo "ELEPHANT_DATA_LOCATION=$ELEPHANT_DATA_LOCATION" >> $GITHUB_ENV - echo $ELEPHANT_DATA_LOCATION - fi + - uses: ./.github/actions/restore-elephant-data - name: Install dependencies run: | From 8777e259db666edab139b6ccbaefe7e8d98cb379 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 19 May 2026 12:24:38 +0200 Subject: [PATCH 45/62] Temporarily keeping only one python version for pip job --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a15cf172d..adc16e0a5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10"] include: - { os: macos-latest, python-version: "3.12" } - { os: windows-latest, python-version: "3.12" } From b8bd6dd8228cda73153696cac6aa04e5f277c920 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 19 May 2026 13:52:19 +0200 Subject: [PATCH 46/62] Added viziphant to tutorials requirement --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 46713033f..31d5d0a10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,7 @@ tutorials = [ "matplotlib>=3.3.2,<3.9.0", "h5py>=3.1.0", "nixio>=1.5.0", + "viziphant", ] [tool.setuptools.dynamic] From 70cb229086ab5c3b437f528e32d30007bba7caf5 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 19 May 2026 15:09:36 +0200 Subject: [PATCH 47/62] Enable cross OS caching on dataset caching workflow --- .github/workflows/cache_elephant_data.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cache_elephant_data.yml b/.github/workflows/cache_elephant_data.yml index 833faef74..aa769b1de 100644 --- a/.github/workflows/cache_elephant_data.yml +++ b/.github/workflows/cache_elephant_data.yml @@ -29,6 +29,7 @@ jobs: with: path: ~/elephant-data key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} + enableCrossOsArchive: true - name: Cache found? run: echo "Cache-hit == ${{steps.cache-datasets.outputs.cache-hit == 'true'}}" From 3fd775b67580fb95bce7f0eb912a32b1ec2b6d01 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 20 May 2026 09:50:51 +0200 Subject: [PATCH 48/62] Added method to render error message in posix standard, so that test_download_with_cache_dir_with_failed_integrity_check catches it on windows as well --- elephant/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elephant/datasets.py b/elephant/datasets.py index fc8ebfc24..f91aed72a 100644 --- a/elephant/datasets.py +++ b/elephant/datasets.py @@ -370,7 +370,7 @@ def download_datasets(repo_path, filepath=None, checksum=None, if local_file.is_file(): # If a checksum is given, check integrity of the local file if checksum and not check_integrity(local_file, checksum): - raise ValueError(f"Local file at {local_file} does " + raise ValueError(f"Local file at {local_file.as_posix()} does " "not agree with MD5 hash " f"{checksum}.") From d29acc0cb9cdf215029fe6ff5191f71c3f0a0546 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 20 May 2026 10:34:30 +0200 Subject: [PATCH 49/62] Replacing dataset restore steps in MPI job with composite action --- .github/workflows/CI.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index adc16e0a5..0d9e63754 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -114,18 +114,7 @@ jobs: cache: 'pip' cache-dependency-path: pyproject.toml - - name: Get current hash (SHA) of the elephant_data repo - id: elephant-data - run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT - - - uses: actions/cache/restore@v4.2.2 - id: cache-datasets - with: - path: ~/elephant-data - key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} - restore-keys: datasets- - enableCrossOsArchive: true + - uses: ./.github/actions/restore-elephant-data - name: Setup environment run: | @@ -141,14 +130,7 @@ jobs: python --version - name: Test with pytest - run: | - if [ -d ~/elephant-data ]; then - export ELEPHANT_DATA_LOCATION=~/elephant-data - echo $ELEPHANT_DATA_LOCATION - fi - mpiexec -n 1 python -m mpi4py -m pytest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: mpiexec -n 1 python -m mpi4py -m pytest # ____ _ # / ___|___ _ __ __| | __ _ From f30bc3871bd4e2f31175a3e10aee0f096ae4c86a Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 20 May 2026 16:30:16 +0200 Subject: [PATCH 50/62] Replaced dataset restore in CONDA job with composite action; Also removed coveralls for CONDA job as it is runs almost same tests as MPI or PIP jobs --- .github/workflows/CI.yml | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0d9e63754..c7ccc1b17 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -138,17 +138,12 @@ jobs: # | |__| (_) | | | | (_| | (_| | # \____\___/|_| |_|\__,_|\__,_| - # install dependencies with conda and run tests with pytest test-conda: runs-on: ${{ matrix.os }} strategy: matrix: - # python versions for elephant: [3.8, 3.9, 3.10, 3.11] - python-version: [3.11] - # OS [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.12] os: [ubuntu-latest] - - # do not cancel all in-progress jobs if any matrix job fails fail-fast: false steps: @@ -170,19 +165,8 @@ jobs: key: ${{ runner.os }}-pip-${{hashFiles('requirements/environment-tests.yml') }}-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }} - - name: Get current hash (SHA) of the elephant_data repo - id: elephant-data - run: | - echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/elephant-data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT - - uses: actions/cache/restore@v4.2.2 - # Loading cache of elephant-data - id: cache-datasets - with: - path: ~/elephant-data - key: datasets-${{ steps.elephant-data.outputs.dataset_hash }} - restore-keys: datasets- - enableCrossOsArchive: true + - uses: ./.github/actions/restore-elephant-data - uses: mamba-org/setup-micromamba@v2 with: @@ -194,7 +178,7 @@ jobs: shell: bash -el {0} run: | python --version - micromamba install -y -c conda-forge pytest pytest-cov coveralls mpi4py openmpi + micromamba install -y -c conda-forge pytest mpi4py openmpi pip install -e . - name: List packages @@ -202,16 +186,10 @@ jobs: run: | pip list micromamba list - python --version - name: Test with pytest shell: bash -el {0} - run: | - if [ -d ~/elephant-data ]; then - export ELEPHANT_DATA_LOCATION=~/elephant-data - echo $ELEPHANT_DATA_LOCATION - fi - pytest --cov=elephant + run: pytest # ____ # | _ \ ___ ___ ___ From f3c6abd762cb71870969ad2bfac4387cc5202e6a Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Thu, 21 May 2026 09:22:05 +0200 Subject: [PATCH 51/62] Cleaned up DOC BUILD test job --- .../actions/restore-elephant-data/action.yml | 2 +- .github/workflows/CI.yml | 41 ++++--------------- 2 files changed, 9 insertions(+), 34 deletions(-) diff --git a/.github/actions/restore-elephant-data/action.yml b/.github/actions/restore-elephant-data/action.yml index e801a4ed0..dca0d099f 100644 --- a/.github/actions/restore-elephant-data/action.yml +++ b/.github/actions/restore-elephant-data/action.yml @@ -25,7 +25,7 @@ runs: echo "$DATA_DIR" fi - - name: Export Data Location (Windows) + - name: Export Data Location (Windows) if: runner.os == 'Windows' shell: pwsh run: | diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c7ccc1b17..a41bc5859 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -197,66 +197,41 @@ jobs: # | |_| | (_) | (__\__ \ # |____/ \___/ \___|___/ - # install dependencies for the documentation and build .html docs: name: docs (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: - # python versions for elephant: [3.8, 3.9, 3.10, 3.11, 3.12] python-version: [3.12] - # OS [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] steps: - - - name: Get current year-month - id: date - run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT - - uses: actions/checkout@v4.1.6 - - name: Get pip cache dir - id: pip-cache - run: | - echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - - - name: Cache pip - uses: actions/cache@v4.2.2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - # Look to see if there is a cache hit for the corresponding requirements files - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}-${{ hashFiles('**/requirements-tutorials.txt') }}-${{ hashFiles('**/environment-docs.yml') }} - -${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }} - - - uses: mamba-org/setup-micromamba@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5.1.0 with: - create-args: python=${{ matrix.python-version }} - environment-file: requirements/environment.yml - init-shell: bash + python-version: ${{ matrix.python-version }} + check-latest: true + cache: 'pip' + cache-dependency-path: pyproject.toml - name: Install dependencies shell: bash -el {0} run: | sudo apt-get update - sudo apt install -y libopenmpi-dev openmpi-bin - # Moved openmpi pandoc and libstdcxx-ng to environment-docs file - # micromamba install -y -c conda-forge openmpi pandoc libstdcxx-ng # fix libstdc++.so.6: version for new scipy versions > 1.9.1 - micromamba env update --file requirements/environment-docs.yml --name elephant + sudo apt install -y libopenmpi-dev openmpi-bin pandoc python -m pip install --upgrade pip + pip install mpi4py pip install -e .[extras,tutorials,docs] - # run notebooks sed -i -E "s/nbsphinx_execute *=.*/nbsphinx_execute = 'always'/g" doc/conf.py - name: List packages - shell: bash -el {0} run: | pip list - micromamba list python --version - name: make html - shell: bash -el {0} run: | cd doc make html From e49716a76253e18bb515777d6d8133b813ac332a Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Thu, 21 May 2026 16:17:09 +0200 Subject: [PATCH 52/62] Cleaned up DOC TEST job --- .github/workflows/CI.yml | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a41bc5859..c07b826c7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -236,60 +236,43 @@ jobs: cd doc make html - # install dependencies and elephant with pip and run tests with pytest +# _____ _______ _ +# | __ \ ___ ___ |__ __| ___| |_ ___ +# | | | |/ _ \ / __| | |/ _ \/ __| __/ __| +# | |__| | (_) | (__ | | __/\__ \ |_\__ \ +# |_____/ \___/ \___| |_|\___||___/\__|___/ doctests: runs-on: ${{ matrix.os }} strategy: matrix: - # python versions for elephant: [3.7, 3.8, 3.9, "3.10"] - python-version: ["3.10"] - - # OS [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.12"] os: [ubuntu-latest] steps: - # used to reset cache every month - - name: Get current year-month - id: date - run: echo "::set-output name=date::$(date +'%Y-%m')" - uses: actions/checkout@v4.1.6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5.1.0 with: python-version: ${{ matrix.python-version }} - - - name: Cache test_env - uses: actions/cache@v4.2.2 - with: - path: ~/test_env - # Look to see if there is a cache hit for the corresponding requirements files - # cache will be reset on changes to any requirements or every month - key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-tests.txt') }} - -${{ hashFiles('**/requirements-extras.txt') }}-${{ hashFiles('**/CI.yml') }}-${{ hashFiles('setup.py') }} - -${{ steps.date.outputs.date }} + check-latest: true + cache: 'pip' + cache-dependency-path: pyproject.toml - name: Install dependencies run: | - # create an environment and install everything - python -m venv ~/test_env - source ~/test_env/bin/activate sudo apt-get update sudo apt install -y libopenmpi-dev openmpi-bin - python -m pip install --upgrade pip pip install mpi4py - pip install pytest-cov coveralls pip install -e .[extras,tests] - name: List packages run: | - source ~/test_env/bin/activate pip list python --version - name: Run doctests run: | - source ~/test_env/bin/activate printf "def pytest_configure(config):\n import numpy as np\n import builtins\n np.set_printoptions(legacy='1.25')\n builtins.np = np\n" > conftest.py pytest elephant --doctest-modules --ignore=elephant/test/ From d3ca8a14b75fc7e3e93deba3f382c69536ad2554 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 26 May 2026 09:59:12 +0200 Subject: [PATCH 53/62] Reverting 540e20f, decided to use dynamic metadata for dependencies and optional dependencies, this avoids need of dedicated CI to check and maintain requirements files --- pyproject.toml | 55 ++++--------------------- requirements/requirements-tutorials.txt | 3 +- 2 files changed, 10 insertions(+), 48 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 31d5d0a10..1b02960cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "elephant" -dynamic = ["version"] +dynamic = ["version", "dependencies", "optional-dependencies"] description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. Elephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." license = "BSD-3-Clause" license-files = [ "LICENSE.txt"] @@ -26,54 +26,15 @@ keywords = ["neuroscience", "neurophysiology", "electrophysiology", "statistics" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.8" -dependencies = [ - "neo>=0.10.0", - "numpy>=2.0.0", - "quantities>=0.14.1", - "scipy>=1.10.0", - "tqdm", -] - -[project.optional-dependencies] -cuda = [ - "pycuda>=2020.1", # used in ASSET -] - -docs = [ - "numpydoc>=1.1.0", - "jupyter>=1.0.0", - "sphinx>=3.3.0", - "nbsphinx>=0.8.0", - "sphinxcontrib-bibtex>1.0.0", - "sphinx-tabs>=1.3.0", - "matplotlib>=3.3.2,<3.9.0", - "docutils<0.22", -] - -extras = [ - "scikit-learn>=0.23.2", - "statsmodels>=0.12.1", - "jinja2>=2.11.2", -] - -opencl = [ - "pyopencl>=2020.2.2", -] - -tests = [ - "pytest", - "nixio>=1.5.0", -] - -tutorials = [ - "matplotlib>=3.3.2,<3.9.0", - "h5py>=3.1.0", - "nixio>=1.5.0", - "viziphant", -] - [tool.setuptools.dynamic] version = {file = "elephant/VERSION"} +dependencies = {file = "requirements/requirements.txt"} +optional-dependencies.docs = {file = "requirements/requirements-docs.txt"} +optional-dependencies.extras = {file = "requirements/requirements-extras.txt"} +optional-dependencies.opencl = {file = "requirements/requirements-opencl.txt"} +optional-dependencies.cuda = {file = "requirements/requirements-cuda.txt"} +optional-dependencies.tests = {file = "requirements/requirements-tests.txt"} +optional-dependencies.tutorials = {file = "requirements/requirements-tutorials.txt"} # Include source files; uses a flat layout [tool.setuptools.packages.find] diff --git a/requirements/requirements-tutorials.txt b/requirements/requirements-tutorials.txt index 5c142ab15..e7b3f4e92 100644 --- a/requirements/requirements-tutorials.txt +++ b/requirements/requirements-tutorials.txt @@ -1,4 +1,5 @@ # Packages required to execute jupyter notebook tutorials matplotlib>=3.3.2, <3.9.0 h5py>=3.1.0 -nixio>=1.5.0 \ No newline at end of file +nixio>=1.5.0 +viziphant From d74fa8d9807706bbe58360b8e866ad2ba6042319 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 26 May 2026 12:26:39 +0200 Subject: [PATCH 54/62] Added a fast CI option, i.e. run a subset of job matrix --- .github/workflows/CI.yml | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c07b826c7..d9e289906 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,6 +24,10 @@ on: - reopened - synchronize + pull_request_review: + types: + - submitted + push: branches: - master @@ -33,8 +37,29 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# Single source of truth for CI matrix sizes. +# Fast CI: ubuntu-latest + 3.12 only. Full CI: all OS/Python combos. +env: + FAST_MATRIX: '{"os":["ubuntu-latest"],"python-version":["3.12"]}' + FULL_MATRIX: '{"os":["ubuntu-latest","macos-latest","windows-latest"],"python-version":["3.10","3.11","3.12","3.13","3.14"]}' + jobs: + # Selects fast or full matrix based on PR approval. + setup: + runs-on: ubuntu-latest + outputs: + pip-matrix: ${{ steps.pick.outputs.pip-matrix }} + steps: + - id: pick + run: | + if [[ "${{ github.event.action }}" == "submitted" && \ + "${{ github.event.review.state }}" == "approved" ]]; then + echo "pip-matrix=$FULL_MATRIX" >> $GITHUB_OUTPUT + else + echo "pip-matrix=$FAST_MATRIX" >> $GITHUB_OUTPUT + fi + # _ # _ __ (_)_ __ # | '_ \| | '_ \ @@ -43,16 +68,12 @@ jobs: # |_| |_| build-and-test-pip: + needs: setup name: pip (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false - matrix: - os: [ubuntu-latest] - python-version: ["3.10"] - include: - - { os: macos-latest, python-version: "3.12" } - - { os: windows-latest, python-version: "3.12" } + matrix: ${{ fromJSON(needs.setup.outputs.pip-matrix) }} steps: - uses: actions/checkout@v4.1.6 From 995a60d1ba56b29c9d99a60480fa672868bdbe36 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Tue, 26 May 2026 16:31:52 +0200 Subject: [PATCH 55/62] Made environment.yml files also depend on requirement files, except for system packages --- .github/workflows/CI.yml | 1 - requirements/environment-docs.yml | 19 +++++++------------ requirements/environment-tests.yml | 17 +++++------------ requirements/environment.yml | 14 ++++---------- 4 files changed, 16 insertions(+), 35 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d9e289906..9bd375b48 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -199,7 +199,6 @@ jobs: shell: bash -el {0} run: | python --version - micromamba install -y -c conda-forge pytest mpi4py openmpi pip install -e . - name: List packages diff --git a/requirements/environment-docs.yml b/requirements/environment-docs.yml index 48e9a2f57..8c89cb262 100644 --- a/requirements/environment-docs.yml +++ b/requirements/environment-docs.yml @@ -1,21 +1,16 @@ name: elephant channels: - - conda-forge # required for MPI + - conda-forge # required for MPI and pandoc dependencies: - - python=3.12 + - python>=3.9 + - mpi4py - openmpi - pandoc - libstdcxx-ng - - mpi4py - - numpy>=1.19.5 - - scipy - - tqdm - - scikit-learn - - statsmodels - - jinja2 - pip: - - neo>=0.10.0 - - viziphant - # neo, viziphant can be removed once it is integrated into requirements-tutorials.txt + - -r requirements.txt + - -r requirements-extras.txt + - -r requirements-docs.txt + - -r requirements-tutorials.txt diff --git a/requirements/environment-tests.yml b/requirements/environment-tests.yml index 508ed1030..0b20b75f8 100644 --- a/requirements/environment-tests.yml +++ b/requirements/environment-tests.yml @@ -4,17 +4,10 @@ channels: - conda-forge # required for MPI dependencies: - - python>=3.8 - + - python>=3.9 - mpi4py - - numpy>=1.19.5 - - scipy - - tqdm - - scikit-learn - - statsmodels - - jinja2 + - openmpi - pip: - - neo>=0.10.0 - - nixio>=1.5.0 - # - viziphant - # neo, viziphant can be removed once it is integrated into requirements-tutorials.txt + - -r requirements.txt + - -r requirements-extras.txt + - -r requirements-tests.txt diff --git a/requirements/environment.yml b/requirements/environment.yml index fa8fb6e1d..42e0bb4e6 100644 --- a/requirements/environment.yml +++ b/requirements/environment.yml @@ -4,15 +4,9 @@ channels: - conda-forge # required for MPI dependencies: - - python>=3.8 + - python>=3.9 - mpi4py - - numpy>=1.19.5, <2 - - scipy>=1.10.0 - - tqdm - - scikit-learn - - statsmodels - - jinja2 - pip: - - neo>=0.10.0 - - viziphant - # neo, viziphant can be removed once it is integrated into requirements-tutorials.txt + - -r requirements.txt + - -r requirements-extras.txt + - -r requirements-tutorials.txt From 7325493d879e41fc4768da4bebebc34022ba9fc7 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 27 May 2026 12:16:37 +0200 Subject: [PATCH 56/62] Added fix for RTD failure --- requirements/environment-docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/environment-docs.yml b/requirements/environment-docs.yml index 8c89cb262..ef95c6d02 100644 --- a/requirements/environment-docs.yml +++ b/requirements/environment-docs.yml @@ -4,7 +4,8 @@ channels: - conda-forge # required for MPI and pandoc dependencies: - - python>=3.9 + - python=3.12 # pinned cause >=3.13 breaks matplotlib<3.9 (RecursionError) + - pip # explicitly adding pip to ensure mamba uses env pip, not base one - mpi4py - openmpi - pandoc From 3427454856b7a108a284b39f8e72ac0d9483e100 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 27 May 2026 13:07:49 +0200 Subject: [PATCH 57/62] Updated CI jobs to each upload a coveralls report; Added a finish job to combine coveralls report; Added pytest-cov pluggin to req-test to avoid duplicated install statements in CI file; --- .github/workflows/CI.yml | 49 +++++++++++++++++++++++------ requirements/requirements-tests.txt | 1 + 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9bd375b48..f25726bdd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -91,7 +91,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install coveralls pip install -e .[extras,tests] - name: List packages @@ -101,13 +100,15 @@ jobs: - name: Test with pytest shell: bash - run: pytest + run: pytest --cov=elephant --cov-report=lcov:coverage.lcov - - name: Submit Coveralls - if: runner.os == 'Linux' && matrix.python-version == '3.12' - run: coveralls --service=github || echo "Coveralls submission failed" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: py${{ matrix.python-version }}-${{ matrix.os }} + parallel: true + file: coverage.lcov # __ __ ____ ___ # | \/ | _ \_ _| @@ -151,7 +152,15 @@ jobs: python --version - name: Test with pytest - run: mpiexec -n 1 python -m mpi4py -m pytest + run: mpiexec -n 1 python -m mpi4py -m pytest --cov=elephant --cov-report=lcov:coverage.lcov + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: mpi + parallel: true + file: coverage.lcov # ____ _ # / ___|___ _ __ __| | __ _ @@ -295,4 +304,26 @@ jobs: - name: Run doctests run: | printf "def pytest_configure(config):\n import numpy as np\n import builtins\n np.set_printoptions(legacy='1.25')\n builtins.np = np\n" > conftest.py - pytest elephant --doctest-modules --ignore=elephant/test/ + pytest elephant --doctest-modules --ignore=elephant/test/ --cov=elephant --cov-report=lcov:coverage.lcov + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: doctests + parallel: true + file: coverage.lcov + + + # Coveralls Finish Job + # Combine coverals report and make PR comment + coveralls-finish: + needs: [build-and-test-pip, test-pip-MPI, doctests] + if: always() + runs-on: ubuntu-latest + steps: + - name: Coveralls finished + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt index b74c40190..3c04d1616 100644 --- a/requirements/requirements-tests.txt +++ b/requirements/requirements-tests.txt @@ -1,2 +1,3 @@ pytest +pytest-cov nixio>=1.5.0 From 7abd07545704d59deeb78a3e1ec293c62a080b86 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Wed, 27 May 2026 13:38:59 +0200 Subject: [PATCH 58/62] Bumbed github action versions based on deprication warnings on worflow due to Node js issue --- .github/workflows/CI.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f25726bdd..e59c3ee0b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -76,10 +76,10 @@ jobs: matrix: ${{ fromJSON(needs.setup.outputs.pip-matrix) }} steps: - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: ${{ matrix.python-version }} check-latest: true @@ -126,10 +126,10 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: ${{ matrix.python-version }} check-latest: true @@ -181,7 +181,7 @@ jobs: id: date run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v6.0.2 - name: Get pip cache dir id: pip-cache @@ -189,7 +189,7 @@ jobs: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - name: Cache pip - uses: actions/cache@v4.2.2 + uses: actions/cache@v5.0.5 with: path: ${{ steps.pip-cache.outputs.dir }} @@ -198,7 +198,7 @@ jobs: - uses: ./.github/actions/restore-elephant-data - - uses: mamba-org/setup-micromamba@v2 + - uses: mamba-org/setup-micromamba@v3.0.0 with: create-args: python=${{ matrix.python-version }} environment-file: requirements/environment-tests.yml @@ -235,10 +235,10 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: ${{ matrix.python-version }} check-latest: true @@ -278,10 +278,10 @@ jobs: os: [ubuntu-latest] steps: - - uses: actions/checkout@v4.1.6 + - uses: actions/checkout@v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: ${{ matrix.python-version }} check-latest: true From e1a67f26031450aa33357718b7514a78631a4f29 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Thu, 28 May 2026 15:34:51 +0200 Subject: [PATCH 59/62] Added clause to setup job to filter out only approved cases for pull_request_review trigger; Made all other jobs dependent on setup job, so they are also skipped based on setup job --- .github/workflows/CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e59c3ee0b..d7b1c60a5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -48,6 +48,7 @@ jobs: # Selects fast or full matrix based on PR approval. setup: runs-on: ubuntu-latest + if: github.event_name != 'pull_request_review' || github.event.review.state == 'approved' outputs: pip-matrix: ${{ steps.pick.outputs.pip-matrix }} steps: @@ -118,6 +119,7 @@ jobs: # install dependencies and elephant with pip and run MPI test-pip-MPI: + needs: setup runs-on: ${{ matrix.os }} strategy: matrix: @@ -169,6 +171,7 @@ jobs: # \____\___/|_| |_|\__,_|\__,_| test-conda: + needs: setup runs-on: ${{ matrix.os }} strategy: matrix: @@ -227,6 +230,7 @@ jobs: # |____/ \___/ \___|___/ docs: + needs: setup name: docs (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: @@ -271,6 +275,7 @@ jobs: # | |__| | (_) | (__ | | __/\__ \ |_\__ \ # |_____/ \___/ \___| |_|\___||___/\__|___/ doctests: + needs: setup runs-on: ${{ matrix.os }} strategy: matrix: From 1dbc34d8795d16567eeb93cdf1be4dc23566d6db Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Thu, 28 May 2026 15:45:14 +0200 Subject: [PATCH 60/62] Fixed required python version based on review comments; This was an typo when migrating from setup.py --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1b02960cc..4256e5a9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Topic :: Scientific/Engineering"] keywords = ["neuroscience", "neurophysiology", "electrophysiology", "statistics", "data-analysis"] readme = {file = "README.md", content-type = "text/markdown"} -requires-python = ">=3.8" +requires-python = ">=3.9" [tool.setuptools.dynamic] version = {file = "elephant/VERSION"} From 4f5db9aeda805805614327adbad1ee80ed04991c Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Thu, 28 May 2026 15:49:46 +0200 Subject: [PATCH 61/62] Removed classifier for python 3.8; Added python 3.9 to full test suite --- .github/workflows/CI.yml | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d7b1c60a5..74ad87ae7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ concurrency: # Fast CI: ubuntu-latest + 3.12 only. Full CI: all OS/Python combos. env: FAST_MATRIX: '{"os":["ubuntu-latest"],"python-version":["3.12"]}' - FULL_MATRIX: '{"os":["ubuntu-latest","macos-latest","windows-latest"],"python-version":["3.10","3.11","3.12","3.13","3.14"]}' + FULL_MATRIX: '{"os":["ubuntu-latest","macos-latest","windows-latest"],"python-version":["3.9","3.10","3.11","3.12","3.13","3.14"]}' jobs: diff --git a/pyproject.toml b/pyproject.toml index 4256e5a9d..eb4c85a2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ classifiers = [ "Intended Audience :: Science/Research", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", From 8b0d97d8740ff6c5407a6f00fae28db245beb239 Mon Sep 17 00:00:00 2001 From: Harris Antony Jos Date: Mon, 1 Jun 2026 15:42:07 +0200 Subject: [PATCH 62/62] Updated names of CI tests for brevity and consistency --- .github/workflows/CI.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 74ad87ae7..4cb975a70 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -120,6 +120,7 @@ jobs: # install dependencies and elephant with pip and run MPI test-pip-MPI: needs: setup + name: mpi (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -172,6 +173,7 @@ jobs: test-conda: needs: setup + name: conda (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -231,7 +233,7 @@ jobs: docs: needs: setup - name: docs (${{ matrix.os }}) + name: docs (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: @@ -276,6 +278,7 @@ jobs: # |_____/ \___/ \___| |_|\___||___/\__|___/ doctests: needs: setup + name: doctests (${{ matrix.python-version }}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: matrix: