fepegar / torchio

Medical imaging toolkit for deep learning
https://torchio.org
Apache License 2.0
2.08k stars 239 forks source link

Fix error which copying a subclass of Subject with keyword attributes #1186

Closed c-winder closed 2 months ago

c-winder commented 3 months ago

Fixes #1181.

Updated Subject._subject_copy_helper to unpack the dictionary of attributes rather than passing it directly. This means that a subclass of Subject will correctly read any keyword arguments in the dict rather than passing the entire unpacked dict to the first argument.

test_copy_subclass has been extended to test that this works properly. The dummy subclass now has two attributes.

Checklist

fepegar commented 2 months ago

Thanks for your contribution, @c-winder!

@allcontributors please add @c-winder for bug

allcontributors[bot] commented 2 months ago

@fepegar

I've put up a pull request to add @c-winder! :tada: