-
Notifications
You must be signed in to change notification settings - Fork 369
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
Scanbox format updates #1311
Scanbox format updates #1311
Conversation
…bxread in that file as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. I particularly like your type annotations style; might try out some of that with my own code because of how clean it looks. Left a few little comments.
caiman/base/movies.py
Outdated
import caiman.utils.visualization | ||
import caiman.utils.sbx_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we flip the order to keep these alphabetised?
caiman/base/movies.py
Outdated
return movie(sbxreadskip(file_name[:-4], subindices), fr=fr).astype(outtype) | ||
else: | ||
return movie(sbxread(file_name[:-4], k=0, n_frames=np.inf), fr=fr).astype(outtype) | ||
meta_data = caiman.utils.sbx_utils.sbx_meta_data(file_name[:-4]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a lot of code throughout the codebase that does this; eventually we'll want to convert them all to use os.path.splitext() instead of indexing into the string. When I fix them all I'll grep for stuff like this, so it's fine to leave this in (although if you want to adjust it yourself you can)
caiman/tests/test_sbx.py
Outdated
import os | ||
|
||
import numpy as np | ||
import numpy.testing as npt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we alphabetise these parts of the imports? (the caiman imports going later is fine
caiman/utils/sbx_utils.py
Outdated
import os | ||
import logging | ||
from typing import Iterable | ||
|
||
import numpy as np | ||
import scipy | ||
import tifffile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we alphabetise these imports?
@pgunn thank you! No problem, I changed sbx_utils as well to not directly slice the path name. |
Looking good, will merge once CI finishes. Thanks! |
Looks like the CI pipeline is currently busted because someone added an OpenGL dependency to opencv. I'll merge this and follow up with the OpenCV people separately. Thanks for the patch! |
@ethanbb Ah, I'm fixing CI now and it turns out CI found an issue with the code:
|
Hmm, do you know if this is a Python version issue? I did test it with Python 3.11 and it worked for me. |
Looks like this is 3.11-specific syntax; is there a chance you can, for now, rephrase it to be compatible back to 3.9? |
Yup, no problem. |
Description
utils
.Fixes #1299
Type of change
Please delete options that are not relevant.
Has your PR been tested?
Yes, tests for .sbx format added to
tests/test_sbx.py
, using example datafiles added totestdata
All tests passed with
caimanmanager test
.caimanmanager demotest
fails because of #1310.