Skip to content

Fix issue #532 - #533

Merged
lohedges merged 2 commits into
develfrom
fix_532
Nov 11, 2026
Merged

lohedges merged 2 commits into
develfrom
fix_532

Conversation

@lohedges

Copy link
Copy Markdown
Contributor

Closes #532.

copy.deepcopy failed for classes exposed through the generated Boost.Python wrappers, since they bind __deepcopy__ to the one-argument __copy__, while copy.deepcopy also passes a memo dictionary. This sets __deepcopy__ to a two-argument function that returns a copy, which is equivalent since the wrapped objects copy by value. It's applied to every class that _pythonize processes, and to all SireOpenMM classes, e.g. LambdaLever, which aren't pythonized.

Code using the old API (sire.use_old_api()) doesn't go through _pythonize, so isn't covered. Fixing the bindings in the wrappers themselves would cover it, but would touch the 859 generated __deepcopy__ bindings and need a full wrapper rebuild. This covers what's needed by SOMD2.

  • I confirm that I have merged the latest version of devel into this branch before issuing this pull request (e.g. by running git pull origin devel): [y]
  • I confirm that I have added a changelog entry to the changelog (we will add a link to this PR as part of the review): [y]
  • I confirm that I have permission to release this code under the MIT license (the Python API) or the LGPLv3+ license (everything else), as described in the LICENSE file: [y]

lohedges added a commit that referenced this pull request Nov 11, 2026
lohedges added a commit that referenced this pull request Nov 11, 2026
@lohedges
lohedges merged commit 37d71af into devel Nov 11, 2026
4 of 5 checks passed
@lohedges
lohedges deleted the fix_532 branch November 11, 2026 15:28

This branch was previously deployed

1 inactive deployment
sire-build — f53d2c81 Deployed Nov 11, 2026 by lohedges via build (3.13, linux) #473
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copy.deepcopy fails for wrapped Sire classes

1 participant