You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
======================================================================
ERROR: test_init_from_array (tests.test_image_filter.TestImageFilter)
Test init with custom filter and assert wrong filter shape throws an error
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/MONAI/MONAI/tests/test_image_filter.py", line 77, in test_init_from_array
_ = ImageFilter(np.ones((3, 3)))
File "/home/runner/work/MONAI/MONAI/monai/transforms/utility/array.py", line 1589, in __init__
self._check_kwargs_are_present(filter, **kwargs)
File "/home/runner/work/MONAI/MONAI/monai/transforms/utility/array.py", line 1645, in _check_kwargs_are_present
if filter == "gauss" and "sigma" not in kwargs.keys():
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
----------------------------------------------------------------------
The text was updated successfully, but these errors were encountered:
Fixes#6622 .
### Description
Add type check to avoid comparing a np.array with a string
### 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] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
---------
Signed-off-by: Mingxin Zheng <mingxinz@nvidia.com>
Signed-off-by: Mingxin <18563433+mingxin-zheng@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Describe the bug
https://github.com/Project-MONAI/MONAI/actions/runs/5301487274/jobs/9595795019
The text was updated successfully, but these errors were encountered: