Help: Correct the 'pvcollect' example function #4016
Merged
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.
Purpose and Motivation
b4b70b4 introduces a copy/paste error into the documentation for
pvcollect
.The function for this method should take the magnitude and phase for a single bin, and return either a new magnitude or a magnitude/phase pair for this bin only.
The revision adds an "example function" that takes
| magnitude, phase, bin, index |
as arguments but then returns[mags.reverse, phases.reverse]
.mags
andphases
are undeclared, so this will never work. Also, it's conceptually inconsistent.pvcollect
operate on individual bins, not on all of them at once:reverse
doesn't make sense in this context. But it does make sense forpvcalc
.The PR replaces the return with a simple per-bin randomizer.
Types of changes
Checklist
(It's a correction for a typo. The checklist is basically superfluous.)