Skip to content

Commit e8b130f

Browse files
authored
Merge branch 'master' into fix-onebox-adc
2 parents d51dab7 + 5e3ccd9 commit e8b130f

File tree

5 files changed

+301
-283
lines changed

5 files changed

+301
-283
lines changed

neo/io/kwikio.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020
from neo.io.baseio import BaseIO
2121

2222
# to import from core
23-
from neo.core import Segment, SpikeTrain, AnalogSignal, Block, Group
23+
from neo.core import Segment, SpikeTrain, AnalogSignal, Block, Group, NeoReadWriteError
2424

25+
import importlib.metadata
26+
from packaging.version import Version, parse
27+
28+
numpy_version = parse(importlib.metadata.version('numpy'))
2529

2630
class KwikIO(BaseIO):
2731
"""
@@ -58,6 +62,12 @@ def __init__(self, filename):
5862
Arguments:
5963
filename : the filename
6064
"""
65+
66+
if numpy_version >= Version("2.3.0"):
67+
deprecation_msg = ("As the kwik package is no longer actively maintained it only works with NumPy < 2.3.0 and your environment "
68+
f"has {numpy_version}. Downgrade your NumPy version to use this IO")
69+
raise NeoReadWriteError(deprecation_msg)
70+
6171
from klusta import kwik
6272

6373
BaseIO.__init__(self)

neo/rawio/biocamrawio.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,10 @@ def generate_synthetic_noise(rf, data, well_ID, start_frame, num_frames):
460460
else:
461461
data[ch_idx] = np.array(np.random.normal(median_mean, median_std, num_frames), dtype=np.uint16)
462462

463+
# Assuming a 12-bit unsigned to signed conversion downstream, the baseline should read at 2048 raw
464+
# However, synthetic noise is generated with a baseline of 0, which requires an offset of + 2048
465+
# See issue #1743
466+
467+
data = data + 2048
468+
463469
return data

0 commit comments

Comments
 (0)