-
Notifications
You must be signed in to change notification settings - Fork 190
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
Add Poisson statistics to generate_sorting
and optimize memory profile
#2226
Merged
alejoe91
merged 23 commits into
SpikeInterface:main
from
catalystneuro:improve_generate_sorting
Jan 22, 2024
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
64f70f7
working code
h-mayorquin 7b48621
improve this
h-mayorquin 4b9ebfb
Merge branch 'main' into improve_generate_sorting
h-mayorquin 1cec784
modify
h-mayorquin 79a383c
add docstring
h-mayorquin d8dc19e
final docstring
h-mayorquin 7720c04
one malloc less
h-mayorquin c647406
one last malloc
h-mayorquin d9886aa
name
h-mayorquin a1861e6
Merge branch 'main' into improve_generate_sorting
h-mayorquin 2f49b46
Update src/spikeinterface/core/basesorting.py
h-mayorquin 116355c
Update src/spikeinterface/core/generate.py
h-mayorquin 158a17b
Update src/spikeinterface/core/generate.py
h-mayorquin cc5a475
Update src/spikeinterface/core/generate.py
h-mayorquin ac41b95
improve docstring
h-mayorquin dcf2116
Aurelien feedback
h-mayorquin 492f5c6
go full binomial
h-mayorquin 6246869
poisson with dead times
h-mayorquin f71f634
Merge branch 'main' into improve_generate_sorting
h-mayorquin 20e73aa
fix docstring
h-mayorquin abb9538
docstring and fixes
h-mayorquin b0e579b
Merge branch 'main' into improve_generate_sorting
h-mayorquin db1568b
Update src/spikeinterface/qualitymetrics/tests/test_metrics_functions.py
h-mayorquin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
Any interest in this instead and then you can remove the ceil import from math? Or did you really only want to use math.ceil?
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.
What's the advantage of this?
Last time I checked the math module functions are faster for scalars than numpy function as they avoid the overhead. Speed won't matter that much at this scale though.
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.
Honestly, the only advantage for this scalar is that you import one less function into the code that is only used once. But reducing imports is not necessarily a good reason. So my comment was more question than hard recommendation.
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.
Last time I checked, even
math.PI
was faster thannp.PI
, which I still don't understand ahahI agree,
math
for scalars is betterThere 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.
@zm711 I see. Yes, importing from the standard library at will is my prior until proven otherwise.
Run the following script:
You will see that importing from the standard library is at the scale of main memory reference:
https://brenocon.com/dean_perf.html
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.
Thanks @h-mayorquin! Makes sense.