Skip to content

Commit 6eff3a3

Browse files
authored
Merge pull request #2901 from h-mayorquin/fix_save_to_folder_verbosity
Fix remaining verbose clashing
2 parents 5d69ec0 + d444511 commit 6eff3a3

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/spikeinterface/core/baserecording.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def time_to_sample_index(self, time_s, segment_index=None):
491491
rs = self._recording_segments[segment_index]
492492
return rs.time_to_sample_index(time_s)
493493

494-
def _save(self, format="binary", **save_kwargs):
494+
def _save(self, format="binary", verbose: bool = False, **save_kwargs):
495495
# handle t_starts
496496
t_starts = []
497497
has_time_vectors = []
@@ -510,7 +510,7 @@ def _save(self, format="binary", **save_kwargs):
510510
file_paths = [folder / f"traces_cached_seg{i}.raw" for i in range(self.get_num_segments())]
511511
dtype = kwargs.get("dtype", None) or self.get_dtype()
512512

513-
write_binary_recording(self, file_paths=file_paths, dtype=dtype, **job_kwargs)
513+
write_binary_recording(self, file_paths=file_paths, dtype=dtype, verbose=verbose, **job_kwargs)
514514

515515
from .binaryrecordingextractor import BinaryRecordingExtractor
516516

@@ -540,14 +540,18 @@ def _save(self, format="binary", **save_kwargs):
540540

541541
cached = SharedMemoryRecording.from_recording(self, **job_kwargs)
542542
else:
543+
from spikeinterface.core import NumpyRecording
544+
543545
cached = NumpyRecording.from_recording(self, **job_kwargs)
544546

545547
elif format == "zarr":
546548
from .zarrextractors import ZarrRecordingExtractor
547549

548550
zarr_path = kwargs.pop("zarr_path")
549551
storage_options = kwargs.pop("storage_options")
550-
ZarrRecordingExtractor.write_recording(self, zarr_path, storage_options, **kwargs, **job_kwargs)
552+
ZarrRecordingExtractor.write_recording(
553+
self, zarr_path, storage_options, verbose=verbose, **kwargs, **job_kwargs
554+
)
551555
cached = ZarrRecordingExtractor(zarr_path, storage_options)
552556

553557
elif format == "nwb":

src/spikeinterface/core/recording_tools.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def write_binary_recording(
7373
add_file_extension: bool = True,
7474
byte_offset: int = 0,
7575
auto_cast_uint: bool = True,
76-
verbose: bool = True,
76+
verbose: bool = False,
7777
**job_kwargs,
7878
):
7979
"""
@@ -100,7 +100,7 @@ def write_binary_recording(
100100
If True, unsigned integers are automatically cast to int if the specified dtype is signed
101101
.. deprecated:: 0.103, use the `unsigned_to_signed` function instead.
102102
verbose: bool
103-
If True, output is verbose
103+
This is the verbosity of the ChunkRecordingExecutor
104104
{}
105105
"""
106106
job_kwargs = fix_job_kwargs(job_kwargs)
@@ -351,9 +351,6 @@ def write_memory_recording(recording, dtype=None, verbose=False, auto_cast_uint=
351351
else:
352352
init_args = (recording, arrays, None, None, dtype, cast_unsigned)
353353

354-
if "verbose" in job_kwargs:
355-
del job_kwargs["verbose"]
356-
357354
executor = ChunkRecordingExecutor(
358355
recording, func, init_func, init_args, verbose=verbose, job_name="write_memory_recording", **job_kwargs
359356
)

0 commit comments

Comments
 (0)