You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading a molecule using TCutility.molecule.load we capture information about the molecule and the atoms in their respective flags attribute. Because flags is a TCutility.results.result.Result object there will be issues whenever you call the copy method of the molecule. This method is very often used (for example in workflows) and we therefore should fix this. One way of fixing it is to overload the __reduce__ method of the TCutility.results.result.Result class. This method should return a single string specifying the name and namespace of the class. This then tells copy.deepcopy (which plams uses) what the class is supposed to be.
The text was updated successfully, but these errors were encountered:
I have added a test-case. You can see that it will pass if we define the __reduce__ method, but will fail if we do not define it. There seems to be some weird stuff going on under the hood of copy.deepcopy, but I don't know enough about the deeper parts of Python to fully understand it. Documentation is also a bit complicated a scarce about this topic.
When loading a molecule using
TCutility.molecule.load
we capture information about the molecule and the atoms in their respectiveflags
attribute. Becauseflags
is aTCutility.results.result.Result
object there will be issues whenever you call thecopy
method of the molecule. This method is very often used (for example in workflows) and we therefore should fix this. One way of fixing it is to overload the__reduce__
method of theTCutility.results.result.Result
class. This method should return a single string specifying the name and namespace of the class. This then tellscopy.deepcopy
(which plams uses) what the class is supposed to be.The text was updated successfully, but these errors were encountered: