Skip to content

Commit 89091de

Browse files
authored
Merge branch 'NeuralEnsemble:master' into typing
2 parents fa565f1 + 275e70b commit 89091de

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

.readthedocs.yaml

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

33
build:
4-
os: ubuntu-20.04
4+
os: ubuntu-22.04
55
tools:
6-
python: "3.8"
6+
python: "3.11"
77

88
sphinx:
99
configuration: doc/source/conf.py
@@ -14,4 +14,3 @@ python:
1414
path: .
1515
extra_requirements:
1616
- docs
17-

neo/core/analogsignal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def _repr_pretty_(self, pp, cycle):
417417
Handle pretty-printing the :class:`AnalogSignal`.
418418
'''
419419
pp.text(f"{self.__class__.__name__} with {self.shape[1]} channels of length "
420-
f"{self.shape[0]}; units {self.units.dimesionality.string}; datatype "
420+
f"{self.shape[0]}; units {self.units.dimensionality.string}; datatype "
421421
f"{self.dtype}")
422422
if self._has_repr_pretty_attrs_():
423423
pp.breakable()

neo/rawio/blackrockrawio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import os
6262
import re
6363
import warnings
64+
import math
6465

6566
import numpy as np
6667
import quantities as pq
@@ -646,7 +647,7 @@ def _get_timestamp_slice(self, timestamp, seg_index, t_start, t_stop):
646647
if t_start is None:
647648
ind_start = None
648649
else:
649-
ts = np.math.ceil(t_start * self.__nev_basic_header['timestamp_resolution'])
650+
ts = math.ceil(t_start * self.__nev_basic_header['timestamp_resolution'])
650651
ind_start = np.searchsorted(timestamp, ts)
651652

652653
if t_stop is None:

neo/rawio/plexon2rawio/plexon2rawio.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
"""
2424
import pathlib
2525
import warnings
26+
import platform
27+
2628
from collections import namedtuple
2729
from urllib.request import urlopen
2830
from datetime import datetime
@@ -74,14 +76,19 @@ def __init__(self, filename, pl2_dll_file_path=None):
7476

7577
# download default PL2 dll once if not yet available
7678
if pl2_dll_file_path is None:
77-
pl2_dll_folder = pathlib.Path .home() / '.plexon_dlls_for_neo'
79+
architecture = platform.architecture()[0]
80+
if architecture == '64bit' and platform.system() == 'Windows':
81+
file_name = "PL2FileReader64.dll"
82+
else: # Apparently wine uses the 32 bit version in linux
83+
file_name = "PL2FileReader.dll"
84+
pl2_dll_folder = pathlib.Path.home() / '.plexon_dlls_for_neo'
7885
pl2_dll_folder.mkdir(exist_ok=True)
79-
pl2_dll_file_path = pl2_dll_folder / 'PL2FileReader.dll'
86+
pl2_dll_file_path = pl2_dll_folder / file_name
87+
88+
if not pl2_dll_file_path.exists():
89+
url = f'https://raw.githubusercontent.com/Neuralensemble/pypl2/master/bin/{file_name}'
90+
dist = urlopen(url=url)
8091

81-
if pl2_dll_file_path.exists():
82-
warnings.warn(f'Using cached plexon dll at {pl2_dll_file_path}')
83-
else:
84-
dist = urlopen('https://raw.githubusercontent.com/Neuralensemble/pypl2/master/bin/PL2FileReader.dll')
8592
with open(pl2_dll_file_path, 'wb') as f:
8693
print(f'Downloading plexon dll to {pl2_dll_file_path}')
8794
f.write(dist.read())
@@ -288,7 +295,7 @@ def _get_signal_size(self, block_index, seg_index, stream_index):
288295
stream_id = self.header['signal_streams'][stream_index]['id']
289296
stream_characteristic = list(self.signal_stream_characteristics.values())[stream_index]
290297
assert stream_id == stream_characteristic.id
291-
return stream_characteristic.n_samples
298+
return int(stream_characteristic.n_samples) # Avoids returning a numpy.int64 scalar
292299

293300
def _get_signal_t_start(self, block_index, seg_index, stream_index):
294301
# This returns the t_start of signals as a float value in seconds

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ test = [
7070
]
7171

7272
docs = [
73-
"docutils<0.18",
73+
"docutils",
74+
"sphinx",
7475
"sphinx-inline-tabs",
7576
"sphinx-gallery",
7677
"pydata-sphinx-theme",

0 commit comments

Comments
 (0)