Skip to content

Commit

Permalink
iterate only plane folders in suite2p dir
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Oct 8, 2024
1 parent 0a7a59e commit 6a4e5f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ibllib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import warnings

__version__ = '2.38.0'
__version__ = '2.39.rc1'
warnings.filterwarnings('always', category=DeprecationWarning, module='ibllib')

# if this becomes a full-blown library we should let the logging configuration to the discretion of the dev
Expand Down
9 changes: 3 additions & 6 deletions ibllib/pipes/mesoscope_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,20 +353,17 @@ def _rename_outputs(self, suite2p_dir, frameQC_names, frameQC, rename_dict=None)
'spks.npy': 'mpci.ROIActivityDeconvolved.npy',
'Fneu.npy': 'mpci.ROINeuropilActivityF.npy'
}
for plane_dir in suite2p_dir.iterdir():
# ignore the combined dir
if plane_dir.name == 'combined':
continue
for plane_dir in self._get_plane_paths(suite2p_dir):
# Move bin file(s) out of the way
bin_files = list(plane_dir.rglob('data*.bin')) # e.g. data.bin, data_raw.bin, data_chan2_raw.bin
bin_files = list(plane_dir.glob('data*.bin')) # e.g. data.bin, data_raw.bin, data_chan2_raw.bin
if any(bin_files):
(bin_files_dir := self.session_path.joinpath('raw_bin_files', plane_dir.name)).mkdir(parents=True, exist_ok=True)
_logger.debug('Moving bin file(s) to %s', bin_files_dir.relative_to(self.session_path))
for bin_file in bin_files:
dst = bin_files_dir.joinpath(bin_file.name)
bin_file.replace(dst)
# copy ops file for lazy re-runs
shutil.copy(plane_dir.joinpath('ops.npy'), dst.with_name('ops.npy'))
shutil.copy(plane_dir.joinpath('ops.npy'), bin_files_dir.joinpath('ops.npy'))
# Archive the raw suite2p output before renaming
n = int(plane_dir.name.split('plane')[1])
fov_dir = self.session_path.joinpath('alf', f'FOV_{n:02}')
Expand Down

0 comments on commit 6a4e5f8

Please sign in to comment.