diff options
author | Erich Eckner <git@eckner.net> | 2018-02-23 10:02:01 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-02-23 10:02:01 +0100 |
commit | 4e01fe7c8cefa3032f6fac136af78957fc8da0cf (patch) | |
tree | cf7c2b944ad12f5def1b448b1fd1b50f28cd69b8 | |
parent | b33d2366efd042c4aa2b420ec4aa504855cea6cc (diff) | |
download | archlinuxewe-4e01fe7c8cefa3032f6fac136af78957fc8da0cf.tar.xz |
python2-lmfit -> python-lmfit
-rw-r--r-- | python-lmfit/PKGBUILD | 60 | ||||
-rw-r--r-- | python-lmfit/test.patch | 30 | ||||
-rw-r--r-- | python2-lmfit/PKGBUILD | 32 |
3 files changed, 90 insertions, 32 deletions
diff --git a/python-lmfit/PKGBUILD b/python-lmfit/PKGBUILD new file mode 100644 index 000000000..54f41a40f --- /dev/null +++ b/python-lmfit/PKGBUILD @@ -0,0 +1,60 @@ +# Contributor: Francois Boulogne <fboulogne at april dot org> +# Maintainer: Erich Eckner <arch at eckner dot net> + +pkgbase=python-lmfit +pkgname=('python-lmfit' 'python2-lmfit') +pkgver=0.9.8 +pkgrel=1 +pkgdesc="Least-Squares Minimization with Constraints for Python" +arch=('any') +url="http://lmfit.github.io/lmfit-py/" +license=('BSD') +_depends=('python' 'python-numpy' 'python-scipy') +makedepends=( + "${_depends[@]}" "${_depends[@]/python/python2}" + 'python-setuptools' 'python2-setuptools' + ) +checkdepends=( + 'python-nose' 'python2-nose' + ) +source=("https://github.com/lmfit/lmfit-py/archive/${pkgver}.tar.gz" + 'test.patch') +sha512sums=('2a73acf1d2b700a5641f5393e079d56f7f43d3160a48fe0bce9beafbec0cce5e7954c4e2d343aadba1f832c0c816466f7be8ea94dab19a4a8ad82279419f1c68' + '779bbd1d71d7e15ce740fb3bdfaffb044912e1c2bc790732f9be101af2771c00ca00d21defd10fafd98694f42ffcaacff29e856060b27be1877a329a8a4449c7') + +prepare() { + cd "${srcdir}/lmfit-py-${pkgver}" + patch -p1 -i "${srcdir}/test.patch" + cd "${srcdir}" + cp -a "lmfit-py-${pkgver}" "lmfit-py2-${pkgver}" +} + +build() { + cd "$srcdir/lmfit-py-$pkgver" + python setup.py build + + cd "$srcdir/lmfit-py2-$pkgver" + python2 setup.py build +} + +check() { + cd "$srcdir/lmfit-py-$pkgver" + nosetests3 tests + + cd "$srcdir/lmfit-py2-$pkgver" + nosetests2 tests +} + +package_python-lmfit(){ + depends=("${_depends[@]}") + cd "$srcdir/lmfit-py-$pkgver" + python setup.py install --root="$pkgdir/" --optimize=1 +} + +package_python2-lmfit(){ + depends=("${_depends[@]/python/python2}") + cd "$srcdir/lmfit-py2-$pkgver" + python2 setup.py install --root="$pkgdir/" --optimize=1 +} + +# vim:ts=2:sw=2:et: diff --git a/python-lmfit/test.patch b/python-lmfit/test.patch new file mode 100644 index 000000000..603fc8707 --- /dev/null +++ b/python-lmfit/test.patch @@ -0,0 +1,30 @@ +--- a/tests/test_saveload.py 2018-02-11 15:08:45.000000000 +0100 ++++ b/tests/test_saveload.py 2018-02-23 09:41:17.335712453 +0100 +@@ -14,7 +14,7 @@ + except ImportError: + DILL_AVAILABLE = False + +-dat = np.loadtxt(os.path.join('..', 'examples', 'NIST_Gauss2.dat')) ++dat = np.loadtxt(os.path.join(os.path.dirname(__file__), '..', 'examples', 'NIST_Gauss2.dat')) + XDAT = dat[:, 1] + YDAT = dat[:, 0] + +--- a/tests/test_height_fwhm.py 2018-02-11 15:08:45.000000000 +0100 ++++ b/tests/test_height_fwhm.py 2018-02-23 09:41:41.030806931 +0100 +@@ -8,6 +8,7 @@ + from scipy.optimize import fsolve + import sys + ++import os + + # Turn off plotting if run by nosetests. + WITHPLOT = True +@@ -76,7 +76,7 @@ + # sigma = np.sqrt(variance) + # x = np.linspace(mu - 20*sigma, mu + 20*sigma, 100.0) + # y = norm.pdf(x, mu, 1) +- data = np.loadtxt('../examples/test_peak.dat') ++ data = np.loadtxt(os.path.join(os.path.dirname(__file__), '..', 'examples', 'test_peak.dat')) + x = data[:, 0] + y = data[:, 1] + check_height_fwhm(x, y, lineshapes.voigt, models.VoigtModel()) diff --git a/python2-lmfit/PKGBUILD b/python2-lmfit/PKGBUILD deleted file mode 100644 index ec9171474..000000000 --- a/python2-lmfit/PKGBUILD +++ /dev/null @@ -1,32 +0,0 @@ -# Contributor: Francois Boulogne <fboulogne at april dot org> -# Maintainer: Erich Eckner <arch at eckner dot net> - -pkgname=python2-lmfit -pkgver=0.9.7 -pkgrel=1 -pkgdesc="Least-Squares Minimization with Constraints for Python" -arch=('any') -url="http://lmfit.github.io/lmfit-py/" -license=('BSD') -depends=('python2' 'python2-numpy' 'python2-scipy') -makedepends=('python2-setuptools') -checkdepends=('python2-nose') -source=(https://github.com/lmfit/lmfit-py/archive/${pkgver}.tar.gz) - -build() { - cd "$srcdir/lmfit-py-$pkgver" - python2 setup.py build -} - -check() { - cd "$srcdir/lmfit-py-$pkgver" - nosetests2 tests -} - -package(){ - cd "$srcdir/lmfit-py-$pkgver" - python2 setup.py install --root="$pkgdir/" --optimize=1 -} - -# vim:ts=2:sw=2:et: -sha512sums=('c55c220b10b3734fd47757ed5b35c4052cbbe5310024ecbaf391b7144a84590fc11bca87a5f57a99cf6a1eb2d6f8ba8460f977a84356472fa03c117dc2c0e1b9') |