Deprecated decorators#2338
Deprecated decorators#2338ericspod merged 8 commits intoProject-MONAI:devfrom ericspod:deprecated_decorators
Conversation
Signed-off-by: Eric Kerfoot <[email protected]>
Signed-off-by: Eric Kerfoot <[email protected]>
|
/black |
|
The lock will only ensure the warnings are issued once if warnings get issued on the parent process before multiprocessing begins, otherwise each subprocess will issue the warning once. I was going to discuss what to do about the docstring. Other packages that provide deprecation decorators such as this do update the docstring but we should decide on how and what style we will use. Also the flake8-py3 error I'm getting is related to the test environment? |
|
Hi @ericspod , I think all the open PRs have this same flake8 issue now. Thanks. |
|
|
||
| class TestDeprecated(unittest.TestCase): | ||
| def setUp(self): | ||
| self.test_version = "0.5.3+96.g1fa03c2.dirty" |
There was a problem hiding this comment.
I tested cases when test_version > next_version > prev_version, some of the DeprecatedError were missing
wyli
left a comment
There was a problem hiding this comment.
thanks, it works fine with the pytorch loader, it doesn't break any existing modules, could be merged as an initial solution.
Signed-off-by: Eric Kerfoot <[email protected]>
|
/black |
Signed-off-by: monai-bot <[email protected]>
* Adding deprecated decorators Signed-off-by: Eric Kerfoot <[email protected]> * Adding deprecated decorators Signed-off-by: Eric Kerfoot <[email protected]> * Updates from comments Signed-off-by: Eric Kerfoot <[email protected]> Co-authored-by: Nic Ma <[email protected]>
Signed-off-by: Eric Kerfoot [email protected]
Fixes #2335 .
Description
This adds a "deprecated" decorator to apply to functions, methods, and classes to designate them deprecated. A "deprecated_arg" decorator is provided to apply to callables to designate a particular argument as deprecated. Both decorators use the MONAI version to determine if they should issue a warning or raise an exception depending on what version they have been deprecated or removed on.
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.