Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Port MONAI Generative utils #7134

Merged
merged 17 commits into from
Oct 30, 2023
Merged

[WIP] Port MONAI Generative utils #7134

merged 17 commits into from
Oct 30, 2023

Conversation

marksgraham
Copy link
Contributor

@marksgraham marksgraham commented Oct 16, 2023

Towards completing #6676 .

Description

A few sentences describing the changes proposed in this pull request.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@marksgraham
Copy link
Contributor Author

@ericspod I'm getting mypy errors from unsqueeze_left and unsqueeze_right:

mypy 1.4.1 (compiled: yes)
monai/utils/misc.py:895:5: error: Returning Any from function declared to return "T"  [no-any-return]
monai/utils/misc.py:895:12: error: Value of type "object" is not indexable  [index]
monai/utils/misc.py:895:43: error: "T" has no attribute "ndim"  [attr-defined]
monai/utils/misc.py:900:5: error: Returning Any from function declared to return "T"  [no-any-return]
monai/utils/misc.py:900:12: error: Value of type "object" is not indexable  [index]
monai/utils/misc.py:900:34: error: "T" has no attribute "ndim"  [attr-defined]

so far they only operate on tensors - am I ok to type them specifally for tensors/np arrays to satisfy mypy?

@ericspod
Copy link
Member

am I ok to type them specifally for tensors/np arrays to satisfy mypy?

If you need to yes do that, but we do have NdarrayOrTensor.

marksgraham and others added 7 commits October 17, 2023 15:58
I, Mark Graham <[email protected]>, hereby add my Signed-off-by to this commit: 7aaeab0
I, Mark Graham <[email protected]>, hereby add my Signed-off-by to this commit: 2090549
I, Mark Graham <[email protected]>, hereby add my Signed-off-by to this commit: 94f57ac
I, Mark Graham <[email protected]>, hereby add my Signed-off-by to this commit: f94e666
I, Mark Graham <[email protected]>, hereby add my Signed-off-by to this commit: 1d95d92
I, Mark Graham <[email protected]>, hereby add my Signed-off-by to this commit: 355b4d9
I, Mark Graham <[email protected]>, hereby add my Signed-off-by to this commit: 92044d5

Signed-off-by: Mark Graham <[email protected]>
Signed-off-by: Mark Graham <[email protected]>
Copy link
Contributor

@KumoLiu KumoLiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, few minor comments inline.

monai/utils/enums.py Show resolved Hide resolved
tests/test_squeeze_unsqueeze.py Outdated Show resolved Hide resolved
@KumoLiu KumoLiu requested review from wyli and ericspod October 18, 2023 03:38
@marksgraham marksgraham marked this pull request as ready for review October 30, 2023 13:27
@wyli
Copy link
Contributor

wyli commented Oct 30, 2023

/build

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it looks good to me.

@wyli wyli enabled auto-merge (squash) October 30, 2023 15:34
@wyli wyli merged commit 83f5091 into Project-MONAI:dev Oct 30, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants