[med-svn] [ball] 02/06: backport patch: fix PoseClustering_Test

Danny Edel dannyedel-guest at moszumanska.debian.org
Fri Nov 11 11:35:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

dannyedel-guest pushed a commit to branch master
in repository ball.

commit af533fb271f50190ca8fd4a535742d921937b133
Author: Danny Edel <mail at danny-edel.de>
Date:   Thu Nov 10 16:19:03 2016 +0100

    backport patch: fix PoseClustering_Test
    
    This replaces my older patches addressing the same issue.
    
    Backported from upstream commit 0604808e34238c87751b80c70bf7bf13eee14042
---
 .../adjust-PoseClustering_Test-boost-1.58.patch    | 13 ----
 ...est-replace-file-compare-with-deserialize.patch | 73 ++++++++++++++++++++++
 debian/patches/fix-PoseClustering_Test.patch       | 17 -----
 debian/patches/series                              |  3 +-
 4 files changed, 74 insertions(+), 32 deletions(-)

diff --git a/debian/patches/adjust-PoseClustering_Test-boost-1.58.patch b/debian/patches/adjust-PoseClustering_Test-boost-1.58.patch
deleted file mode 100644
index d4cd089..0000000
--- a/debian/patches/adjust-PoseClustering_Test-boost-1.58.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Subject: Adjust boost::archive for boost-1.58 version
-Author: Danny Edel <debian at danny-edel.de>
-
-The archive format of boost-1.58 (currently in sid) and the
-version 1.60, which the upstream patch is for, only differs
-in the "version" field.
-
-Delete this patch once 1.60 is in sid.
---- a/source/TEST/data/PoseClustering_wardtree.dat
-+++ b/source/TEST/data/PoseClustering_wardtree.dat
-@@ -1 +1 @@
--22 serialization::archive 13 0 0 15 14 0 0 1 0 0 1 0.000000000e+00 1 0 1 1 0.000000000e+00 1 0 2 1 0.000000000e+00 1 0 3 1 0.000000000e+00 1 0 4 1 0.000000000e+00 1 0 5 1 0.000000000e+00 1 0 6 1 0.000000000e+00 1 0 7 1 0.000000000e+00 0 0 2 2.930124538e-05 0 0 3 1.017511487e+00 0 0 4 2.349177122e+00 0 0 2 9.453108311e-01 0 0 2 1.095688367e-05 0 0 4 5.062472916e+01 0 0 8 5.839497375e+01 8 1 0 0 8 0 9 3 9 8 10 2 10 9 11 7 11 6 12 4 12 5 13 12 13 11 14 13 14 10 14
-+22 serialization::archive 12 0 0 15 14 0 0 1 0 0 1 0.000000000e+00 1 0 1 1 0.000000000e+00 1 0 2 1 0.000000000e+00 1 0 3 1 0.000000000e+00 1 0 4 1 0.000000000e+00 1 0 5 1 0.000000000e+00 1 0 6 1 0.000000000e+00 1 0 7 1 0.000000000e+00 0 0 2 2.930124538e-05 0 0 3 1.017511487e+00 0 0 4 2.349177122e+00 0 0 2 9.453108311e-01 0 0 2 1.095688367e-05 0 0 4 5.062472916e+01 0 0 8 5.839497375e+01 8 1 0 0 8 0 9 3 9 8 10 2 10 9 11 7 11 6 12 4 12 5 13 12 13 11 14 13 14 10 14
diff --git a/debian/patches/fix-PoseClustering_Test-replace-file-compare-with-deserialize.patch b/debian/patches/fix-PoseClustering_Test-replace-file-compare-with-deserialize.patch
new file mode 100644
index 0000000..9533a76
--- /dev/null
+++ b/debian/patches/fix-PoseClustering_Test-replace-file-compare-with-deserialize.patch
@@ -0,0 +1,73 @@
+Subject: PoseClustering_test: Replace file comparision with deserialisation
+Origin: upstream, https://github.com/BALL-Project/ball/commit/0604808e34238c87751b80c70bf7bf13eee14042
+
+--- a/source/TEST/PoseClustering_test.C
++++ b/source/TEST/PoseClustering_test.C
+@@ -1355,10 +1355,10 @@
+ 
+ CHECK(serializeWardClusterTree(std::ostream& out))
+ 	String filename;
+-
+-	//filename = "PoseClustering_wardtree.dat";
+ 	NEW_TMP_FILE(filename)
+-  File temp_tree(filename, std::ios::out);
++
++	// First, cluster and serialize ClusterTree
++	File temp_tree(filename, std::ios::out);
+ 
+ 	PoseClustering pc;
+ 	pc.options.setInteger(PoseClustering::Option::RMSD_TYPE, PoseClustering::CENTER_OF_MASS_DISTANCE);
+@@ -1375,11 +1375,50 @@
+ 
+ 	pc.setConformationSet(&cs2);
+ 	pc.compute();
+-
+-	//pc.extractClustersForThreshold(2.4); //0.5
+ 	pc.serializeWardClusterTree(temp_tree);
+ 
+-	TEST_FILE(filename.c_str(), BALL_TEST_DATA_PATH(PoseClustering_wardtree.dat))
++	temp_tree.close();
++
++
++	// Second, deserialize and check ClusterTree
++	temp_tree.open(filename, std::ios::in);
++
++	PoseClustering pc2;
++	pc2.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::SNAPSHOT_RMSD);
++	pc2.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
++	pc2.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0);
++
++	pc2.deserializeWardClusterTree(temp_tree);
++
++	std::vector<std::set<Index> > clusters = pc2.extractClustersForThreshold(0.5);
++	TEST_EQUAL(clusters.size(), 6)
++	TEST_EQUAL(pc2.getNumberOfClusters(), 6)
++	TEST_EQUAL(pc2.getClusterScore(0), 0.)
++
++	pc2.extractClustersForThreshold(2.4);
++	TEST_EQUAL(pc2.getNumberOfClusters(), 3)
++	TEST_EQUAL(pc2.getClusterSize(0), 4)
++	PRECISION(1e-3)
++	TEST_REAL_EQUAL(pc2.getClusterScore(0),  2.34918)
++	PRECISION(1e-5)
++
++	TEST_REAL_EQUAL(pc2.getClusterScore(1), 1.09569e-05)
++	TEST_REAL_EQUAL(pc2.getClusterScore(2), 0.945311)
++
++	pc2.extractClustersForThreshold(50.7);
++	TEST_EQUAL(pc2.getNumberOfClusters(), 2)
++	TEST_EQUAL(pc2.getClusterSize(0), 4)
++	PRECISION(1e-3)
++	TEST_REAL_EQUAL(pc2.getClusterScore(0), 50.6247)
++	TEST_REAL_EQUAL(pc2.getClusterScore(1), 2.34918)
++
++	pc2.extractClustersForThreshold(59);
++	TEST_EQUAL(pc2.getNumberOfClusters(), 1)
++	TEST_REAL_EQUAL(pc2.getClusterScore(0), 58.395)
++	PRECISION(1e-5)
++
++	temp_tree.close();
++
+ RESULT
+ 
+ 
diff --git a/debian/patches/fix-PoseClustering_Test.patch b/debian/patches/fix-PoseClustering_Test.patch
deleted file mode 100644
index bc6e323..0000000
--- a/debian/patches/fix-PoseClustering_Test.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-From 7bb01662db40ede50ae5472cc54cc3324aa99778 Mon Sep 17 00:00:00 2001
-From: Oliver Kohlbacher <oliver.kohlbacher at uni-tuebingen.de>
-Date: Fri, 11 Dec 2015 12:09:13 +0100
-Subject: [PATCH] Fixed PoseClustering test to account for changes in boost
- serialization of floating point numbers.
-
----
- source/TEST/data/PoseClustering_wardtree.dat | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/source/TEST/data/PoseClustering_wardtree.dat b/source/TEST/data/PoseClustering_wardtree.dat
-index bac5592..064a09e 100644
---- a/source/TEST/data/PoseClustering_wardtree.dat
-+++ b/source/TEST/data/PoseClustering_wardtree.dat
-@@ -1 +1 @@
--22 serialization::archive 10 0 0 15 14 0 0 1 0 0 1 0 1 0 1 1 0 1 0 2 1 0 1 0 3 1 0 1 0 4 1 0 1 0 5 1 0 1 0 6 1 0 1 0 7 1 0 0 0 2 2.9301245e-05 0 0 3 1.0175115 0 0 4 2.3491771 0 0 2 0.94531083 0 0 2 1.0956884e-05 0 0 4 50.624729 0 0 8 58.394974 8 1 0 0 8 0 9 3 9 8 10 2 10 9 11 7 11 6 12 4 12 5 13 12 13 11 14 13 14 10 14
-+22 serialization::archive 13 0 0 15 14 0 0 1 0 0 1 0.000000000e+00 1 0 1 1 0.000000000e+00 1 0 2 1 0.000000000e+00 1 0 3 1 0.000000000e+00 1 0 4 1 0.000000000e+00 1 0 5 1 0.000000000e+00 1 0 6 1 0.000000000e+00 1 0 7 1 0.000000000e+00 0 0 2 2.930124538e-05 0 0 3 1.017511487e+00 0 0 4 2.349177122e+00 0 0 2 9.453108311e-01 0 0 2 1.095688367e-05 0 0 4 5.062472916e+01 0 0 8 5.839497375e+01 8 1 0 0 8 0 9 3 9 8 10 2 10 9 11 7 11 6 12 4 12 5 13 12 13 11 14 13 14 10 14
diff --git a/debian/patches/series b/debian/patches/series
index 2185ade..dc94d20 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,10 +5,9 @@ fix-poseClustering-with-boost-1.60.patch
 nopsboxit.patch
 link_against_x11.patch
 findsip.patch
-fix-PoseClustering_Test.patch
-adjust-PoseClustering_Test-boost-1.58.patch
 disable-assign-positions-from-template.patch
 fix-FingerprintSimilarityClustering.patch
 fix-Python-bindings-for-Box.patch
 increase-sleeping-time-on-Socket_test.patch
 modify-rtti-isKindOf-to-take-pointer.patch
+fix-PoseClustering_Test-replace-file-compare-with-deserialize.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/ball.git



More information about the debian-med-commit mailing list