From 63cb867d95b53dc3df73376babd0d360e7f5bd75 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Fri, 7 Feb 2025 17:15:44 +0100 Subject: [PATCH 1/5] Fixes for numpy 2.0 --- pyproject.toml | 2 +- src/MEArec/tools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8c29004..8e0f421 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "MEArec" -version = "1.9.1" +version = "1.9.2" authors = [ { name="Alessio Buccino", email="alessiop.buccino@gmail.com" }, ] diff --git a/src/MEArec/tools.py b/src/MEArec/tools.py index e59ce21..d0f5d3e 100755 --- a/src/MEArec/tools.py +++ b/src/MEArec/tools.py @@ -777,7 +777,7 @@ def clean_dict(d): def _clean_numpy_scalar(v): if isinstance(v, np.bool_): v = bool(v) - if isinstance(v, np.float_): + if isinstance(v, np.float64): v = float(v) if isinstance(v, np.int_): v = int(v) From dd7ad1c53ca9b610d63216b5a9a33202c021da1c Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Fri, 7 Feb 2025 17:17:28 +0100 Subject: [PATCH 2/5] Add sphinx-configuration --- readthedocs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readthedocs.yml b/readthedocs.yml index 24f60ba..c624001 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -1,5 +1,9 @@ version: 2 +sphinx: + # Path to your Sphinx configuration file. + configuration: docs/conf.py + build: os: ubuntu-22.04 tools: From 73d07dd3e2ec799be0bdf8ee0128345444a7d72e Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 12 Feb 2025 17:03:36 +0100 Subject: [PATCH 3/5] Make local imports for elephant --- src/MEArec/generators/spiketraingenerator.py | 5 +++-- src/MEArec/tests/test_generators.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/MEArec/generators/spiketraingenerator.py b/src/MEArec/generators/spiketraingenerator.py index 998fb51..cde62fc 100644 --- a/src/MEArec/generators/spiketraingenerator.py +++ b/src/MEArec/generators/spiketraingenerator.py @@ -1,7 +1,5 @@ from copy import deepcopy -import elephant.spike_train_generation as stg -import elephant.statistics as stat import neo import numpy as np import quantities as pq @@ -129,6 +127,9 @@ def generate_spikes(self): Generate spike trains based on default_params of the SpikeTrainGenerator class. self.spiketrains contains the newly generated spike trains """ + import elephant.spike_train_generation as stg + import elephant.statistics as stat + if not self._has_spiketrains: self.spiketrains = [] idx = 0 diff --git a/src/MEArec/tests/test_generators.py b/src/MEArec/tests/test_generators.py index f1aacfe..afe5af1 100644 --- a/src/MEArec/tests/test_generators.py +++ b/src/MEArec/tests/test_generators.py @@ -4,7 +4,6 @@ from copy import deepcopy from pathlib import Path -import elephant.statistics as stat import numpy as np import yaml from click.testing import CliRunner @@ -198,6 +197,8 @@ def test_gen_templates_beta_distr(self): assert tempgen_drift_beta.templates.shape[0] == self.tempgen_drift.templates.shape[0] def test_gen_spiketrains(self): + import elephant.statistics as stat + print("Test spike train generation") rec_params = mr.get_default_recordings_params() sp_params = rec_params["spiketrains"] From dbfbae3c811e6c1ded00bd5d08bae5ae450f15ae Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 12 Feb 2025 17:07:02 +0100 Subject: [PATCH 4/5] Fix test actions --- .github/workflows/python-package.yml | 10 +++++----- .github/workflows/python-publish.yml | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a840c0c..4b1919a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -13,15 +13,15 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.10"] + python-version: ["3.10", "3.12"] steps: - - uses: actions/checkout@v2 - - uses: s-weigand/setup-conda@v1 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Which conda/python + - name: Which python run: | - conda --version python --version - name: Install dependencies run: | diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 049e4a5..ff785c5 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -14,13 +14,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: s-weigand/setup-conda@v1 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - name: Which python run: | - conda --version + python --version - name: Install dependencies run: | pip install .[templates,test] From 814c01b0d9d1ad313e3e5dd215fbbeaaacdc61f4 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 12 Feb 2025 17:08:57 +0100 Subject: [PATCH 5/5] Fix test actions 2 --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4b1919a..84cc2f5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,6 +26,7 @@ jobs: - name: Install dependencies run: | pip install .[templates,test] + pip install "zarr<3.0.0" - name: pip list run: | pip list