Skip to content

Commit efb1cb7

Browse files
committed
Checker complaints
Signed-off-by: mmelqin <[email protected]>
1 parent c9a2872 commit efb1cb7

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

monai/deploy/core/domain/dicom_series_selection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(
2727
self,
2828
selection_name: str,
2929
dicom_series: DICOMSeries,
30-
image: Optional[Image] = None,
30+
image: Image = None,
3131
metadata: Optional[Dict] = None,
3232
) -> None:
3333
"""Creates an instance of this class

monai/deploy/operators/dicom_series_selector_operator.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import numbers
1414
import re
1515
from json import loads as json_loads
16-
from typing import Dict, List, Text
16+
from typing import Any, Dict, List, Text
1717

1818
import monai.deploy.core as md
1919
from monai.deploy.core import ExecutionContext, InputContext, IOType, Operator, OutputContext
@@ -257,13 +257,10 @@ def _select_series(self, attributes: dict, study: DICOMStudy, all_matched=False)
257257

258258
@staticmethod
259259
def _get_instance_properties(obj: object):
260-
prop_dict = dict()
261260
if not obj:
262-
return prop_dict
263-
264-
for attribute in [x for x in type(obj).__dict__ if isinstance(type(obj).__dict__[x], property)]:
265-
prop_dict[attribute] = getattr(obj, attribute, None)
266-
return prop_dict
261+
return {}
262+
else:
263+
return {x: getattr(obj, x, None) for x in type(obj).__dict__ if isinstance(type(obj).__dict__[x], property)}
267264

268265

269266
# Module functions

0 commit comments

Comments
 (0)