Skip to content

Remove usage of deprecated AsChannelFirst, AddChannel , and SplitChannel #6281

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

Merged
merged 23 commits into from
Jun 8, 2023

Conversation

bhashemian
Copy link
Member

@bhashemian bhashemian commented Apr 3, 2023

Fixes #6280

Description

This PR removes the usage of AsChannelFirst, AddChannel, and SplitChannel (which are deprecated since v0.8) and add removed version to v1.3.

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.

@Nic-Ma
Copy link
Contributor

Nic-Ma commented May 15, 2023

Hi @ericspod @drbeh ,

May I know the latest status and plan for this PR?

Thanks.

@ericspod
Copy link
Member

Hi @ericspod @drbeh ,

May I know the latest status and plan for this PR?

Thanks.

I think @drbeh still wanted to work on this one to get the other old classes removed. I'm fine removing them so long as they are all gone from our tutorials and bootcamp materials. We could keep them as wrappers around the correct classes to use and set a deletion version as 1.3 if people aren't sure about removing now.

@bhashemian
Copy link
Member Author

bhashemian commented May 15, 2023

Hi @ericspod @drbeh ,
May I know the latest status and plan for this PR?
Thanks.

I think @drbeh still wanted to work on this one to get the other old classes removed. I'm fine removing them so long as they are all gone from our tutorials and bootcamp materials. We could keep them as wrappers around the correct classes to use and set a deletion version as 1.3 if people aren't sure about removing now.

That's right! We should make them as aliases but my question is do we really need to deprecate these aliases? Since they are aliases, the maintenance cost is very low. I am just wondering if we want to keep them to avoid unnecessary breaking changes. What do you think? @ericspod @Nic-Ma @wyli

@ericspod
Copy link
Member

we really need to deprecate these aliases?

I'd say we should to push people towards the better practice of using the real transforms and not these aliases. Once we've had these in place for a version of two we can remove them safely, they are lightweight but less stagnant code is still better.

@bhashemian bhashemian changed the title Remove widely used deprecated classes since 0.8 Remove deprecated AsChannelFirst May 19, 2023
@bhashemian bhashemian changed the title Remove deprecated AsChannelFirst Remove deprecated AsChannelFirst and AsChannelFirstd May 19, 2023
@bhashemian bhashemian marked this pull request as ready for review May 30, 2023 18:22
@bhashemian bhashemian requested review from wyli, ericspod and Nic-Ma June 5, 2023 17:07
@ericspod
Copy link
Member

ericspod commented Jun 5, 2023

Are we removing the classes entirely and no aliases?

Signed-off-by: Behrooz <[email protected]>
@bhashemian
Copy link
Member Author

Are we removing the classes entirely and no aliases?

@ericspod I am a bit unsure about the best way to do that. Can you help to find the best way to move forward?
Here are three options:

  1. remove them entirely since they have already deprecated since 0.8, which follows the existing MONAI guideline.
  2. create an alias as AsChannelFirst = EnsureChannelFirst, which would work but we should add it to the documentation too.
  3. make AsChannelFirst a wrapper around EnsureChannelFirst and set another deprecation version for it, which is fine too but seems to be a bit arbitrary what version to put and also we should keep CI/CD for this wrapper.

@ericspod
Copy link
Member

ericspod commented Jun 5, 2023

Thanks @drbeh, I'd say option 3 is the solution since we deprecated the class but didn't set a removal version. We can create a wrapper and set the removal for 1.3, meanwhile we can remove the documentation and tests as you've done and rely on the tests for EnsureChannelFirst.

If instead no one's worried about people using these classes we can go with option 1.

@bhashemian
Copy link
Member Author

Thanks @drbeh, I'd say option 3 is the solution since we deprecated the class but didn't set a removal version. We can create a wrapper and set the removal for 1.3, meanwhile we can remove the documentation and tests as you've done and rely on the tests for EnsureChannelFirst.

If instead no one's worried about people using these classes we can go with option 1.

Sure, thanks, I'll update the PR accordingly.

Signed-off-by: Behrooz <[email protected]>
@bhashemian bhashemian changed the title Remove deprecated AsChannelFirst and AsChannelFirstd Remove usage of deprecated AsChannelFirst, AddChannel , and SplitChannel Jun 5, 2023
@bhashemian
Copy link
Member Author

@ericspod I made aliases (wrapper classes) for these deprecated classes, set removed to v1.3, and replaced all their usage in the test cases with the correct classes. However, I kept their specific unit tests to make sure that they continue working before removing them. It will give some time to the users to consider replacing these transforms and also to us to clean up their usage in the tutorials, bundles, and MONAILabel. Please take another look and let me know if you have any other comment. Thanks

Copy link
Member

@ericspod ericspod left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks! We should see if anyone else has any comments.

@bhashemian bhashemian enabled auto-merge (squash) June 7, 2023 13:00
@bhashemian
Copy link
Member Author

@wyli @Nic-Ma do you have any comment here?

@wyli
Copy link
Contributor

wyli commented Jun 8, 2023

/build

@bhashemian bhashemian merged commit cc90d74 into Project-MONAI:dev Jun 8, 2023
@bhashemian bhashemian deleted the remove-dep-0.8 branch June 8, 2023 09:39
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.

Ensure usage of anything deprecated since 0.8 is removed
4 participants