Skip to content

Commit

Permalink
Fixes split calculation bug and updates setup and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
apasarkar committed Sep 15, 2023
1 parent ddd56fd commit 172ce41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Python package

on:
push:
branches: [ "dev*"]
branches: [ "main"]

jobs:
build:
Expand Down
5 changes: 3 additions & 2 deletions jnormcorre/motion_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
from functools import partial
import time

import random
import multiprocessing


Expand Down Expand Up @@ -2720,7 +2721,7 @@ def motion_correction_piecewise(fname, splits, strides, overlaps, add_to_movie=0
shape_mov = (np.prod(dims), T)
if num_splits is not None:
num_splits = min(num_splits, len(idxs))
idxs = np.array(idxs)[np.random.randint(0, len(idxs), num_splits)]
idxs = random.sample(idxs, num_splits)
save_movie = False

if save_movie:
Expand All @@ -2745,7 +2746,7 @@ def motion_correction_piecewise(fname, splits, strides, overlaps, add_to_movie=0
pars = []
for idx in idxs:
logging.debug('Processing: frames: {}'.format(idx))
pars.append([fname, fname_tot, idx, shape_mov, template, strides, overlaps, max_shifts, np.array(
pars.append([fname, fname_tot, np.array(idx), shape_mov, template, strides, overlaps, max_shifts, np.array(
add_to_movie, dtype=np.float32), max_deviation_rigid, upsample_factor_grid,
newoverlaps, newstrides, nonneg_movie, is_fiji, var_name_hdf5, indices, filter_kernel])

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
version="0.0.6",
description="Jax-accelerated implementation of normcorre",
packages=setuptools.find_packages(),
install_requires=["future","numpy", "scipy", "h5py", "tqdm", "matplotlib", "opencv-python", "tifffile", "typing", "torch", "pynwb", "pillow", "scikit-image", "jax", "jaxlib"],
install_requires=["future","numpy", "scipy", "h5py", "tqdm", "matplotlib", "opencv-python", "tifffile", "typing", "torch", "pynwb", "pillow", "scikit-image", "jax", "jaxlib", "pytest"],
classifiers=(
"Programming Language :: Python :: 3",
),
Expand Down

0 comments on commit 172ce41

Please sign in to comment.