|
3 | 3 | """ |
4 | 4 |
|
5 | 5 | from __future__ import annotations |
6 | | -from pathlib import Path |
7 | 6 | import numpy as np |
8 | 7 | import platform |
9 | 8 | import os |
10 | 9 | 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 |
12 | 11 |
|
13 | 12 | import sys |
14 | 13 | from tqdm.auto import tqdm |
@@ -369,27 +368,21 @@ def __init__( |
369 | 368 | self.max_threads_per_process = max_threads_per_process |
370 | 369 |
|
371 | 370 | 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 | + ) |
393 | 386 |
|
394 | 387 | def run(self): |
395 | 388 | """ |
|
0 commit comments