From 32a6ebaa2e0289e627c604ccf6808328af555690 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Fabbro?= Date: Wed, 9 Mar 2016 23:17:07 +0000 Subject: [PATCH] dev-python/astroscrappy: initial import Package-Manager: portage-2.2.27 --- dev-python/astroscrappy/Manifest | 1 + .../astroscrappy/astroscrappy-1.0.3.ebuild | 58 ++++++++++ ...troscrappy-1.0.3-dont-install-binary.patch | 14 +++ .../astroscrappy-1.0.3-endian-fix-tests.patch | 100 ++++++++++++++++++ .../astroscrappy-1.0.3-numpy-fix-tests.patch | 21 ++++ ...astroscrappy-1.0.3-respect-user-flag.patch | 35 ++++++ dev-python/astroscrappy/metadata.xml | 16 +++ 7 files changed, 245 insertions(+) create mode 100644 dev-python/astroscrappy/Manifest create mode 100644 dev-python/astroscrappy/astroscrappy-1.0.3.ebuild create mode 100644 dev-python/astroscrappy/files/astroscrappy-1.0.3-dont-install-binary.patch create mode 100644 dev-python/astroscrappy/files/astroscrappy-1.0.3-endian-fix-tests.patch create mode 100644 dev-python/astroscrappy/files/astroscrappy-1.0.3-numpy-fix-tests.patch create mode 100644 dev-python/astroscrappy/files/astroscrappy-1.0.3-respect-user-flag.patch create mode 100644 dev-python/astroscrappy/metadata.xml diff --git a/dev-python/astroscrappy/Manifest b/dev-python/astroscrappy/Manifest new file mode 100644 index 000000000000..bf4e65b949d3 --- /dev/null +++ b/dev-python/astroscrappy/Manifest @@ -0,0 +1 @@ +DIST astroscrappy-1.0.3.tar.gz 422209 SHA256 843af0ec1fb7439a886f05690a52d96342c3bd505dfdef42e922a66b67a89776 SHA512 2e96e8e62f81c770802a3c7699ca4455c640bb000aa4bffc22149745eed4e7e33cc4b297649020a601ff7fb242c0545cf9391c19ee2687adab26ac494d37dbb2 WHIRLPOOL 8ee318233639617608a4c4aea0a75227317f3ca695430c49882a1396178eb3655bd80169291de2631c752c81d41016dcda85653eb1caa372cfd7c0d49080fd67 diff --git a/dev-python/astroscrappy/astroscrappy-1.0.3.ebuild b/dev-python/astroscrappy/astroscrappy-1.0.3.ebuild new file mode 100644 index 000000000000..97478225956b --- /dev/null +++ b/dev-python/astroscrappy/astroscrappy-1.0.3.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) + +inherit distutils-r1 toolchain-funcs flag-o-matic + +DESCRIPTION="Optimized cosmic ray annihilation astropy python module" +HOMEPAGE="https://github.com/astropy/astroscrappy" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" + +LICENSE="BSD" +SLOT="0" +IUSE="doc openmp test" + +RDEPEND=" + dev-python/astropy[${PYTHON_USEDEP}] + dev-python/astropy-helpers[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] + sci-libs/scipy[${PYTHON_USEDEP}]" + +DEPEND="${RDEPEND} + dev-python/cython[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) + test? ( dev-python/pytest[${PYTHON_USEDEP}] )" + +PATCHES=( + "${FILESDIR}/${P}-dont-install-binary.patch" + "${FILESDIR}/${P}-endian-fix-tests.patch" + "${FILESDIR}/${P}-numpy-fix-tests.patch" + "${FILESDIR}/${P}-respect-user-flag.patch" +) + +DOCS=( CHANGES.rst ) + +python_prepare_all() { + sed -i -e '/auto_use/s/True/False/' setup.cfg || die + use openmp && tc-has-openmp && append-flags -fopenmp + distutils-r1_python_prepare_all +} + +python_compile_all() { + use doc && esetup.py build_sphinx +} + +python_test() { + esetup.py test +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/html/. ) + distutils-r1_python_install_all +} diff --git a/dev-python/astroscrappy/files/astroscrappy-1.0.3-dont-install-binary.patch b/dev-python/astroscrappy/files/astroscrappy-1.0.3-dont-install-binary.patch new file mode 100644 index 000000000000..4c69f00cc88d --- /dev/null +++ b/dev-python/astroscrappy/files/astroscrappy-1.0.3-dont-install-binary.patch @@ -0,0 +1,14 @@ +Author: Ole Streicher +Description: Don't install example/template binary +--- a/setup.py ++++ b/setup.py +@@ -80,9 +80,6 @@ + + # Define entry points for command-line scripts + entry_points = {} +-entry_points['console_scripts'] = [ +- 'astropy-package-template-example = packagename.example_mod:main', +-] + + # Include all .c files, recursively, including those generated by + # Cython, since we can not do this in MANIFEST.in with a "dynamic" diff --git a/dev-python/astroscrappy/files/astroscrappy-1.0.3-endian-fix-tests.patch b/dev-python/astroscrappy/files/astroscrappy-1.0.3-endian-fix-tests.patch new file mode 100644 index 000000000000..7a2bbb6299c6 --- /dev/null +++ b/dev-python/astroscrappy/files/astroscrappy-1.0.3-endian-fix-tests.patch @@ -0,0 +1,100 @@ +From 5b5ce99c63d03e60b6027f09f72231db11a87bf2 Mon Sep 17 00:00:00 2001 +From: Curtis McCully +Date: Thu, 3 Dec 2015 12:02:38 -0800 +Subject: [PATCH] Made tests not endian specific. +--- a/astroscrappy/tests/test_utils.py ++++ b/astroscrappy/tests/test_utils.py +@@ -56,7 +56,7 @@ + + + def test_medfilt5(): +- a = np.ascontiguousarray(np.random.random((1001, 1001))).astype(' +Description: Cast the numpy arrays in the test to the same data type +Bug: https://ci.debian.net/data/packages/unstable/amd64/a/astroscrappy/20160112_151253.autopkgtest.log.gz +--- a/astroscrappy/tests/test_astroscrappy.py ++++ b/astroscrappy/tests/test_astroscrappy.py +@@ -36,7 +36,7 @@ + imdata += gaussian(imdata.shape, x, y, brightness, 3.5) + + # Add the poisson noise +-imdata = np.random.poisson(imdata) ++imdata = np.float32(np.random.poisson(imdata)) + + # Add readnoise + imdata += np.random.normal(0.0, 10.0, size=(1001, 1001)) +@@ -60,4 +60,4 @@ + # contrast that we can turn our detection threshold up. + mask, _clean = detect_cosmics(imdata, readnoise=10., gain=1.0, + sigclip=6, sigfrac=1.0) +- assert (mask == expected_crmask).sum() == (1001 * 1001) +\ No newline at end of file ++ assert (mask == expected_crmask).sum() == (1001 * 1001) diff --git a/dev-python/astroscrappy/files/astroscrappy-1.0.3-respect-user-flag.patch b/dev-python/astroscrappy/files/astroscrappy-1.0.3-respect-user-flag.patch new file mode 100644 index 000000000000..fb7bca64ce7f --- /dev/null +++ b/dev-python/astroscrappy/files/astroscrappy-1.0.3-respect-user-flag.patch @@ -0,0 +1,35 @@ +--- astroscrappy/astroscrappy/utils/setup_package.py.orig 2016-03-09 22:50:34.304043122 +0000 ++++ astroscrappy/astroscrappy/utils/setup_package.py 2016-03-09 22:54:53.560783823 +0000 +@@ -43,30 +43,11 @@ + sources=med_sources, + include_dirs=include_dirs, + libraries=libraries, +- language="c", +- extra_compile_args=['-g', '-O3', '-funroll-loops', +- '-ffast-math']) ++ language="c") + ext_im = Extension(name=str("astroscrappy.utils.image_utils"), + sources=im_sources, + include_dirs=include_dirs, + libraries=libraries, +- language="c", +- extra_compile_args=['-g', '-O3', '-funroll-loops', +- '-ffast-math']) +- +- has_openmp, outputs = check_openmp() +- if has_openmp: +- ext_med.extra_compile_args.append('-fopenmp') +- ext_im.extra_compile_args.append('-fopenmp') +- ext_med.extra_link_args = ['-g', '-fopenmp'] +- ext_im.extra_link_args = ['-g', '-fopenmp'] +- else: +- log.warn('OpenMP was not found. ' +- 'astroscrappy will be compiled without OpenMP. ' +- '(Use the "-v" option of setup.py for more details.)') +- log.debug(('(Start of OpenMP info)\n' +- 'compiler stdout:\n{0}\n' +- 'compiler stderr:\n{1}\n' +- '(End of OpenMP info)').format(*outputs)) ++ language="c") + + return [ext_med, ext_im] diff --git a/dev-python/astroscrappy/metadata.xml b/dev-python/astroscrappy/metadata.xml new file mode 100644 index 000000000000..4b2263cd8f74 --- /dev/null +++ b/dev-python/astroscrappy/metadata.xml @@ -0,0 +1,16 @@ + + + + + sci-astronomy@gentoo.org + Gentoo Astronomy Project + + + ccdproc is a AstroPy-affliated package for the basic reduction of + CCD images. It provides a framework for accounting for error propagation + and bad pixel tracking through the reduction steps. + + + ccdproc + + -- 2.26.2