Currently, the method peak_local_max returns sorted indices (w.r.t. the intensities) if the number of indices is > num_peaks. I do understand that it is nowhere stated that peak_local_max does that, it is merely a side-effect, but I found it quite convenient.
Different behaviour arises when the number of indices <= num_peaks, in which case the indices are not sorted.
This is somewhat counter-intuitive and I therefore propose to make it the documented default to return indices sorted by their intensities in decreasing order.
I would be willing to write a PR for this.
Sounds like a good change. 👍 from me.
I think, this is a useful addition and shouldn't impact perfromance too much.
I've faced some problems recently when trying to use peak_local_max. I've asked a question on stackoverflow (http://stackoverflow.com/questions/41550022/typeerror-peak-local-max-got-an-unexpected-keyword-argument-num-peaks-per-la). Maybe some of you could take a quick look please ? Considering I'm a beginner, it's very likely that the function is fine and that I did something wrong, but still. Thank you (Edit : hi again, somebody pointed out I was just reading the wrong version of the documentation, sorry for disrupting)
Closed via #2435 .