Skip to content

Fix corner case in make_match_count_matrix() - #2191

Merged
alejoe91 merged 20 commits into
SpikeInterface:mainfrom
samuelgarcia:fix_compute_matching_v4
Nov 13, 2023
Merged

Fix corner case in make_match_count_matrix()#2191
alejoe91 merged 20 commits into
SpikeInterface:mainfrom
samuelgarcia:fix_compute_matching_v4

Conversation

@samuelgarcia

@samuelgarcia samuelgarcia commented Nov 10, 2023

Copy link
Copy Markdown
Member
  • Fix corner case in make_match_count_matrix()
  • Add symetric option and propagate in SymmetricSortingComparison/GroundTruthComparison
  • protect with index instead of frame

@alejoe91 alejoe91 added bug Something isn't working comparison Related to comparison module labels Nov 10, 2023

@zm711 zm711 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple docstring suggestions

Comment thread src/spikeinterface/comparison/comparisontools.py Outdated
Comment thread src/spikeinterface/comparison/comparisontools.py Outdated
Comment thread src/spikeinterface/comparison/comparisontools.py Outdated
Comment thread src/spikeinterface/comparison/comparisontools.py

@h-mayorquin h-mayorquin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/spikeinterface/comparison/comparisontools.py
Comment thread src/spikeinterface/comparison/comparisontools.py Outdated
num_units_train2,
delta_frames,
):
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to remove the docstring here? It is great that you added the other (my bad!) it here but is not like we are paying real state for docstrings here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, for me it was better for the higher function. This is why I moved it.
Having docstring here for function nested in another one will be never generated in the doc nor directly accessible. We can put it back maybe maybe not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point that I did not consider, but I have two points:

  • It is still useful for the developer reading the code.
  • I am taking your point that we should modify the way we are doing the numba functions here seriously. When we do that, I am expecting that we would be able to expose the docstrings again. And for that time, I would not like to have to urge the commit history to fetch it back.

Given that is costing nothing, would you mind leaving it just as it is? We can discuss this after the release and I can myself go and create another PR to remove if you want it. But I don't want to get this discussion get in the way of the release and I don't want to lose the docstring to the commit history either.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK done.

Comment thread src/spikeinterface/comparison/comparisontools.py Outdated

@h-mayorquin h-mayorquin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Actually at least leave the arguments of the docstring if you are very adamant about real state.

I put a lot effort writing that docstring

@zm711

zm711 commented Nov 10, 2023

Copy link
Copy Markdown
Member

Yeah. Actually at least leave the arguments of the docstring if you are very adamant about real state.

Agreed. It's super helpful to at least have arguments and returns in a docstring. I understand not wanting duplication or wanting to reduce lines, but knowing the ins and outs will help with development, but also with users sending in bug reports. Recently there was an issue with a function not accepting tuples when it's partner function only output tuples so knowing there was that disconnect would have found the issue earlier.

@samuelgarcia

Copy link
Copy Markdown
Member Author

@h-mayorquin : sorry for the removal of the docstring. For me it was an internal function. Maybe we can put doc everywhere.

@alejoe91 alejoe91 added this to the 0.99.1 milestone Nov 13, 2023
samuelgarcia and others added 9 commits November 13, 2023 10:10
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
Comment thread src/spikeinterface/comparison/comparisontools.py Outdated

@h-mayorquin h-mayorquin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine by me.

My final comment (feel free to ignore it) is that maybe the ensure_symmetry functionality should be in the make_agreement_scores as this function can't never really be symmetric and it makes more sense over there which is where you need the scores to be symmetric.

Comment thread src/spikeinterface/comparison/comparisontools.py Outdated
Comment thread src/spikeinterface/comparison/comparisontools.py Outdated
Co-authored-by: Heberto Mayorquin <h.mayorquin@gmail.com>
@alejoe91
alejoe91 merged commit 4e5d4b6 into SpikeInterface:main Nov 13, 2023
@samuelgarcia
samuelgarcia deleted the fix_compute_matching_v4 branch July 29, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working comparison Related to comparison module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants