Skip to content

Commit

Permalink
Add asunique, change unique, change atom selection behaviour (#3368)
Browse files Browse the repository at this point in the history
Fixes #3364 #2977 

## Work done in this PR
 - Add .asunique. This function (through ._asunique) now does all the grunt work in making unique groups and caching
 - Change .unique to always return a copy of the sorted unique group
 - Add .issorted
 - .unique is no longer cached. _cache['unique'] no longer exists
 - .sorted_unique and .unsorted_unique are now cached
 - .unsorted_unique and .sorted_unique can be the same group, which can be self
 - Added .cache_properties
 - uniqueness and sorted properties now propagate to children. They did not use to, the new function is called `_set_unique_caches_from`
 - Add ability to selectively sort `select_atoms` calls through `sorted` argument
  • Loading branch information
lilyminium authored Aug 17, 2021
1 parent 7ce532e commit f5e9603
Show file tree
Hide file tree
Showing 9 changed files with 601 additions and 223 deletions.
9 changes: 9 additions & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ The rules for this file:
* 2.0.0

Fixes
* Fixes AtomGroup.unique, ResidueGroup.unique, SegmentGroup.unique not
sorting the output atoms. The returned group is now always a copy.
(Issue #3364, Issue #2977, PR #3368)
* Only GRO files with unit cells defined with 3 or 9 entries are now
supported (Issue #3305)
* Ensures that reading and writing of GRO files with missing unit cell
Expand Down Expand Up @@ -121,6 +124,12 @@ Fixes
* new `Results` class now can be pickled/unpickled. (PR #3309)

Enhancements
* Add a ``sort`` keyword to AtomGroup.select_atoms for ordered selections
(Issue #3364, PR #3368)
* Adds AtomGroup.asunique, ResidueGroup.asunique, SegmentGroup.asunique
with optional sorting. The returned group may or may not be a copy
if it is already unique and/or sorted. (Issue #3364, PR #3368)
* Adds ``issorted`` property (PR #3368)
* MOL2 parser populates elements attribute from SYBYL atom types (Issue #3062)
* Added guessers for aromaticity and Gasteiger partial charges (Issue #2468,
PR #2926)
Expand Down
Loading

0 comments on commit f5e9603

Please sign in to comment.