Repository navigation
Add more VolPy tests - #1596
Merged
Merged
Add more VolPy tests#1596
Conversation
Author
|
The three checks failed in "Install OS Dependencies", before any tests ran. It looks like the same libglapi-mesa problem from #1593, so I don't think it's related to this change. @pgunn if it would save you some time, I'm happy to look at the CI image and send a small PR for it. Otherwise I'll re-run the checks here once it's fixed. |
Member
|
If you rebase that should get the tests going again hopefully |
Cover VOLPY.fit, the atm method, the threshold functions and reconstructed_movie
eeshaanjum
force-pushed
the
volpy-tests
branch
from
November 14, 2026 16:31
7012805 to
e667081
Compare
Member
|
Thanks! Solid work |
Author
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
#1587 added the first three VolPy tests, all on a single cell. This adds 24 more to
caiman/tests/test_volpy.py, and changes no code outside that file.What they cover:
VOLPY.fit()on a synthetic three-cell movie with negative-going spikes: each cell's own spikes are found,indexpicks a subset of cells, weights from a first run can be passed to a second, and a run on a multiprocessing pool matches a serial one.spikepursuit.volspike()withweight_update='NMF', the simple threshold, one iteration, an evencontext_sizeand a raisedmin_spikes, plus its two input errors.adaptive_thresh(),simple_thresh()anddenoise_spikes()on traces with known spikes.atm.volspike()and throughVOLPY, and its helper functions.reconstructed_movie()andvolparams.change_params().The tests run about 85% of the lines in spikepursuit.py and atm.py and 94% of volpy.py. What's left is mostly plotting. I didn't try to cover the GUI and Mask R-CNN code in utils.py.
Two things came up while writing these, and I've filed them separately instead of touching the code here:
VOLPY.fit()failing without arguments and atm rejecting the defaultweight_update. The tests work around them.adaptive_thresh()returning a threshold below every peak when spikes are far above the noise. Because of it the three-cell movie uses small spikes (5% of the cell's brightness). With 30% spikes the results changed from run to run.The three existing tests are unchanged, except that
test_volspike_detectionnow uses a sharedmatch_spikes()helper instead of its own loop.Type of change
None of the listed options fits. This only adds tests.
Branching
Targets
dev.Has your PR been tested?
Yes, on macOS 14.7 (Apple M1 Pro):
caimanmanager teston Python 3.12: 79 passed (51 before).test_volpy.pyon its own under Python 3.12, 3.11 and 3.9, several times each: 31 passed every time, in about 20 seconds.flip_signal, shrinking the context region, picking the wrong ROI, and so on). Each one was caught by at least one test.yapf --diffon the test file is clean.Everything was run on macOS, so I'll watch the Linux CI here. I didn't run
caimanmanager demotest, since nothing outside the test file changed.