Don't downcast molecules to single residues and atoms. [closes #16] #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theisSame
method ofBioSimSpace._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.devel
into this branch before issuing this pull request (e.g. by runninggit pull origin devel
): [y]Suggested reviewers:
@chryswoods