Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Nov 8, 2024
1 parent a28c33d commit 67b055b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/spikeinterface/core/job_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@


job_keys = (
"pool_engine",
"n_jobs",
"total_memory",
"chunk_size",
Expand Down Expand Up @@ -292,6 +293,8 @@ class ChunkRecordingExecutor:
gather_func : None or callable, default: None
Optional function that is called in the main thread and retrieves the results of each worker.
This function can be used instead of `handle_returns` to implement custom storage on-the-fly.
pool_engine : "process" | "thread"
If n_jobs>1 then use ProcessPoolExecutor or ThreadPoolExecutor
n_jobs : int, default: 1
Number of jobs to be used. Use -1 to use as many jobs as number of cores
total_memory : str, default: None
Expand Down Expand Up @@ -383,6 +386,7 @@ def __init__(
print(
self.job_name,
"\n"
f"engine={self.pool_engine} - "
f"n_jobs={self.n_jobs} - "
f"samples_per_chunk={self.chunk_size:,} - "
f"chunk_memory={chunk_memory_str} - "
Expand Down Expand Up @@ -458,14 +462,9 @@ def run(self, recording_slices=None):
if self.gather_func is not None:
self.gather_func(res)


else:
raise ValueError("If n_jobs>1 pool_engine must be 'process' or 'thread'")





return returns


Expand Down
2 changes: 0 additions & 2 deletions src/spikeinterface/core/tests/test_job_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ def init_func(arg1, arg2, arg3):

def test_ChunkRecordingExecutor():
recording = generate_recording(num_channels=2)
# make serializable
recording = recording.save()

init_args = "a", 120, "yep"

Expand Down

0 comments on commit 67b055b

Please sign in to comment.