Skip to content

Commit 73c8f07

Browse files
authored
Merge pull request #2892 from h-mayorquin/verbose_to_non_parallel_case
Enable verbose of `ChunkRecordingExecutor` also for non parallel case
2 parents b25460f + eb03db8 commit 73c8f07

1 file changed

Lines changed: 16 additions & 23 deletions

File tree

src/spikeinterface/core/job_tools.py

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
"""
44

55
from __future__ import annotations
6-
from pathlib import Path
76
import numpy as np
87
import platform
98
import os
109
import warnings
11-
from spikeinterface.core.core_tools import convert_string_to_bytes
10+
from spikeinterface.core.core_tools import convert_string_to_bytes, convert_bytes_to_str, convert_seconds_to_str
1211

1312
import sys
1413
from tqdm.auto import tqdm
@@ -369,27 +368,21 @@ def __init__(
369368
self.max_threads_per_process = max_threads_per_process
370369

371370
if verbose:
372-
if self.n_jobs > 1:
373-
chunk_memory = self.chunk_size * recording.get_num_channels() * np.dtype(recording.get_dtype()).itemsize
374-
total_memory = chunk_memory * self.n_jobs
375-
chunk_duration = self.chunk_size / recording.get_sampling_frequency()
376-
from spikeinterface.core.core_tools import convert_bytes_to_str, convert_seconds_to_str
377-
378-
chunk_memory_str = convert_bytes_to_str(chunk_memory)
379-
total_memory_str = convert_bytes_to_str(total_memory)
380-
chunk_duration_str = convert_seconds_to_str(chunk_duration)
381-
print(
382-
self.job_name,
383-
"\n"
384-
f"n_jobs={self.n_jobs} - "
385-
f"samples_per_chunk={self.chunk_size:,} - "
386-
f"chunk_memory={chunk_memory_str} - "
387-
f"total_memory={total_memory_str} - "
388-
f"chunk_duration={chunk_duration_str}",
389-
)
390-
391-
else:
392-
print(self.job_name, "with n_jobs =", self.n_jobs, "and chunk_size =", self.chunk_size)
371+
chunk_memory = self.chunk_size * recording.get_num_channels() * np.dtype(recording.get_dtype()).itemsize
372+
total_memory = chunk_memory * self.n_jobs
373+
chunk_duration = self.chunk_size / recording.get_sampling_frequency()
374+
chunk_memory_str = convert_bytes_to_str(chunk_memory)
375+
total_memory_str = convert_bytes_to_str(total_memory)
376+
chunk_duration_str = convert_seconds_to_str(chunk_duration)
377+
print(
378+
self.job_name,
379+
"\n"
380+
f"n_jobs={self.n_jobs} - "
381+
f"samples_per_chunk={self.chunk_size:,} - "
382+
f"chunk_memory={chunk_memory_str} - "
383+
f"total_memory={total_memory_str} - "
384+
f"chunk_duration={chunk_duration_str}",
385+
)
393386

394387
def run(self):
395388
"""

0 commit comments

Comments
 (0)