Problem
In monai/auto3dseg/utils.py line 287, the code uses:
raise UserWarning("list length in report_format is not 1")
This raises UserWarning as an exception, which will crash the program. Since UserWarning inherits from Warning → Exception, it technically works as a raise, but the intent appears to be to emit a warning (the function returns bool to indicate format validity, not to signal fatal errors).
The warnings module is already imported in the file.
Proposed Fix
Replace raise UserWarning(...) with warnings.warn(...):
warnings.warn("list length in report_format is not 1", stacklevel=2)
Affected Files
monai/auto3dseg/utils.py (line 287)
Problem
In
monai/auto3dseg/utils.pyline 287, the code uses:This raises
UserWarningas an exception, which will crash the program. SinceUserWarninginherits fromWarning → Exception, it technically works as araise, but the intent appears to be to emit a warning (the function returnsboolto indicate format validity, not to signal fatal errors).The
warningsmodule is already imported in the file.Proposed Fix
Replace
raise UserWarning(...)withwarnings.warn(...):Affected Files
monai/auto3dseg/utils.py(line 287)