Skip to content

Commit fe40b4d

Browse files
committed
fix: address PR #8770 review feedback (#8587)
- retinanet_detector.py: fix typo and improve error message - runtests.sh: use bash ((...)) syntax for integer checks
1 parent f6473f9 commit fe40b4d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

monai/apps/detection/networks/retinanet_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def set_regular_matcher(
342342
"""
343343
if fg_iou_thresh < bg_iou_thresh:
344344
raise ValueError(
345-
f"Require fg_iou_thresh >= bg_iou_thresh. Got fg_iou_thresh={fg_iou_thresh}, bg_iou_thresh={bg_iou_thresh}."
345+
f"Required condition fg_iou_thresh >= bg_iou_thresh not met ({fg_iou_thresh=}, {bg_iou_thresh=})."
346346
)
347347
self.proposal_matcher = Matcher(
348348
fg_iou_thresh, bg_iou_thresh, allow_low_quality_matches=allow_low_quality_matches

runtests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ do
349349
;;
350350
--timeout)
351351
# Accept an optional numeric value; default to 180s if none given.
352-
if [[ -n "$2" ]] && [[ "$2" =~ ^[0-9]+$ ]]; then
352+
if (("$2" > 0)); then
353353
testTimeout=$2
354354
shift
355355
else
@@ -708,7 +708,7 @@ then
708708
echo "${separator}${blue}unittests${noColor}"
709709
torch_validate
710710
timeoutArg=""
711-
if [ "$testTimeout" -gt 0 ] 2>/dev/null; then
711+
if (("$testTimeout" > 0)); then
712712
timeoutArg="--timeout $testTimeout"
713713
fi
714714
${cmdPrefix}${cmd} ./tests/runner.py -p "^(?!test_integration|test_perceptual_loss|test_auto3dseg_ensemble).*(?<!_dist)$" $timeoutArg # excluding integration/dist/perceptual_loss tests

0 commit comments

Comments
 (0)