Skip to content

Commit 3833437

Browse files
committed
Merge branch 'main' of github.com:SpikeInterface/MEArec
2 parents 92346dc + 0f94775 commit 3833437

File tree

8 files changed

+37
-26
lines changed

8 files changed

+37
-26
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]

notebooks/generate_recordings_with_allen_models.ipynb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"import json\n",
3939
"import matplotlib.pylab as plt\n",
4040
"from pprint import pprint\n",
41-
"%matplotlib notebook"
41+
"\n",
42+
"%matplotlib inline"
4243
]
4344
},
4445
{
@@ -141,7 +142,11 @@
141142
" ax_xz = fig.add_subplot(2,2,2) \n",
142143
" ax_yz = fig.add_subplot(2,2,3) \n",
143144
" \n",
144-
" for i, (xs, xe, ys, ye, zs, ze) in enumerate(zip(cell.xstart, cell.xend, cell.ystart, cell.yend, cell.zstart, cell.zend)):\n",
145+
" for i in range(len(cell.x)):\n",
146+
" xs, xe = cell.x[i][0], cell.x[i][-1]\n",
147+
" ys, ye = cell.y[i][0], cell.y[i][-1]\n",
148+
" zs, ze = cell.z[i][0], cell.z[i][-1]\n",
149+
" \n",
145150
" if i in cell.get_idx('soma'):\n",
146151
" ax_xy.plot([xs, xe], [ys, ye], color='k', lw=5)\n",
147152
" ax_xz.plot([xs, xe], [zs, ze], color='k', lw=5)\n",
@@ -585,9 +590,7 @@
585590
{
586591
"cell_type": "code",
587592
"execution_count": null,
588-
"metadata": {
589-
"scrolled": false
590-
},
593+
"metadata": {},
591594
"outputs": [],
592595
"source": [
593596
"ax_st = mr.plot_rasters(recgen.spiketrains)\n",
@@ -628,9 +631,9 @@
628631
"name": "python",
629632
"nbconvert_exporter": "python",
630633
"pygments_lexer": "ipython3",
631-
"version": "3.8.13"
634+
"version": "3.12.9"
632635
}
633636
},
634637
"nbformat": 4,
635-
"nbformat_minor": 2
638+
"nbformat_minor": 4
636639
}

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: 6 additions & 6 deletions
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)
@@ -3098,7 +3098,7 @@ def plot_templates(
30983098
else:
30993099
colors = plt.rcParams["axes.prop_cycle"].by_key()["color"]
31003100

3101-
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
3101+
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())
31023102

31033103
for i_n, n in enumerate(template_ids):
31043104
r = i_n // ncols
@@ -3318,7 +3318,7 @@ def plot_waveforms(
33183318
nrows = 1
33193319
ncols = n_units
33203320

3321-
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
3321+
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())
33223322

33233323
for i, wf in enumerate(waveforms):
33243324
r = i // ncols
@@ -3336,7 +3336,7 @@ def plot_waveforms(
33363336
nrows = 1
33373337
ncols = len(spiketrain_id)
33383338

3339-
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
3339+
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())
33403340

33413341
# find ylim
33423342
min_wf = 0
@@ -3488,7 +3488,7 @@ def plot_amplitudes(
34883488
nrows = 1
34893489
ncols = n_units
34903490

3491-
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
3491+
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())
34923492

34933493
for i_n, n in enumerate(spiketrain_id):
34943494
r = i_n // ncols
@@ -3626,7 +3626,7 @@ def plot_pca_map(
36263626

36273627
nrows = len(pc_dims) * len(elec_dims)
36283628
ncols = nrows
3629-
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax)
3629+
gs = gridspec.GridSpecFromSubplotSpec(nrows, ncols, subplot_spec=ax.get_subplotspec())
36303630

36313631
for p1 in pc_dims:
36323632
for i1, ch1 in enumerate(elec_dims):

0 commit comments

Comments
 (0)