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

copy files instead of move to maintain original behavior #9

Merged
merged 3 commits into from
Jun 27, 2024
Merged
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
5 changes: 3 additions & 2 deletions caiman/source_extraction/cnmf/cnmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import logging
import numpy as np
import os
import shutil
import pathlib
import psutil
import scipy
Expand Down Expand Up @@ -388,14 +389,14 @@ def fit_file(self, motion_correct=False, indices=None, include_eval=False, outpu
os.remove(log_file)

if output_dir is not None:
# copy the result files to the specified output directory
output_dir = pathlib.Path(output_dir)
# move the result files to the specified output directory
files_to_move = [fname_new, fname_init_hdf5, fname_hdf5]
if motion_correct:
files_to_move += fname_mc
for f in files_to_move:
f = pathlib.Path(f)
os.rename(f, output_dir / f.name)
shutil.copy2(f, output_dir)

if return_mc & motion_correct:
return cnm2, mc
Expand Down
Loading