Permalink
Browse files

Put csupport in the pairwise2 module, as currently it is not used any…

…where else
  • Loading branch information...
1 parent 11f0b74 commit c21a741b68cec5a1ece34605e0234d9d06f41414 Michiel de Hoon committed Oct 30, 2010
Showing with 17 additions and 35 deletions.
  1. +16 −1 Bio/cpairwise2module.c
  2. +0 −30 Bio/csupport.c
  3. +0 −2 Bio/csupport.h
  4. +1 −2 setup.py
@@ -10,12 +10,27 @@
*/
#include "Python.h"
-#include "csupport.h"
#define _PRECISION 1000
#define rint(x) (int)((x)*_PRECISION+0.5)
+
+/* Return a PyNumber as a double.
+ * Raises a TypeError if I can't do it.
+ */
+static double PyNumber_AsDouble(PyObject *py_num)
+{
+ double val;
+ PyObject *floatobj;
+
+ if((floatobj = PyNumber_Float(py_num)) == NULL)
+ return(0.0);
+ val = PyFloat_AsDouble(floatobj);
+ Py_DECREF(floatobj);
+ return val;
+}
+
/* Functions in this module. */
double calc_affine_penalty(int length, double open, double extend,
View
@@ -1,30 +0,0 @@
-/* Copyright 2002 by Jeffrey Chang. All rights reserved.
- * This code is part of the Biopython distribution and governed by its
- * license. Please see the LICENSE file that should have been included
- * as part of this package.
- *
- * csupport.c
- * Created 27 January 2002
- *
- * Miscellaneous useful C functions not to be exported as a python
- * module.
- *
- */
-
-#include "Python.h"
-
-
-/* Return a PyNumber as a double.
- * Raises a TypeError if I can't do it.
- */
-double PyNumber_AsDouble(PyObject *py_num)
-{
- double val;
- PyObject *floatobj;
-
- if((floatobj = PyNumber_Float(py_num)) == NULL)
- return(0.0);
- val = PyFloat_AsDouble(floatobj);
- Py_DECREF(floatobj);
- return val;
-}
View
@@ -1,2 +0,0 @@
-
-double PyNumber_AsDouble(PyObject *py_num);
View
@@ -295,8 +295,7 @@ def is_Numpy_installed():
else :
EXTENSIONS = [
Extension('Bio.cpairwise2',
- ['Bio/cpairwise2module.c',
- 'Bio/csupport.c'],
+ ['Bio/cpairwise2module.c'],
include_dirs=["Bio"]
),
Extension('Bio.trie',

0 comments on commit c21a741

Please sign in to comment.