MAINT,ENH: Rename all dispatchers as well as possible #21667
Closed
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.
This is a bit of a call and various decisions could be made.
In some cases, I simply duplicated dispatchers to get the rigth name
(there is no other way to rename the function).
In other cases, I attempted to find a somewhat decent name (without
underscore) that at least gives a better idea than having
_dispatcher
in there.I tried to standardize the two most common ones to
unary_operation
and
binary_operation
.It may be possible to auto-copy the function and replace the name
in the decorator. In general (if there is a custom decorator), I think
using the same name is probably best.
I do not have a strong opinion about the cases where dispatchers are
used multiple times though. E.g. when to duplicate and when not.
As a reminder, this fixes (mostly) the problem that:
gives:
which I think is potentially confusing to users. It thus mostly addreses gh-21647.
@shoyer since this was originally your work, could you have a look/review this?
(I am happy about other ideas, or at least reducing it to only fix places where the dispatcher is defined directly before the function.)
The following symbols have dispatcher names that do not match and are not either
unary_operation
orbinary_operation
: