Skip to content

Commit

Permalink
Initialize dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
cwindolf committed Oct 15, 2024
1 parent 19da675 commit 3421c8f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/dartsort/peel/peel_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,7 @@ def initialize_files(
)

if residual_to_h5:
if "residual" in output_h5:
pass
else:
if "residual" not in output_h5:
n_chans = self.recording.get_num_channels()
output_h5.create_dataset(
"residual",
Expand All @@ -696,6 +694,14 @@ def initialize_files(
maxshape=(None, self.spike_length_samples, n_chans),
chunks=(chunk_size, self.spike_length_samples, n_chans),
)
if "residual_times_seconds" not in output_h5:
output_h5.create_dataset(
"residual_times_seconds",
dtype=float,
shape=(0,),
maxshape=(None,),
chunks=(chunk_size,),
)

# residual file ignore/open/overwrite logic
save_residual = residual_filename is not None
Expand Down

0 comments on commit 3421c8f

Please sign in to comment.