Project-MONAI / Project-MONAI/MONAI

Rename `Transpose` to `Permute` to Reflect Behaviour

Open
#4,863 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feedback welcomed need discussions
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

Is your feature request related to a problem? Please describe.
The Transpose and Transposed transforms actually permute based on the axes given to them, they don't just swap dimensions 0 and 1 as the name implies. A transform created as such for 2D data mt.Transpose((0, 1)) will appear to be a no-op even though it appears the users is specifying to transpose axes 0 and 1, mt.Transpose((1, 0)) is needed to get the desired effect because the argument is actually specifying what the permutation should be.

Describe the solution you'd like
Rename classes to Permute and Permuted with new classes inheriting from them with deprecation warnings.

Describe alternatives you've considered
The transforms work just fine.

Additional context
I was momentarily confused by the name so I suspect others have been as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Transpose and Transposed transform classes and inspect their tests and references in the repository. Rename the primary classes to Permute and Permuted, retain deprecated compatibility classes with warnings, and update coverage so the existing permutation behavior and deprecation path are verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.