summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel2018-10-09 14:18:01 -0400
committerGuillaume Horel2018-10-09 14:18:01 -0400
commit610b52017b48508510fc4021e65ad215580de95e (patch)
tree9396b3dd5a5f07521e7568525e6fe73821e5ec03
downloadaur-610b52017b48508510fc4021e65ad215580de95e.tar.gz
initial import
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD38
-rw-r--r--new-api.patch62
3 files changed, 115 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..95f643473278
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = python-pynfft
+ pkgdesc = Python wrapper to the NFFT library.
+ pkgver = 1.3.2
+ pkgrel = 1
+ url = https://arrow.apache.org
+ arch = x86_64
+ license = GPL3
+ makedepends = cython
+ source = https://pypi.org/packages/source/p/pyNFFT/pyNFFT-1.3.2.tar.gz
+ source = new-api.patch
+ sha256sums = ae41e720e569d0d99e3a44c82c36b35a49cfc9ecc23a1cd039fe9e2895aada2c
+ sha256sums = 6eefe82a6e55bf776cd27550cca3317cc55c4062bed97253de192574cbc35dbb
+
+pkgname = python-pynfft
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..665f2182e11b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Guillaume Horel <guillaume.horel@gmail.com>
+
+pkgname='python-pynfft'
+_pkgname='pyNFFT'
+pkgver=1.3.2
+pkgrel=1
+pkgdesc="Python wrapper to the NFFT library."
+arch=('x86_64')
+url="https://arrow.apache.org"
+license=('GPL3')
+checkdepends=()
+optdepends=()
+makedepends=('cython')
+source=("https://pypi.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
+ "new-api.patch")
+sha256sums=('ae41e720e569d0d99e3a44c82c36b35a49cfc9ecc23a1cd039fe9e2895aada2c'
+ '6eefe82a6e55bf776cd27550cca3317cc55c4062bed97253de192574cbc35dbb')
+
+prepare() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ patch -p1 < ../new-api.patch
+}
+
+build(){
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ python setup.py build_ext --inplace
+}
+
+package(){
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ python setup.py build_ext install --root=$pkgdir
+}
+
+check(){
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ python setup.py test
+}
+# vim:ts=2:sw=2:et:
diff --git a/new-api.patch b/new-api.patch
new file mode 100644
index 000000000000..8b68cdf0aaa0
--- /dev/null
+++ b/new-api.patch
@@ -0,0 +1,62 @@
+diff -urN pyNFFT-1.3.2-orig/pynfft/cnfft3util.pxd pyNFFT-1.3.2/pynfft/cnfft3util.pxd
+--- pyNFFT-1.3.2-orig/pynfft/cnfft3util.pxd 2018-10-09 14:10:26.587955305 -0400
++++ pyNFFT-1.3.2/pynfft/cnfft3util.pxd 2018-10-09 14:11:08.556960303 -0400
+@@ -17,7 +17,7 @@
+
+ from cnfft3 cimport fftw_complex
+
+-cdef extern from "nfft3util.h":
++cdef extern from "nfft3.h":
+
+ void nfft_vrand_unit_complex (fftw_complex *x, int n)
+ # Inits a vector of random complex numbers in \
+@@ -25,10 +25,3 @@
+
+ void nfft_vrand_shifted_unit_double (double *x, int n)
+ # Inits a vector of random double numbers in $[-1/2,1/2]$ .
+-
+- void nfft_voronoi_weights_1d (double *w, double *x, int M)
+- # Computes non periodic voronoi weights, \
+- # assumes ordered nodes $x_j$.
+-
+- void nfft_voronoi_weights_S2(double *w, double *xi, int M)
+- # Computes voronoi weights for nodes on the sphere S^2. */
+diff -urN pyNFFT-1.3.2-orig/pynfft/util.pyx pyNFFT-1.3.2/pynfft/util.pyx
+--- pyNFFT-1.3.2-orig/pynfft/util.pyx 2018-10-09 14:10:26.587955305 -0400
++++ pyNFFT-1.3.2/pynfft/util.pyx 2018-10-09 14:10:50.296095301 -0400
+@@ -49,35 +49,3 @@
+ '''
+ nfft_vrand_shifted_unit_double(<double *>&x[0], x.size)
+
+-def voronoi_weights_1d (object[np.float64_t, mode='c'] w not None,
+- object[np.float64_t, mode='c'] x not None):
+- '''
+- Utilitary function for computing density compensation weights from 1D knots.
+-
+- :param w: pre-allocated array
+- :type w: ndarray <float64>
+- :param x: ordered 1D knots
+- :type x: ndarray <float64>
+- '''
+- if x.size != w.size:
+- raise ValueError('Incompatible size between weights and nodes \
+- (%d, %d)'%(w.size, x.size))
+- nfft_voronoi_weights_1d(<double *>&w[0], <double *>&x[0], w.size)
+-
+-def voronoi_weights_S2 (object[np.float64_t, mode='c'] w not None,
+- object[np.float64_t, mode='c'] xi not None):
+- '''
+- Utilitary function for computing density compensation weights from knots
+- located on the surface of a sphere.
+-
+- Useful for reconstruction of 3D radial data.
+-
+- :param w: pre-allocated array
+- :type w: ndarray <float64>
+- :param xi: angular locations (2D) on the unit sphere
+- :type xi: ndarray <float64>
+- '''
+- if xi.size != 2 * w.size:
+- raise ValueError('Incompatible size between weights and nodes \
+- (%d, %d)'%(w.size, xi.size))
+- nfft_voronoi_weights_S2(<double *>&w[0], <double *>&xi[0], w.size)