[med-svn] [Git][med-team/cluster3][master] 4 commits: Preparing for 1.57

Steffen Möller gitlab at salsa.debian.org
Sun Jan 27 00:04:30 GMT 2019


Steffen Möller pushed to branch master at Debian Med / cluster3


Commits:
e7d757c1 by Steffen Moeller at 2019-01-26T23:48:43Z
Preparing for 1.57

- - - - -
291de8a8 by Steffen Moeller at 2019-01-26T23:49:09Z
New upstream version 1.57
- - - - -
2270b02d by Steffen Moeller at 2019-01-26T23:49:20Z
Update upstream source from tag 'upstream/1.57'

Update to upstream version '1.57'
with Debian dir ad47979dd64d15990408a15066bb7bf152a37ddf
- - - - -
a7a2a7c5 by Steffen Moeller at 2019-01-27T00:02:01Z
Added LTO

- - - - -


19 changed files:

- ChangeLog
- NEWS
- configure
- configure.ac
- debian/changelog
- debian/control
- debian/rules
- debian/upstream/metadata
- doc/cluster.pdf
- doc/cluster3.pdf
- mac/English.lproj/AboutPanel.xib
- mac/Info.plist
- perl/Cluster.pm
- python/__init__.py
- python/test/test_Cluster.py
- setup.py
- src/cluster.c
- src/cluster.h
- src/command.c


Changes:

=====================================
ChangeLog
=====================================
@@ -1,3 +1,11 @@
+2018.11.22
+Fixed memory leaks in kcluster and treecluster in src/cluster.c, and in
+Hierarchical and KMeans in src/command.c; these memory leaks occurred when
+memory allocation failed.
+Fixed a bug in the distancematrix function Bio/Cluster/__init__.py, where the 
+weight argument was not properly initialized if it had the default value None,
+causing the function to fail.
+
 2018.04.29
 In the Python wrapper python/clustermodule.c, use PyTree_new to initialize Tree
 objects instead of PyTree_init, as Tree objects are immutable. Check if the


=====================================
NEWS
=====================================
@@ -1,13 +1,7 @@
-2018.04.29
-In the Python wrapper python/clustermodule.c, use PyTree_new to initialize Tree
-objects instead of PyTree_init, as Tree objects are immutable. Check if the
-argument passed are nodes by using PyType_IsSubtype instead of comparing against
-PyNodeType directly, as Node in __init__.py is a subtype of Node in
-clustermodule.c.
-Rewrote indexing code for PyTree for Python3.
-Fixed a bug in Tree.cut in Bio/Cluster/__init__.py, which calculated the indices
-but did not return them. Updated the documentation for Tree.cut and Tree.sort
-in Bio/Cluster/__init__.py. Added tests for Tree.cut. Updated the documentation
-for Pycluster.
-Fixed a bug in src/cluster.c where a NULL pointer was freed if memory
-allocation failed.
+2018.11.22
+Fixed memory leaks in kcluster and treecluster in src/cluster.c, and in
+Hierarchical and KMeans in src/command.c; these memory leaks occurred when
+memory allocation failed.
+Fixed a bug in the distancematrix function Bio/Cluster/__init__.py, where the 
+weight argument was not properly initialized if it had the default value None,
+causing the function to fail.


=====================================
configure
=====================================
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for cluster 1.56.
+# Generated by GNU Autoconf 2.69 for cluster 1.57.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -577,8 +577,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='cluster'
 PACKAGE_TARNAME='cluster'
-PACKAGE_VERSION='1.56'
-PACKAGE_STRING='cluster 1.56'
+PACKAGE_VERSION='1.57'
+PACKAGE_STRING='cluster 1.57'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1273,7 +1273,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures cluster 1.56 to adapt to many kinds of systems.
+\`configure' configures cluster 1.57 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1343,7 +1343,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of cluster 1.56:";;
+     short | recursive ) echo "Configuration of cluster 1.57:";;
    esac
   cat <<\_ACEOF
 
@@ -1440,7 +1440,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-cluster configure 1.56
+cluster configure 1.57
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1859,7 +1859,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by cluster $as_me 1.56, which was
+It was created by cluster $as_me 1.57, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2723,7 +2723,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='cluster'
- VERSION='1.56'
+ VERSION='1.57'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6009,7 +6009,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by cluster $as_me 1.56, which was
+This file was extended by cluster $as_me 1.57, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6075,7 +6075,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-cluster config.status 1.56
+cluster config.status 1.57
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 


=====================================
configure.ac
=====================================
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-AC_INIT(cluster, 1.56)
+AC_INIT(cluster, 1.57)
 AC_CONFIG_SRCDIR(src/cluster.c)
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADERS(config.h)


=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+cluster3 (1.57-1) unstable; urgency=medium
+
+  * New upstream version.
+  * Standards-Version: 4.3.0 - no changes reguired
+  * d/u/metadata: yamllint
+  * d/rules: acivated link-time optimisation, which reduced the size of
+    both cluster3 and xcluster3 by ~25K each (down from 100K and 160K).
+
+ -- Steffen Moeller <moeller at debian.org>  Sun, 27 Jan 2019 00:47:29 +0100
+
 cluster3 (1.56-2) UNRELEASED; urgency=medium
 
   * Use secure copyright file specification URI.


=====================================
debian/control
=====================================
@@ -18,7 +18,7 @@ Build-Depends: debhelper (>= 11~),
                python-minimal,
                python-setuptools,
                python-numpy
-Standards-Version: 4.2.1
+Standards-Version: 4.3.0
 Vcs-Browser: https://salsa.debian.org/med-team/cluster3
 Vcs-Git: https://salsa.debian.org/med-team/cluster3.git
 Homepage: http://bonsai.hgc.jp/~mdehoon/software/cluster/


=====================================
debian/rules
=====================================
@@ -10,6 +10,9 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
+CFLAGS += -flto
+LDFLAGS += -flto
+
 %:
 	dh $@
 


=====================================
debian/upstream/metadata
=====================================
@@ -1,4 +1,4 @@
-Contact:  M. J. L. de Hoon <mdehoon at ims.u-tokyo.ac.jp>
+Contact: M. J. L. de Hoon <mdehoon at ims.u-tokyo.ac.jp>
 Name: cluster3
 Reference:
  Debian-package: cluster3


=====================================
doc/cluster.pdf
=====================================
Binary files a/doc/cluster.pdf and b/doc/cluster.pdf differ


=====================================
doc/cluster3.pdf
=====================================
Binary files a/doc/cluster3.pdf and b/doc/cluster3.pdf differ


=====================================
mac/English.lproj/AboutPanel.xib
=====================================
@@ -29,7 +29,7 @@
                         <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="left" id="12">
                             <font key="font" metaFont="system"/>
                             <string key="title">Cluster 3.0
-using the C Clustering Library version 1.56
+using the C Clustering Library version 1.57
 
 Cluster was originally written by Michael Eisen (eisen 'AT' rana.lbl.gov).
 Copyright 1998-99 Stanford University.


=====================================
mac/Info.plist
=====================================
@@ -21,7 +21,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>C Clustering Library 1.56</string>
+	<string>C Clustering Library 1.57</string>
 	<key>NSMainNibFile</key>
 	<string>MainMenu</string>
 	<key>NSPrincipalClass</key>


=====================================
perl/Cluster.pm
=====================================
@@ -32,7 +32,7 @@ use DynaLoader;
 
 require Exporter;
 
-$VERSION     = '1.56';
+$VERSION     = '1.57';
 $DEBUG       = 1;
 @ISA         = qw(DynaLoader Exporter);
 
@@ -779,7 +779,7 @@ See the scripts in the examples subdirectory of the package.
 
 =over 4
 
-=item * C Clustering Library version 1.56 (2018.04.29)
+=item * C Clustering Library version 1.57 (2018.11.22)
 
 =head1 TO DO
 


=====================================
python/__init__.py
=====================================
@@ -473,9 +473,14 @@ def distancematrix(data, mask=None, weight=None, transpose=False, dist='e'):
         [4., 2., 6., 0.]
     """
     data = __check_data(data)
-    mask = __check_mask(mask, data.shape)
-    n = data.shape[1] if transpose else data.shape[0]
-    matrix = [numpy.empty(i, dtype='d') for i in range(n)]
+    shape = data.shape
+    mask = __check_mask(mask, shape)
+    if transpose:
+        ndata, nitems = shape
+    else:
+        nitems, ndata = shape
+    weight = __check_weight(weight, ndata)
+    matrix = [numpy.empty(i, dtype='d') for i in range(nitems)]
     _cluster.distancematrix(data, mask, weight, transpose, dist, matrix)
     return matrix
 


=====================================
python/test/test_Cluster.py
=====================================
@@ -1154,6 +1154,52 @@ class TestCluster(unittest.TestCase):
         self.assertEqual(clusterid[8], 2)
         self.assertAlmostEqual(error, 7.680, places=3)
 
+        # check if default weights can be used
+        matrix = distancematrix(data, mask=mask)
+        self.assertAlmostEqual(matrix[1][0], 1.687, places=3)
+
+        self.assertAlmostEqual(matrix[2][0], 21.365, places=3)
+        self.assertAlmostEqual(matrix[2][1], 38.560, places=3)
+
+        self.assertAlmostEqual(matrix[3][0], 4.900, places=3)
+        self.assertAlmostEqual(matrix[3][1], 7.793, places=3)
+        self.assertAlmostEqual(matrix[3][2], 22.490, places=3)
+
+        self.assertAlmostEqual(matrix[4][0], 3.687, places=3)
+        self.assertAlmostEqual(matrix[4][1], 6.367, places=3)
+        self.assertAlmostEqual(matrix[4][2], 22.025, places=3)
+        self.assertAlmostEqual(matrix[4][3], 0.087, places=3)
+
+        self.assertAlmostEqual(matrix[5][0], 0.040, places=3)
+        self.assertAlmostEqual(matrix[5][1], 2.890, places=3)
+        self.assertAlmostEqual(matrix[5][2], 34.810, places=3)
+        self.assertAlmostEqual(matrix[5][3], 0.640, places=3)
+        self.assertAlmostEqual(matrix[5][4], 0.490, places=3)
+
+        self.assertAlmostEqual(matrix[6][0], 1.557, places=3)
+        self.assertAlmostEqual(matrix[6][1], 0.990, places=3)
+        self.assertAlmostEqual(matrix[6][2], 34.065, places=3)
+        self.assertAlmostEqual(matrix[6][3], 3.937, places=3)
+        self.assertAlmostEqual(matrix[6][4], 3.017, places=3)
+        self.assertAlmostEqual(matrix[6][5], 3.610, places=3)
+
+        self.assertAlmostEqual(matrix[7][0], 14.005, places=3)
+        self.assertAlmostEqual(matrix[7][1], 9.050, places=3)
+        self.assertAlmostEqual(matrix[7][2], 65.610, places=3)
+        self.assertAlmostEqual(matrix[7][3], 30.465, places=3)
+        self.assertAlmostEqual(matrix[7][4], 27.380, places=3)
+        self.assertAlmostEqual(matrix[7][5], 0.000, places=3)
+        self.assertAlmostEqual(matrix[7][6], 16.385, places=3)
+
+        self.assertAlmostEqual(matrix[8][0], 14.167, places=3)
+        self.assertAlmostEqual(matrix[8][1], 25.553, places=3)
+        self.assertAlmostEqual(matrix[8][2], 0.010, places=3)
+        self.assertAlmostEqual(matrix[8][3], 17.187, places=3)
+        self.assertAlmostEqual(matrix[8][4], 16.380, places=3)
+        self.assertAlmostEqual(matrix[8][5], 33.640, places=3)
+        self.assertAlmostEqual(matrix[8][6], 22.497, places=3)
+        self.assertAlmostEqual(matrix[8][7], 36.745, places=3)
+
     def test_pca(self):
         if TestCluster.module == 'Bio.Cluster':
             from Bio.Cluster import pca


=====================================
setup.py
=====================================
@@ -41,7 +41,7 @@ class test_Pycluster(Command):
 
 
 setup(name="Pycluster",
-      version="1.56",
+      version="1.57",
       description="The C Clustering Library",
       author="Michiel de Hoon",
       author_email="michiel.dehoon 'AT' riken.jp",


=====================================
src/cluster.c
=====================================
@@ -2732,8 +2732,8 @@ number of clusters is larger than the number of elements being clustered,
     if (npass>1)
     { free(tclusterid);
       free(mapping);
-      return;
     }
+    return;
   }
 
   if (method=='m')
@@ -3859,6 +3859,7 @@ If a memory error occurs, treecluster returns NULL.
     { distmatrix[i] = malloc(i*sizeof(double));
       if (distmatrix[i]==NULL) /* Not enough memory available */
       { while (--i > 0) free(distmatrix[i]);
+        free(distmatrix);
         return NULL;
       }
     }


=====================================
src/cluster.h
=====================================
@@ -38,7 +38,7 @@
 #  include <windows.h>
 #endif
 
-#define CLUSTERVERSION "1.56"
+#define CLUSTERVERSION "1.57"
 
 /* Chapter 2 */
 double clusterdistance(int nrows, int ncolumns, double** data, int** mask,


=====================================
src/command.c
=====================================
@@ -242,6 +242,7 @@ Hierarchical(char genemetric, char arraymetric, char method, char* jobname)
     { ok = HierarchicalCluster(outputfile, genemetric, 0, method);
       if (!ok)
       { printf("ERROR: Failed to allocate sufficient memory for clustering\n");
+        free(filename);
         return;
       }
       fclose(outputfile);
@@ -255,6 +256,7 @@ Hierarchical(char genemetric, char arraymetric, char method, char* jobname)
     { ok = HierarchicalCluster(outputfile, arraymetric, 1, method);
       if (!ok)
       { printf("ERROR: Failed to allocate sufficient memory for clustering\n");
+        free(filename);
         return;
       }
       fclose(outputfile);
@@ -339,10 +341,12 @@ static void KMeans(char genemetric, char arraymetric, int k, int r,
         free(NodeMap);
         if (ok < 0)
         { printf("ERROR: Failed to allocate sufficient memory for clustering\n");
+          free(filename);
           return;
         }
         if (ok==0)
         { printf("ERROR: Failed to allocate sufficient memory for saving file\n");
+          free(filename);
           return;
         }
       }
@@ -373,11 +377,11 @@ static void KMeans(char genemetric, char arraymetric, int k, int r,
     }
   }
   if (genemetric && arraymetric)
-    sprintf (filename,"%s_K_G%d_A%d.cdt", jobname, k, k);
+    sprintf(filename, "%s_K_G%d_A%d.cdt", jobname, k, k);
   else if (genemetric)
-    sprintf (filename,"%s_K_G%d.cdt", jobname, k);
+    sprintf(filename, "%s_K_G%d.cdt", jobname, k);
   else if (arraymetric)
-    sprintf (filename,"%s_K_A%d.cdt", jobname, k);
+    sprintf(filename, "%s_K_A%d.cdt", jobname, k);
   /* Now write the data file */
   outputfile = fopen(filename, "wt");
   if (!outputfile) printf ("Failed to open output file %s\n", filename);



View it on GitLab: https://salsa.debian.org/med-team/cluster3/compare/93da310ff1d44932fd57311111911b7d1ea6bb65...a7a2a7c5ba27c69e1a9d97ff09bb42177d44d07f

-- 
View it on GitLab: https://salsa.debian.org/med-team/cluster3/compare/93da310ff1d44932fd57311111911b7d1ea6bb65...a7a2a7c5ba27c69e1a9d97ff09bb42177d44d07f
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190127/f4e03caf/attachment-0001.html>


More information about the debian-med-commit mailing list