Skip to content

Commit 33d3592

Browse files
committed
verbose non parallel case
1 parent ce1deaf commit 33d3592

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
@@ -368,27 +367,21 @@ def __init__(
368367
self.max_threads_per_process = max_threads_per_process
369368

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

393386
def run(self):
394387
"""

0 commit comments

Comments
 (0)