Skip to content

Commit 209cee6

Browse files
authored
Merge pull request #176 from SpikeInterface/numpy-support
Fixes for numpy 2.0
2 parents 38ba7b4 + 814c01b commit 209cee6

File tree

7 files changed

+22
-14
lines changed

7 files changed

+22
-14
lines changed

.github/workflows/python-package.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: ["ubuntu-latest"]
16-
python-version: ["3.10"]
16+
python-version: ["3.10", "3.12"]
1717
steps:
18-
- uses: actions/checkout@v2
19-
- uses: s-weigand/setup-conda@v1
18+
- uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
2021
with:
2122
python-version: ${{ matrix.python-version }}
22-
- name: Which conda/python
23+
- name: Which python
2324
run: |
24-
conda --version
2525
python --version
2626
- name: Install dependencies
2727
run: |
2828
pip install .[templates,test]
29+
pip install "zarr<3.0.0"
2930
- name: pip list
3031
run: |
3132
pip list

.github/workflows/python-publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
18-
- uses: s-weigand/setup-conda@v1
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
1920
with:
20-
python-version: "3.10"
21+
python-version: "3.11"
2122
- name: Which python
2223
run: |
23-
conda --version
24+
python --version
2425
- name: Install dependencies
2526
run: |
2627
pip install .[templates,test]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "MEArec"
3-
version = "1.9.1"
3+
version = "1.9.2"
44
authors = [
55
{ name="Alessio Buccino", email="[email protected]" },
66
]

readthedocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
version: 2
22

3+
sphinx:
4+
# Path to your Sphinx configuration file.
5+
configuration: docs/conf.py
6+
37
build:
48
os: ubuntu-22.04
59
tools:

src/MEArec/generators/spiketraingenerator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from copy import deepcopy
22

3-
import elephant.spike_train_generation as stg
4-
import elephant.statistics as stat
53
import neo
64
import numpy as np
75
import quantities as pq
@@ -129,6 +127,9 @@ def generate_spikes(self):
129127
Generate spike trains based on default_params of the SpikeTrainGenerator class.
130128
self.spiketrains contains the newly generated spike trains
131129
"""
130+
import elephant.spike_train_generation as stg
131+
import elephant.statistics as stat
132+
132133
if not self._has_spiketrains:
133134
self.spiketrains = []
134135
idx = 0

src/MEArec/tests/test_generators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from copy import deepcopy
55
from pathlib import Path
66

7-
import elephant.statistics as stat
87
import numpy as np
98
import yaml
109
from click.testing import CliRunner
@@ -198,6 +197,8 @@ def test_gen_templates_beta_distr(self):
198197
assert tempgen_drift_beta.templates.shape[0] == self.tempgen_drift.templates.shape[0]
199198

200199
def test_gen_spiketrains(self):
200+
import elephant.statistics as stat
201+
201202
print("Test spike train generation")
202203
rec_params = mr.get_default_recordings_params()
203204
sp_params = rec_params["spiketrains"]

src/MEArec/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ def clean_dict(d):
777777
def _clean_numpy_scalar(v):
778778
if isinstance(v, np.bool_):
779779
v = bool(v)
780-
if isinstance(v, np.float_):
780+
if isinstance(v, np.float64):
781781
v = float(v)
782782
if isinstance(v, np.int_):
783783
v = int(v)

0 commit comments

Comments
 (0)