Repository navigation
Conversation
Orientation(d) declares the labels default change from Project-MONAI#8473 without since or replaced, so the FutureWarning read "was changed in version None" and began "Current default value of argument labels=(('L', 'R'), ...)", which suggests the old default is still in effect. Setting replaced is not an option: with an unknown MONAI version (e.g. a source checkout without tags) the signature check raises at import time. For a replaced default, word the message as "Default value of argument X was changed [in version V] from ... to ...", omitting the version when it is not given. Signed-off-by: eliem08 <emssaadelias@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Description
Since #8473 (1.5.1),
OrientationandOrientationdwarn on every construction that doesn't passlabels:The decorator is declared without
since/replaced, sodeprecated_arg_defaultprintsversion None, and the "Current default value of argumentlabels=(('L', 'R'), ...)" prefix suggests the old default is still in effect.Setting
replaced="1.5.1"on the decorators is not a safe fix: when the MONAI version is unknown (0+..., e.g. a source checkout without tags),is_replacedis False, the signature default already equalsnew_default, and the decorator raisesValueErrorat import time.This PR changes only the message for a replaced default:
and includes
in version Xwhenreplacedis given. Which warnings fire, and when, is unchanged. The stale "raise a DeprecatedError directly" comment is replaced, since that branch only warns.Types of changes
Tests
test_deprecated_arg_default_replaced_messagechecks the wording with and without a version.tests/utils/test_deprecated.py,tests/transforms/test_orientation.pyandtest_orientationd.py: 99 passed (98 before plus the new test). The 2 pytest errors ontest_orientationd.py(test_resampler_lazycollected as a test, fixtureresamplernot found) also occur on unmodifieddev.black --checkandruff checkpass on the changed files.