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

5998 improves error messages in monai/transforms #5961

Merged
merged 6 commits into from
Feb 9, 2023

Conversation

wyli
Copy link
Contributor

@wyli wyli commented Feb 8, 2023

Signed-off-by: Wenqi Li wenqil@nvidia.com

part of #5898

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.

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

@KumoLiu KumoLiu left a comment

Choose a reason for hiding this comment

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

These places may also need to be updated.

raise ValueError("if 'inputs' is a string, function may only have a single non-variadic parameter")

raise ValueError("'outputs' must have the same length as the number of elements that were returned")

raise ValueError("'outputs' must be of length one if it is a list or tuple")

raise ValueError("margin value should not be negative number.")

raise ValueError("If input not one-hotted, should only be 1 channel.")

raise ValueError("offsets should be a number or pair of numbers.")

raise ValueError("factors should be a number or pair of numbers.")

raise ValueError("factors should be a number or pair of numbers.")

raise ValueError("degree should be no less than 1.")

raise ValueError("threshold must be a float or int number.")

raise ValueError("gamma must be a float or int number.")

raise ValueError(
"if gamma is single number, must greater than 0.5 and value is picked from (0.5, gamma)"
)

monai/transforms/utils.py Outdated Show resolved Hide resolved
wyli and others added 5 commits February 9, 2023 07:46
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Signed-off-by: Wenqi Li <831580+wyli@users.noreply.github.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli enabled auto-merge (squash) February 9, 2023 07:48
@wyli
Copy link
Contributor Author

wyli commented Feb 9, 2023

/build

@wyli wyli merged commit 94feae5 into Project-MONAI:dev Feb 9, 2023
@wyli wyli deleted the fixes-error-msg branch February 9, 2023 09:08
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.

2 participants