Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…where else
  • Loading branch information...
commit c21a741b68cec5a1ece34605e0234d9d06f41414 1 parent 11f0b74
Michiel de Hoon authored
View
17 Bio/cpairwise2module.c
@@ -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
30 Bio/csupport.c
@@ -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
2  Bio/csupport.h
@@ -1,2 +0,0 @@
-
-double PyNumber_AsDouble(PyObject *py_num);
View
3  setup.py
@@ -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',
Please sign in to comment.
Something went wrong with that request. Please try again.