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

Improve Compose encapsulation #6224

Merged
merged 33 commits into from
Mar 30, 2023
Merged

Improve Compose encapsulation #6224

merged 33 commits into from
Mar 30, 2023

Conversation

atbenmurray
Copy link
Contributor

Fixes #6223 .

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.

@wyli
Copy link
Member

wyli commented Mar 22, 2023

/black

@atbenmurray
Copy link
Contributor Author

@ericspod, @Nic-Ma, @rijobro, @wyli
I'm writing up the test extensions for this, but please take a look at the code changes when you have a moment. I'm essentially trying to eliminate the need for dataset.py to have to be updated by the lazy resampling changes coming up in #5860.

monai-bot and others added 3 commits March 22, 2023 14:06
Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
I, Ben Murray <ben.murray@gmail.com>, hereby add my Signed-off-by to this commit: 1759f96

Signed-off-by: Ben Murray <ben.murray@gmail.com>q:
I, Ben Murray <ben.murray@gmail.com>, hereby add my Signed-off-by to this commit: 1759f96

Signed-off-by: Ben Murray <ben.murray@gmail.com>
I, Ben Murray <ben.murray@gmail.com>, hereby add my Signed-off-by to this commit: 10edabd

Signed-off-by: Ben Murray <ben.murray@gmail.com>
…edataset_persistent_workers pass

Signed-off-by: Ben Murray <ben.murray@gmail.com>
@atbenmurray
Copy link
Contributor Author

Taking the opportunity boost the docstrings a little. It looks as if logging only does anything when the pipeline raises an exception of some kind, so the comment for that parameter should be updated, yes?

Signed-off-by: Ben Murray <ben.murray@gmail.com>
@wyli
Copy link
Member

wyli commented Mar 22, 2023

I think the refactoring makes sense, let me trigger some integration tests about multiprocessing

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Copy link
Member

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

the integration tests work fine, could you please revise the docstrings, and in my opinion we can merge this. more tests with Compose.execute would be great as well.

Copy link
Contributor

@Nic-Ma Nic-Ma left a comment

Choose a reason for hiding this comment

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

The change logic looks good to me, put minor comments inline.
Please complete the doc-strings and double-confirm the threading arg in the self.transform() function of every dataset class.

Thanks.

monai/transforms/compose.py Outdated Show resolved Hide resolved
monai/data/dataset.py Outdated Show resolved Hide resolved
@atbenmurray
Copy link
Contributor Author

@wyli @Nic-Ma what is the issue with the failure? Not sure what is causing it

@wyli
Copy link
Member

wyli commented Mar 24, 2023

@wyli @Nic-Ma what is the issue with the failure? Not sure what is causing it

those tests are optional and deprecating... please ignore

I, Ben Murray <ben.murray@gmail.com>, hereby add my Signed-off-by to this commit: 61f67e4

Signed-off-by: Ben Murray <ben.murray@gmail.com>
atbenmurray and others added 5 commits March 24, 2023 17:36
Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
@atbenmurray
Copy link
Contributor Author

atbenmurray commented Mar 28, 2023

If everyone is happy review-wise, I'll sort out the remaining reds in anticipation of a merge
@ericspod suggested that I make Compose.execute a function rather than having it as a class method, so I'll do that first before we review for merge.

@wyli
Copy link
Member

wyli commented Mar 28, 2023

If everyone is happy review-wise, I'll sort out the remaining reds in anticipation of a merge

please update the docstring of the datasets to clarify the implicit execution of pending operations during caching. otherwise this looks good to me.

… Documenting lazy resampling functionality and updating dataset docs to refer to it as per @wyli's request

Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
I, Ben Murray <ben.murray@gmail.com>, hereby add my Signed-off-by to this commit: 6bdedac

Signed-off-by: Ben Murray <ben.murray@gmail.com>
through list comprehension

Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
execute_compose.

Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
critical design flaw that needs fixing

Signed-off-by: Ben Murray <ben.murray@gmail.com>
code with an incorrect type

Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: Ben Murray <ben.murray@gmail.com>
@atbenmurray atbenmurray marked this pull request as ready for review March 30, 2023 09:35
@wyli
Copy link
Member

wyli commented Mar 30, 2023

/build

@wyli wyli enabled auto-merge (squash) March 30, 2023 13:30
@wyli wyli merged commit e4d48f0 into dev Mar 30, 2023
27 of 32 checks passed
@wyli wyli deleted the compose_refactor branch March 30, 2023 13:59
a-parida12 pushed a commit to a-parida12/MONAI that referenced this pull request Apr 3, 2023
Fixes Project-MONAI#6223 .

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [x] 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.

---------

Signed-off-by: Ben Murray <ben.murray@gmail.com>
Signed-off-by: a-parida12 <abhijeet.parida@tum.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
6 participants