[pynfft] 01/02: Imported Upstream version 1.3.2
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Aug 7 14:56:34 UTC 2014
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch upstream
in repository pynfft.
commit 73f7876cc592232bebe73a17e770c80cc4ebf7f0
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Tue Aug 5 16:09:31 2014 +0100
Imported Upstream version 1.3.2
---
CHANGELOG.txt | 7 +
CONTRIBUTING.rst | 19 --
MANIFEST.in | 18 ++
PKG-INFO | 12 +-
doc/source/conf.py | 2 +-
pyNFFT.egg-info/PKG-INFO | 12 +-
pyNFFT.egg-info/SOURCES.txt | 15 +-
pyNFFT.egg-info/requires.txt | 1 -
pynfft/__init__.py | 1 +
pynfft/nfft.c | 2 +-
pynfft/solver.c | 2 +-
{tests => pynfft/tests}/__init__.py | 0
{tests => pynfft/tests}/test_nfft.py | 0
pynfft/util.c | 152 +++++++++------
pynfft/version.py | 10 +
requirements.txt | 2 -
setup.py | 349 +++++++++++++++++++++++++----------
17 files changed, 414 insertions(+), 190 deletions(-)
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 5605cf9..e090811 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,13 @@
Changelog
=========
+Changes in version 1.3.2
+------------------------
+
+ * setup: re-introduce proper clean target
+ * setup: remove dependency on numpy for some targets
+ * add PEP-396 compliant version
+
Changes in version 1.3.1
------------------------
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
deleted file mode 100644
index 74601fe..0000000
--- a/CONTRIBUTING.rst
+++ /dev/null
@@ -1,19 +0,0 @@
-How to contribute to pyNFFT
-===========================
-
-Please feel free to [open issues][] and send pull requests on GitHub. When sending a pull request, please create a new feature branch, and send your pull
-request from that branch. Please do *not* send pull requests from your `master`
-branch because to avoid potential merge conflicts.
-
-Improving features
------------------
-
-The NFFT library contains a lot more features than the pyNFFT wrapper supports
-at the moment. If you are interested in developping one of these features, feel
-free to get coding and send me your contribution for inclusion to the project.
-
-Coding style
-------------
-
-This project follows the PEP8 coding guidelines. Please make sure your code has been tested with a code analysis tool such as `pyflakes <https://pypi.python.org/pypi/pyflakes>`_ and `pep8 <https://pypi.python.org/pypi/pep8>`_ before submitting it.
-
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..0baebc7
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,18 @@
+include MANIFEST.in
+include CHANGELOG.txt
+include COPYING.txt
+include README.rst
+include setup.cfg
+include setup.py
+exclude CONTRIBUTING.rst
+
+graft pynfft
+graft doc
+prune doc/build
+
+global-exclude *.pyc
+global-exclude *.pyd
+global-exclude *.pyo
+global-exclude *.so
+global-exclude .git*
+global-exclude *~
diff --git a/PKG-INFO b/PKG-INFO
index 59b7825..cb19013 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pyNFFT
-Version: 1.3.1
+Version: 1.3.2
Summary: A pythonic wrapper around NFFT
Home-page: https://github.com/ghisvail/pyNFFT.git
Author: Ghislain Vaillant
@@ -21,9 +21,17 @@ Description: "The NFFT is a C subroutine library for computing the
particular, the API is not yet frozen and is likely to change as the
development continues. Please consult the documentation and changelog for more
information.
-Platform: UNKNOWN
+Platform: Linux
+Platform: Unix
+Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.2
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: POSIX :: Linux
diff --git a/doc/source/conf.py b/doc/source/conf.py
index f3cc355..4249807 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -50,7 +50,7 @@ copyright = u'2013, Ghislain Vaillant'
# The short X.Y version.
version = '1.3'
# The full version, including alpha/beta/rc tags.
-release = '1.3.1'
+release = '1.3.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/pyNFFT.egg-info/PKG-INFO b/pyNFFT.egg-info/PKG-INFO
index 59b7825..cb19013 100644
--- a/pyNFFT.egg-info/PKG-INFO
+++ b/pyNFFT.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pyNFFT
-Version: 1.3.1
+Version: 1.3.2
Summary: A pythonic wrapper around NFFT
Home-page: https://github.com/ghisvail/pyNFFT.git
Author: Ghislain Vaillant
@@ -21,9 +21,17 @@ Description: "The NFFT is a C subroutine library for computing the
particular, the API is not yet frozen and is likely to change as the
development continues. Please consult the documentation and changelog for more
information.
-Platform: UNKNOWN
+Platform: Linux
+Platform: Unix
+Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.2
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: POSIX :: Linux
diff --git a/pyNFFT.egg-info/SOURCES.txt b/pyNFFT.egg-info/SOURCES.txt
index f3f19a6..9bef381 100644
--- a/pyNFFT.egg-info/SOURCES.txt
+++ b/pyNFFT.egg-info/SOURCES.txt
@@ -1,13 +1,12 @@
CHANGELOG.txt
-CONTRIBUTING.rst
COPYING.txt
+MANIFEST.in
README.rst
-requirements.txt
setup.cfg
setup.py
-/home/shared/workspace/pyNFFT/pynfft/nfft.c
-/home/shared/workspace/pyNFFT/pynfft/solver.c
-/home/shared/workspace/pyNFFT/pynfft/util.c
+/home/gv10-debian/Workspace/pyNFFT/pynfft/nfft.c
+/home/gv10-debian/Workspace/pyNFFT/pynfft/solver.c
+/home/gv10-debian/Workspace/pyNFFT/pynfft/util.c
doc/Makefile
doc/source/api.rst
doc/source/conf.py
@@ -19,7 +18,6 @@ doc/source/api/util.rst
pyNFFT.egg-info/PKG-INFO
pyNFFT.egg-info/SOURCES.txt
pyNFFT.egg-info/dependency_links.txt
-pyNFFT.egg-info/requires.txt
pyNFFT.egg-info/top_level.txt
pynfft/__init__.py
pynfft/cnfft3.pxd
@@ -32,5 +30,6 @@ pynfft/solver.pxd
pynfft/solver.pyx
pynfft/util.c
pynfft/util.pyx
-tests/__init__.py
-tests/test_nfft.py
\ No newline at end of file
+pynfft/version.py
+pynfft/tests/__init__.py
+pynfft/tests/test_nfft.py
\ No newline at end of file
diff --git a/pyNFFT.egg-info/requires.txt b/pyNFFT.egg-info/requires.txt
deleted file mode 100644
index 24ce15a..0000000
--- a/pyNFFT.egg-info/requires.txt
+++ /dev/null
@@ -1 +0,0 @@
-numpy
diff --git a/pynfft/__init__.py b/pynfft/__init__.py
index 71b1808..1885190 100644
--- a/pynfft/__init__.py
+++ b/pynfft/__init__.py
@@ -16,5 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from pynfft.version import version as __version__
from pynfft.nfft import NFFT
from pynfft.solver import Solver
diff --git a/pynfft/nfft.c b/pynfft/nfft.c
index 2191a29..b3e1274 100644
--- a/pynfft/nfft.c
+++ b/pynfft/nfft.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1+b1) on Thu Jun 12 20:27:41 2014 */
+/* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1+b1) on Wed Jul 30 14:49:39 2014 */
#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
diff --git a/pynfft/solver.c b/pynfft/solver.c
index 83cf269..9d1b855 100644
--- a/pynfft/solver.c
+++ b/pynfft/solver.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1+b1) on Thu Jun 12 20:28:32 2014 */
+/* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1+b1) on Wed Jul 30 14:49:39 2014 */
#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
diff --git a/tests/__init__.py b/pynfft/tests/__init__.py
similarity index 100%
rename from tests/__init__.py
rename to pynfft/tests/__init__.py
diff --git a/tests/test_nfft.py b/pynfft/tests/test_nfft.py
similarity index 100%
rename from tests/test_nfft.py
rename to pynfft/tests/test_nfft.py
diff --git a/pynfft/util.c b/pynfft/util.c
index 4778d50..34a7b4a 100644
--- a/pynfft/util.c
+++ b/pynfft/util.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.20 (Debian 0.20-3) on Tue Mar 11 16:04:32 2014 */
+/* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1+b1) on Wed Jul 30 14:27:02 2014 */
#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
@@ -19,7 +19,7 @@
#elif PY_VERSION_HEX < 0x02040000
#error Cython requires Python 2.4+.
#else
-#define CYTHON_ABI "0_20"
+#define CYTHON_ABI "0_20_1post0"
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -116,7 +116,7 @@
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
- PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#define __Pyx_DefaultClassType PyClass_Type
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
@@ -161,10 +161,16 @@
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#define __Pyx_PyUnicode_Concat(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
- PyNumber_Add(a, b) : PyUnicode_Concat(a, b))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
#else
@@ -231,7 +237,7 @@
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
-#if PY_VERSION_HEX < 0x03020000
+#if PY_VERSION_HEX < 0x030200A4
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
@@ -310,6 +316,12 @@ static CYTHON_INLINE float __PYX_NAN() {
return value;
}
#endif
+#ifdef __cplusplus
+template<typename T>
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
#if PY_MAJOR_VERSION >= 3
@@ -387,7 +399,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t*
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
@@ -397,11 +409,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
#endif
#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -501,16 +513,11 @@ bad:
#endif
-#ifdef __GNUC__
- /* Test for GCC > 2.95 */
- #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
- #else /* __GNUC__ > 2 ... */
- #define likely(x) (x)
- #define unlikely(x) (x)
- #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
@@ -932,6 +939,12 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
const char* function_name); /*proto*/
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
@@ -1193,7 +1206,7 @@ static char __pyx_k_voronoi_weights_S2[] = "voronoi_weights_S2";
static char __pyx_k_vrand_unit_complex[] = "vrand_unit_complex";
static char __pyx_k_vrand_shifted_unit_double[] = "vrand_shifted_unit_double";
static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
-static char __pyx_k_home_ghislain_deb_workspace_pyN[] = "/home/ghislain-deb/workspace/pyNFFT/pynfft/util.pyx";
+static char __pyx_k_home_gv10_debian_Workspace_pyNF[] = "/home/gv10-debian/Workspace/pyNFFT/pynfft/util.pyx";
static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_Incompatible_size_between_weight[] = "Incompatible size between weights and nodes (%d, %d)";
@@ -1206,7 +1219,7 @@ static PyObject *__pyx_kp_s_Incompatible_size_between_weight;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_kp_s_home_ghislain_deb_workspace_pyN;
+static PyObject *__pyx_kp_s_home_gv10_debian_Workspace_pyNF;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
@@ -1626,7 +1639,7 @@ static PyObject *__pyx_pf_6pynfft_4util_4voronoi_weights_1d(CYTHON_UNUSED PyObje
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
@@ -1872,7 +1885,7 @@ static PyObject *__pyx_pf_6pynfft_4util_6voronoi_weights_S2(CYTHON_UNUSED PyObje
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -2099,7 +2112,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
*/
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -2137,7 +2150,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*
* info.buf = PyArray_DATA(self)
*/
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -2409,7 +2422,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
*/
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -2630,7 +2643,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
@@ -3219,7 +3232,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*
* if ((child.byteorder == c'>' and little_endian) or
*/
- __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -3268,7 +3281,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* # One could encode it in the format string and have Cython
* # complain instead, BUT: < and > in format strings also imply
*/
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -3369,7 +3382,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*
* # Until ticket #99 is fixed, use integers to avoid warnings
*/
- __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -3703,7 +3716,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
@@ -3954,7 +3967,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
{&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
{&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
- {&__pyx_kp_s_home_ghislain_deb_workspace_pyN, __pyx_k_home_ghislain_deb_workspace_pyN, sizeof(__pyx_k_home_ghislain_deb_workspace_pyN), 0, 0, 1, 0},
+ {&__pyx_kp_s_home_gv10_debian_Workspace_pyNF, __pyx_k_home_gv10_debian_Workspace_pyNF, sizeof(__pyx_k_home_gv10_debian_Workspace_pyNF), 0, 0, 1, 0},
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
{&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
@@ -4066,7 +4079,7 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ghislain_deb_workspace_pyN, __pyx_n_s_vrand_unit_complex, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gv10_debian_Workspace_pyNF, __pyx_n_s_vrand_unit_complex, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "pynfft/util.pyx":39
* nfft_vrand_unit_complex(<fftw_complex *>&x[0], x.size)
@@ -4078,7 +4091,7 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ghislain_deb_workspace_pyN, __pyx_n_s_vrand_shifted_unit_double, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gv10_debian_Workspace_pyNF, __pyx_n_s_vrand_shifted_unit_double, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "pynfft/util.pyx":52
* nfft_vrand_shifted_unit_double(<double *>&x[0], x.size)
@@ -4090,7 +4103,7 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_w, __pyx_n_s_x); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ghislain_deb_workspace_pyN, __pyx_n_s_voronoi_weights_1d, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gv10_debian_Workspace_pyNF, __pyx_n_s_voronoi_weights_1d, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "pynfft/util.pyx":67
* nfft_voronoi_weights_1d(<double *>&w[0], <double *>&x[0], w.size)
@@ -4102,7 +4115,7 @@ static int __Pyx_InitCachedConstants(void) {
__pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_w, __pyx_n_s_xi); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
- __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ghislain_deb_workspace_pyN, __pyx_n_s_voronoi_weights_S2, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gv10_debian_Workspace_pyNF, __pyx_n_s_voronoi_weights_S2, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -4689,8 +4702,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
}
if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
while (*ts && *ts != ')') {
- if (isspace(*ts))
- continue;
+ switch (*ts) {
+ case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
+ default: break; /* not a 'break' in the loop */
+ }
number = __Pyx_BufFmt_ExpectNumber(&ts);
if (number == -1) return NULL;
if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
@@ -4730,10 +4745,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
__Pyx_BufFmt_RaiseExpected(ctx);
return NULL;
}
- return ts;
+ return ts;
case ' ':
- case 10:
- case 13:
+ case '\r':
+ case '\n':
++ts;
break;
case '<':
@@ -4809,21 +4824,25 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
__Pyx_BufFmt_RaiseUnexpectedChar('Z');
return NULL;
- } /* fall through */
+ }
case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
case 'l': case 'L': case 'q': case 'Q':
case 'f': case 'd': case 'g':
- case 'O': case 's': case 'p':
+ case 'O': case 'p':
if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
ctx->enc_packmode == ctx->new_packmode) {
ctx->enc_count += ctx->new_count;
- } else {
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->enc_count = ctx->new_count;
- ctx->enc_packmode = ctx->new_packmode;
- ctx->enc_type = *ts;
- ctx->is_complex = got_Z;
+ ctx->new_count = 1;
+ got_Z = 0;
+ ++ts;
+ break;
}
+ case 's':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_count = ctx->new_count;
+ ctx->enc_packmode = ctx->new_packmode;
+ ctx->enc_type = *ts;
+ ctx->is_complex = got_Z;
++ts;
ctx->new_count = 1;
got_Z = 0;
@@ -5067,6 +5086,29 @@ bad:
return -1;
}
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+#if PY_VERSION_HEX >= 0x02060000
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+#endif
+ result = (*call)(func, arg, kw);
+#if PY_VERSION_HEX >= 0x02060000
+ Py_LeaveRecursiveCall();
+#endif
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
@@ -6210,7 +6252,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
return 0;
}
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
@@ -6247,7 +6289,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
if (PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
if (PyUnicode_IS_ASCII(o)) {
- *length = PyUnicode_GET_DATA_SIZE(o);
+ *length = PyUnicode_GET_LENGTH(o);
return PyUnicode_AsUTF8(o);
} else {
PyUnicode_AsASCIIString(o);
@@ -6259,12 +6301,14 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif /* PY_VERSION_HEX < 0x03030000 */
} else
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
+#if !CYTHON_COMPILING_IN_PYPY
#if PY_VERSION_HEX >= 0x02060000
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
} else
#endif
+#endif
{
char* result;
int r = PyBytes_AsStringAndSize(o, &result, length);
diff --git a/pynfft/version.py b/pynfft/version.py
new file mode 100644
index 0000000..cea23b6
--- /dev/null
+++ b/pynfft/version.py
@@ -0,0 +1,10 @@
+
+# THIS FILE IS GENERATED FROM SETUP.PY
+short_version = '1.3.2'
+version = '1.3.2'
+full_version = '1.3.2'
+git_revision = 'c45b7027a79c9633e8ffa84532f4bfa092e510a9'
+release = True
+
+if not release:
+ version = full_version
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index c06c238..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-numpy>=1.6
-
diff --git a/setup.py b/setup.py
index 6b96e2d..5bac118 100644
--- a/setup.py
+++ b/setup.py
@@ -16,104 +16,133 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-try:
- from setuptools import setup, Extension
-except ImportError:
- from distutils.core import setup, Extension
-
-try:
- from Cython.Distutils import build_ext
-except ImportError:
- use_cython = False
-else:
- use_cython = True
-
import os
-import os.path
-import numpy
-import shutil
+import sys
+import subprocess
+
+# Define global path variables
setup_dir = dir = os.path.dirname(os.path.abspath(__file__))
package_name = 'pynfft'
package_dir = os.path.join(setup_dir, package_name)
-include_dirs = [numpy.get_include()]
-library_dirs = []
-package_data = {}
-libraries = ['nfft3_threads', 'nfft3', 'fftw3_threads', 'fftw3', 'm']
-cmdclass = {}
-ext_modules = []
+# Define utility functions to build the extensions
+def get_common_extension_args():
+ import numpy
+ common_extension_args = dict(
+ libraries=['nfft3_threads', 'nfft3', 'fftw3_threads', 'fftw3', 'm'],
+ library_dirs=[],
+ include_dirs=[numpy.get_include()],
+ extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
+ '-fstrict-aliasing -ffast-math'.split(),
+ )
+ return common_extension_args
-if use_cython:
- ext_modules += [
- Extension(
- name=package_name+'.nfft',
- sources=[os.path.join(package_dir, 'nfft.pyx')],
- libraries=libraries,
- library_dirs=library_dirs,
- include_dirs=include_dirs,
- extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
- '-fstrict-aliasing -ffast-math'.split(),
- ),
- Extension(
- name=package_name+'.solver',
- sources=[os.path.join(package_dir, 'solver.pyx')],
- libraries=libraries,
- library_dirs=library_dirs,
- include_dirs=include_dirs,
- extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
- '-fstrict-aliasing -ffast-math'.split(),
- ),
- Extension(
- name=package_name+'.util',
- sources=[os.path.join(package_dir, 'util.pyx')],
- libraries=libraries,
- library_dirs=library_dirs,
- include_dirs=include_dirs,
- extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
- '-fstrict-aliasing -ffast-math'.split(),
- ),
- ]
- cmdclass.update({'build_ext': build_ext})
-else:
- ext_modules += [
- Extension(
+def get_extensions():
+ from distutils.extension import Extension
+ ext_modules = []
+ common_extension_args = get_common_extension_args()
+ ext_modules.append(Extension(
name=package_name+'.nfft',
sources=[os.path.join(package_dir, 'nfft.c')],
- libraries=libraries,
- library_dirs=library_dirs,
- include_dirs=include_dirs,
- extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
- '-fstrict-aliasing -ffast-math'.split(),
- ),
- Extension(
+ **common_extension_args
+ )
+ )
+ ext_modules.append(Extension(
name=package_name+'.solver',
sources=[os.path.join(package_dir, 'solver.c')],
- libraries=libraries,
- library_dirs=library_dirs,
- include_dirs=include_dirs,
- extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
- '-fstrict-aliasing -ffast-math'.split(),
- ),
- Extension(
+ **common_extension_args
+ )
+ )
+ ext_modules.append(Extension(
name=package_name+'.util',
sources=[os.path.join(package_dir, 'util.c')],
- libraries=libraries,
- library_dirs=library_dirs,
- include_dirs=include_dirs,
- extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
- '-fstrict-aliasing -ffast-math'.split(),
- ),
- ]
+ **common_extension_args
+ )
+ )
+ return ext_modules
+
+def get_cython_extensions():
+ from distutils.extension import Extension
+ from Cython.Build import cythonize
+ ext_modules = []
+ common_extension_args = get_common_extension_args()
+ ext_modules.append(Extension(
+ name=package_name+'.nfft',
+ sources=[os.path.join(package_dir, 'nfft.pyx')],
+ **common_extension_args
+ )
+ )
+ ext_modules.append(Extension(
+ name=package_name+'.solver',
+ sources=[os.path.join(package_dir, 'solver.pyx')],
+ **common_extension_args
+ )
+ )
+ ext_modules.append(Extension(
+ name=package_name+'.util',
+ sources=[os.path.join(package_dir, 'util.pyx')],
+ **common_extension_args
+ )
+ )
+ return cythonize(ext_modules)
-version = '1.3.1'
-release = True
-if not release:
- version += '-dev'
+# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
+# update it when the contents of directories change.
+if os.path.exists('MANIFEST'):
+ os.remove('MANIFEST')
+
+
+# Define custom clean command
+from distutils.core import Command
+class CleanCommand(Command):
+ """Custom distutils command to clean the .so and .pyc files."""
+
+ user_options = [("all", "a", "")]
+
+ def initialize_options(self):
+ self.all = True
+ self._clean_me = []
+ self._clean_trees = []
+ self._clean_exclude = []
+ # clean Cython generated files and cache
+ for root, dirs, files in os.walk(package_dir):
+ for f in files:
+ if f in self._clean_exclude:
+ continue
+ if os.path.splitext(f)[-1] in ('.pyc', '.so', '.o',
+ '.pyo',
+ '.pyd', '.c', '.orig'):
+ self._clean_me.append(os.path.join(root, f))
+ for d in dirs:
+ if d == '__pycache__':
+ self._clean_trees.append(os.path.join(root, d))
+ # clean build and sdist directories in root
+ for d in ('build', 'dist'):
+ if os.path.exists(d):
+ self._clean_trees.append(d)
-long_description = '''"The NFFT is a C subroutine library for computing the
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ for clean_me in self._clean_me:
+ try:
+ os.unlink(clean_me)
+ except Exception:
+ pass
+ for clean_tree in self._clean_trees:
+ try:
+ shutil.rmtree(clean_tree)
+ except Exception:
+ pass
+
+cmdclass = {'clean': CleanCommand}
+
+
+LONG_DESCRIPTION = '''"The NFFT is a C subroutine library for computing the
nonequispaced discrete Fourier transform (NDFT) in one or more dimensions, of
arbitrary input size, and of complex data."
@@ -129,9 +158,16 @@ particular, the API is not yet frozen and is likely to change as the
development continues. Please consult the documentation and changelog for more
information.'''
-classifiers = [
+CLASSIFIERS = [
+ 'Programming Language :: Cython',
'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.2',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
'Development Status :: 4 - Beta',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX :: Linux',
@@ -142,22 +178,137 @@ classifiers = [
'Topic :: Multimedia :: Sound/Audio :: Analysis',
]
-setup_args = {
- 'name': 'pyNFFT',
- 'version': version,
- 'author': 'Ghislain Vaillant',
- 'author_email': 'ghisvail at gmail.com',
- 'description': 'A pythonic wrapper around NFFT',
- 'long_description': long_description,
- 'url': 'https://github.com/ghisvail/pyNFFT.git',
- 'classifiers': classifiers,
- 'packages': [package_name],
- 'ext_modules': ext_modules,
- 'include_dirs': include_dirs,
- 'package_data': package_data,
- 'cmdclass': cmdclass,
- 'install_requires': ['numpy'],
-}
+MAJOR = 1
+MINOR = 3
+MICRO = 2
+ISRELEASED = True
+VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
-if __name__ == '__main__':
+# borrowed from scipy
+def git_version():
+ def _minimal_ext_cmd(cmd):
+ # construct minimal environment
+ env = {}
+ for k in ['SYSTEMROOT', 'PATH']:
+ v = os.environ.get(k)
+ if v is not None:
+ env[k] = v
+ # LANGUAGE is used on win32
+ env['LANGUAGE'] = 'C'
+ env['LANG'] = 'C'
+ env['LC_ALL'] = 'C'
+ out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]
+ return out
+
+ try:
+ out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
+ GIT_REVISION = out.strip().decode('ascii')
+ except OSError:
+ GIT_REVISION = "Unknown"
+
+ return GIT_REVISION
+
+# borrowed from scipy
+def get_version_info():
+ FULLVERSION = VERSION
+ if os.path.exists('.git'):
+ GIT_REVISION = git_version()
+ elif os.path.exists('pynfft/version.py'):
+ # must be a source distribution, use existing version file
+ # load it as a separate module in order not to load __init__.py
+ import imp
+ version = imp.load_source('pynfft.version', 'pynfft/version.py')
+ GIT_REVISION = version.git_revision
+ else:
+ GIT_REVISION = "Unknown"
+
+ if not ISRELEASED:
+ FULLVERSION += '.dev-' + GIT_REVISION[:7]
+
+ return FULLVERSION, GIT_REVISION
+
+# borrowed from scipy
+def write_version_py(filename='pynfft/version.py'):
+ cnt = """
+# THIS FILE IS GENERATED FROM SETUP.PY
+short_version = '%(version)s'
+version = '%(version)s'
+full_version = '%(full_version)s'
+git_revision = '%(git_revision)s'
+release = %(isrelease)s
+
+if not release:
+ version = full_version
+"""
+ FULLVERSION, GIT_REVISION = get_version_info()
+
+ f = open(filename, 'w')
+ try:
+ f.write(cnt % {'version': VERSION,
+ 'full_version' : FULLVERSION,
+ 'git_revision' : GIT_REVISION,
+ 'isrelease': str(ISRELEASED)})
+ finally:
+ f.close()
+
+
+def setup_package():
+ # Use setuptools if available
+ try:
+ from setuptools import setup
+ except ImportError:
+ from distutils.core import setup
+
+ # Get current version
+ FULLVERSION, GIT_REVISION = get_version_info()
+
+ # Refresh version file
+ write_version_py()
+
+ # Figure out whether to add ``*_requires = ['numpy']``.
+ build_requires = []
+ try:
+ import numpy
+ except:
+ build_requires = ['numpy>=1.6',]
+
+ # Common setup args
+ setup_args = dict(
+ name = 'pyNFFT',
+ version = FULLVERSION,
+ author = 'Ghislain Vaillant',
+ author_email = 'ghisvail at gmail.com',
+ description = 'A pythonic wrapper around NFFT',
+ long_description = LONG_DESCRIPTION,
+ url = 'https://github.com/ghisvail/pyNFFT.git',
+ cmdclass = cmdclass,
+ classifiers = CLASSIFIERS,
+ platforms=['Linux', 'Unix'],
+ test_suite='nose.collector',
+ setup_requires = build_requires,
+ install_requires = build_requires,
+ )
+
+ if len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
+ sys.argv[1] in ('--help-commands', 'egg_info', '--version',
+ 'clean')):
+ # For these actions, NumPy is not required.
+ pass
+ else:
+ try:
+ from Cython.Distutils import build_ext
+ have_cython = True
+ except:
+ have_cython = False
+ if have_cython:
+ extensions = get_cython_extensions()
+ else:
+ extensions = get_extensions()
+ setup_args['packages'] = ['pynfft', 'pynfft.tests']
+ setup_args['ext_modules'] = extensions
+
setup(**setup_args)
+
+
+if __name__ == '__main__':
+ setup_package()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pynfft.git
More information about the debian-science-commits
mailing list