Project-MONAI / Project-MONAI/MONAI
Incorrect type hint in `pad_func`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.7k
- Forks
- 1.6k
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 20
Description
Problem
The to_pad argument has type hint tuple[tuple[int, int]]. This means a tuple that contains a single tuple of 2 ints. We want to be able to pass a tuple for every dimension.
Proposed fix
Set type hint to Sequence[tuple[int, int]] instead.
Affected files
monai/transforms/croppad/functional.py (line 153)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open monai/transforms/croppad/functional.py at line 153 and inspect the to_pad annotation. Update the annotation so it represents one integer pair per dimension, then run the relevant project checks to confirm the accepted type and existing behavior remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100