Skip to content

Commit

Permalink
use coordination number in test to remove random component
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Nov 27, 2024
1 parent 3891f0d commit ff7b53f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tools/residue_contributions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,15 @@ end
@test length(rc1) == 101

# Test iterators
rc = ResidueContributions(result, select(atoms, "protein"); type=:coordination_number)
rc1 = rc[1]
@test count(true for r in rc) == 104
@test count(true for r in rc1) == 101
@test [ r[end] for r in rc ] == [ r[end] for r in rc.residue_contributions ]
@test last.(rc) == [ r[end] for r in rc ]
@test first.(findmax.(rc[3:4])) [ 0.09254462465788318, 0.037371523587960476 ]
@test last.(findmax.(rc[3:4])) == [ 13, 31]
@test first.(findmax.(rc[3:4])) [ 8.8, 4.0 ]
@test last.(findmax.(rc[3:4])) == [ 101, 101 ]
@test findfirst.(>=(0.5), rc[3:4]) == [8, 18]
@test_throws ArgumentError findmax(rc)
@test_throws ArgumentError count(>(0.01), rc)

Expand Down

0 comments on commit ff7b53f

Please sign in to comment.