Skip to content

Commit 2ce81c7

Browse files
committed
apply keep-runtime-typing exception to more monai files
1 parent 2a2a1fb commit 2ce81c7

2 files changed

Lines changed: 5 additions & 16 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,14 @@ repos:
3737
rev: v3.18.0
3838
hooks:
3939
- id: pyupgrade
40-
args: [--py38-plus]
41-
name: Upgrade code excluding monai networks
40+
args: [--py38-plus, --keep-runtime-typing]
41+
name: Upgrade code with exceptions
4242
exclude: |
4343
(?x)(
4444
^versioneer.py|
45-
^monai/_version.py|
46-
^monai/networks/| # no PEP 604 for torchscript tensorrt
47-
^monai/losses/| # no PEP 604 for torchscript tensorrt
48-
^monai/data/utils.py|
49-
^monai/data/grid_dataset.py
45+
^monai/_version.py
5046
)
51-
- id: pyupgrade
52-
args: [--py38-plus, --keep-runtime-typing]
53-
name: Upgrade monai networks
54-
files: (?x)(
55-
^monai/networks/|
56-
^monai/data/utils.py|
57-
^monai/data/grid_dataset.py
58-
)
47+
5948
6049
- repo: https://github.com/asottile/yesqa
6150
rev: v1.5.0

monai/losses/hausdorff_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(
7979
Incompatible values.
8080
8181
"""
82-
super(HausdorffDTLoss, self).__init__(reduction=LossReduction(reduction).value)
82+
super().__init__(reduction=LossReduction(reduction).value)
8383
if other_act is not None and not callable(other_act):
8484
raise TypeError(f"other_act must be None or callable but is {type(other_act).__name__}.")
8585
if int(sigmoid) + int(softmax) > 1:

0 commit comments

Comments
 (0)