Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iterate only plane folders in suite2p dir #860

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading