Skip to content

[WIP] Port MONAI Generative utils - #7134

Merged
wyli merged 17 commits into
Project-MONAI:devfrom
marksgraham:6676_port_generative_utils
Oct 30, 2023
Merged

wyli merged 17 commits into
Project-MONAI:devfrom
marksgraham:6676_port_generative_utils

Conversation

@marksgraham

@marksgraham marksgraham commented Oct 16, 2023 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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 <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: 7aaeab0
I, Mark Graham <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: 2090549
I, Mark Graham <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: 94f57ac
I, Mark Graham <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: f94e666
I, Mark Graham <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: 1d95d92
I, Mark Graham <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: 355b4d9
I, Mark Graham <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: 92044d5

Signed-off-by: Mark Graham <markgraham539@gmail.com>
Signed-off-by: Mark Graham <markgraham539@gmail.com>

@KumoLiu KumoLiu left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread monai/utils/enums.py
Comment thread tests/test_squeeze_unsqueeze.py Outdated
@KumoLiu
KumoLiu requested review from ericspod and wyli October 18, 2023 03:38
Signed-off-by: Mark Graham <markgraham539@gmail.com>
I, Mark Graham <markgraham539@gmail.com>, hereby add my Signed-off-by to this commit: f71fda0

Signed-off-by: Mark Graham <markgraham539@gmail.com>
Comment thread monai/utils/component_store.py
Signed-off-by: Mark Graham <markgraham539@gmail.com>
@marksgraham
marksgraham marked this pull request as ready for review October 30, 2023 13:27
Signed-off-by: Mark Graham <markgraham539@gmail.com>
@wyli

wyli commented Oct 30, 2023

Copy link
Copy Markdown
Contributor

/build

@wyli wyli left a comment

Copy link
Copy Markdown
Contributor

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
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