Is your feature request related to a problem? Please describe.
the default of first_key is an empty list which is not hashable:
|
def first_key(self, data: Dict[Hashable, Any]): |
|
""" |
|
Get the first available key of `self.keys` in the input `data` dictionary. |
|
If no available key, return an empty list `[]`. |
|
|
|
Args: |
|
data: data that the transform will be applied to. |
|
|
|
""" |
|
return first(self.key_iterator(data), []) |
this makes the regular usage: data_dict[first_key(d)] always raises a static type checking error about not hashable.
Revising the default value might resolve this issue.
Is your feature request related to a problem? Please describe.
the default of
first_keyis an empty list which is not hashable:MONAI/monai/transforms/transform.py
Lines 415 to 424 in a3f3504
this makes the regular usage:
data_dict[first_key(d)]always raises a static type checking error about not hashable.Revising the default value might resolve this issue.