From ff7b53f4a24100c00aaa7857ec751f35ee470e7d Mon Sep 17 00:00:00 2001 From: Leandro Martinez Date: Tue, 26 Nov 2024 21:45:19 -0300 Subject: [PATCH] use coordination number in test to remove random component --- src/tools/residue_contributions.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/residue_contributions.jl b/src/tools/residue_contributions.jl index a3f59b07..d97851fc 100644 --- a/src/tools/residue_contributions.jl +++ b/src/tools/residue_contributions.jl @@ -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)