-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot copy subclass of Subject with keyword arguments #1181
Labels
bug
Something isn't working
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Bug summary
A subclass of Subject with keyword arguments cannot be copied with
copy.copy()
which is used in transform.py. RaisesTypeError: A subject without images cannot be created
.Code for reproduction
Actual outcome
Raises
TypeError: A subject without images cannot be created
.The subclass cannot be copied as
_subject_copy_helper
in subject.py callsnew = new_subj_cls(result_dict)
.In the above example,
result_dict = {'name:'colin', 'brain': ...}
which means thatname=result_dict
on subclass recreation. This is the only parameter the subclass can see and hence it contains no images.This can be fixed by changing
_subject_copy_helper
, to unpackresult_dict
as below, although I'm unsure if this is the best way of implementing the fix.Error messages
Expected outcome
Subclass should copy correctly.
System info
The text was updated successfully, but these errors were encountered: