Skip to content
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

Don't downcast molecules to single residues and atoms. [closes #16] #19

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

lohedges
Copy link
Contributor

This pull request fixes issue #16

With the Sire search updates for the 2023 release we now have .molecules(), .residues(), etc methods on the search result to cast to the required object type. However, we still retained the existing code that would (potentially) downcast object types on extraction with __getitem__. For example, single residue molecules were converted to residues, single atom molecules were converted to atoms, etc. Now we want the user to do this directly by calling the appropriate method, e.g. .residues(). This oversight caused issues in the isSame method of BioSimSpace._SireWrappers.System, where non-water molecules were compared based on their properties. If a molecule only had a single residue, then it would be returned as a residue and .propertyKeys() would return an empty list, rather than the required molecular properties. The result was that systems were compared as equal, when in reality they weren't, e.g. different coordinates.

  • 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 permission to release this code under the GPL3 license: [y]

Suggested reviewers:

@chryswoods

@lohedges lohedges temporarily deployed to biosimspace-build March 10, 2023 16:17 — with GitHub Actions Inactive
@lohedges lohedges temporarily deployed to biosimspace-build March 10, 2023 16:17 — with GitHub Actions Inactive
@lohedges lohedges temporarily deployed to biosimspace-build March 10, 2023 16:17 — with GitHub Actions Inactive
@lohedges lohedges temporarily deployed to biosimspace-build March 10, 2023 16:17 — with GitHub Actions Inactive
@lohedges lohedges temporarily deployed to biosimspace-build March 10, 2023 16:17 — with GitHub Actions Inactive
Copy link
Contributor

@chryswoods chryswoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good and makes sense for the way search is used in BioSimSpace :-)

@lohedges lohedges merged commit b82cd99 into devel Mar 10, 2023
@lohedges lohedges deleted the fix_isSame branch March 10, 2023 19:06
@lohedges lohedges added the bug Something isn't working label Mar 16, 2023
lohedges pushed a commit that referenced this pull request Oct 12, 2023
Co-authored-by: William (Zhiyi) Wu <zwu@exscientia.co.uk>
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.

2 participants