Project-MONAI / Project-MONAI/MONAI

Incorrect type hint in `pad_func`

Open Beginner friendly
#9,026 0 comments 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.