From a11dc41a94c7b04b08a49e3fb3761fa82e907882 Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:04:36 -0500 Subject: [PATCH 1/3] remove forbidden symbol in nwb --- neo/io/nwbio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/io/nwbio.py b/neo/io/nwbio.py index a37c1ed24..c1274a7b2 100644 --- a/neo/io/nwbio.py +++ b/neo/io/nwbio.py @@ -529,7 +529,7 @@ def _write_segment(self, nwbfile, segment, electrodes): signal.name = f"{segment.name} {signal.name} {i}" logging.warning(f"Warning signal name exists. New name: {signal.name}") else: - signal.name = f"{segment.name} : analogsignal{signal.name} {i}" + signal.name = f"{segment.name} analogsignal{signal.name} {i}" self._write_signal(self._nwbfile, signal, electrodes) for i, train in enumerate(segment.spiketrains): From ede2e73eb98e2546cd36ae3c07e20f329c39e6e2 Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:08:15 -0500 Subject: [PATCH 2/3] fix a few other examples of `:` --- neo/io/nwbio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neo/io/nwbio.py b/neo/io/nwbio.py index c1274a7b2..be62bda1f 100644 --- a/neo/io/nwbio.py +++ b/neo/io/nwbio.py @@ -536,7 +536,7 @@ def _write_segment(self, nwbfile, segment, electrodes): if train.segment is not segment: raise TypeError(f"train.segment must be segment and is {train.segment}") if not train.name: - train.name = f"{segment.name} : spiketrain{i}" + train.name = f"{segment.name} spiketrain{i}" self._write_spiketrain(self._nwbfile, train) for i, event in enumerate(segment.events): @@ -546,12 +546,12 @@ def _write_segment(self, nwbfile, segment, electrodes): event.name = f"{segment.name} {event.name} {i}" logging.warning(f"Warning event name exists. New name: {event.name}") else: - event.name = f"{segment.name} : event{event.name} {i}" + event.name = f"{segment.name} event{event.name} {i}" self._write_event(self._nwbfile, event) for i, epoch in enumerate(segment.epochs): if not epoch.name: - epoch.name = f"{segment.name} : epoch{i}" + epoch.name = f"{segment.name} epoch{i}" self._write_epoch(self._nwbfile, epoch) def _write_signal(self, nwbfile, signal, electrodes): From 5710acf67c3cd8728ff6fe10fec3aa23ceb1caed Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:19:13 -0500 Subject: [PATCH 3/3] One more colon --- neo/io/nwbio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/io/nwbio.py b/neo/io/nwbio.py index be62bda1f..b2ed49038 100644 --- a/neo/io/nwbio.py +++ b/neo/io/nwbio.py @@ -495,7 +495,7 @@ def _write_block(self, block): if segment.block is not block: raise TypeError(f"segment.block must be block it is {segment.block}") if not segment.name: - segment.name = f"{block.name} : segment{i}" + segment.name = f"{block.name} segment{i}" self._write_segment(self._nwbfile, segment, electrodes) self.blocks_written += 1