diff options
Diffstat (limited to 'dev-python/montage-wrapper')
7 files changed, 193 insertions, 0 deletions
diff --git a/dev-python/montage-wrapper/Manifest b/dev-python/montage-wrapper/Manifest new file mode 100644 index 000000000000..7a4980f53747 --- /dev/null +++ b/dev-python/montage-wrapper/Manifest @@ -0,0 +1,9 @@ +AUX montage-wrapper-0.9.8-fix_tests.patch 2291 SHA256 f2e6bdf8db4fbd86ad8741669e025ecdcc62561664b93af2c33aad0205d53558 SHA512 1466905009a5dadd1f6cf95ab4b97384d2332cac850f61f8766dc7a9b07454fa1c3840e9b5720325db515e36ee8c321610a7ae1c5c24c0272f2f5fe25eafe226 WHIRLPOOL 5765a9209936bd55a15fe70573b68c439a1fbccf3a6f623e74b24fa4ba798790f2a4735af31c2198ae3bb68b740b5e0b0c48291901e0b3187bc39f27f2d36430 +AUX montage-wrapper-0.9.8-increase_rtol.patch 872 SHA256 045944645b1eb9e96e9770caee05a59944a5972156bcdcdbbb5cd5d6933a4913 SHA512 221f0549abef1a1a7a5d2a6edc47da96c54fecd0fe3d4a762153309523731194bb9254fa352ca88eaa13e0cabeae2913ca5313b2dc4feaba705a9af6df92ff12 WHIRLPOOL 8322d82484289408beaf1fe9f6460df51b1ce3bff55a6506d234373aa51b265c5c1c2c7e56bf94161ba1f27db676aef78e86a173e51f73d20cd4c9f1880bf775 +AUX montage-wrapper-0.9.8-use_configparser.patch 533 SHA256 2c12993a2f59dc9bfeb423a4cc2e1332c4251e6f049ec5b0435f4e2f0e4d16f5 SHA512 ed81511da9665429ffbcf2424db7aefa63f0f0a93932380c3685d90918b30a45970f658a8ef69d860c23f216da473884c816b56ffa49d763a620fabf2997c042 WHIRLPOOL aa3121835b13a1b9114f63e5d88255d6eeaaf7271ebeface7f1268d0f382eab1e341b5af2f114d40fe9f80949c0347ba377ea9144bbfd1879c361e9d083ad48b +DIST montage-wrapper-0.9.8.tar.gz 208240 SHA256 8f7c468f602e3fa38907e481abaede08fbc4cd17faae0b82d86638c0418aa98e SHA512 a9aeb48f86d055448fdfed3a5c3762b554627db10f1374cbd3f7af6002721ae04e9f47828c2084147be40f79c1c4ce6e56568bf61a6cdd78a31ce91de6365ec1 WHIRLPOOL f224a4fe9dba626700e85a78b309f5db0bf1bac26d27457f6f3eb8a53ae58effbe70043c8c1f311029e36e36082540a9da634821df75366056e9ecb7dbc602f1 +DIST montage-wrapper-0.9.9.tar.gz 187490 SHA256 cdf7722297c95ef0c3065de96636d467cb9db4049298f4df10957d209e64a724 SHA512 a113a9f1ca03ca158ed6d8a4520c6710804a5ac10bae3dd0c0231390f771479c43f0cdd08e302c59ac1d608c4865d4b0d7a3a233ad068d40d3f1c0efbc343533 WHIRLPOOL 7c669455641c11963f0da97fa210efb41324dfba9ffa49f45e68b0ca96747472d1024b56e2a851043eb19362d5e4421e16e17b1cd1b1aabfb6f73d8ea1302ec7 +EBUILD montage-wrapper-0.9.8.ebuild 1146 SHA256 0b65422b7d343972ae2a73b70a6855195d894990f0857c6684e5ea8a76248fc4 SHA512 53bea7dd0c18f1cc88aaa90f8891de82717fa0f533ec2d2b5dbf612d750c2ec8c9972f36dda791fd74eddf197a4016827dffe89ace9cadb27cbb80daedc1421f WHIRLPOOL dafff3d468aa0702147c2a92e3a887558708062afc2b3648c7d85bcb208715b638a06838ada53782c78913c462538b8c42eb4edc9895322f7c988b73aa5b0a01 +EBUILD montage-wrapper-0.9.9.ebuild 989 SHA256 338c4cac8f34d18319140e2ec2dc9f66b51b3da51e6152b8afacb6e8fd88e0f6 SHA512 4c363a10eb6932ca947501e22132acfd9c92389acc69fdb1c1158c13711cc9c9b1946567428fd2f24ce6a2c3d1b85ee32f3b427f51dde55be6c388561f1166ff WHIRLPOOL 182c2fbd910c1b92e5cb38ddd838b89d10f88c37021cf2ea82f3f097392bcc91b9e87a0508a83b0a82ab39de2a2aa8a831b18a3e2c01cf2f885421e80a5e7be3 +MISC ChangeLog 498 SHA256 b94e7e8dd9b9bd4071fa79f7093f6c9b50bb83be284ecab9c2c2c3a1ceac1145 SHA512 14ed7e7222e1f95102ce48262ec470d6d57fcf0ac35f14c57dea163adc531ddbaca221ee095e2c3c3417daa88ee06ab78d90877b08fd0ccd6b3a60b96ef76daf WHIRLPOOL 9bcf4cccb5bb90cd7f8e7929c2189f21c89b1e61793ae9af9ade6eee8e8de55485d02fb53769745f1e538b6d3e34973dbd369965c41825324c55596a3de0fb4f +MISC metadata.xml 640 SHA256 6c36256138a24f35e784d6c5a84c3f610a91c21eca27890a1df0f26accee2bd3 SHA512 ebc6b77919fd327e395610b3479a1bb84b2457cdd08ba850a0e9098b95284705fea84092eeb2322e51686dd8214cd281b681cbc8d28bc0d99068f73ca685cb83 WHIRLPOOL 2671fa929850062dc33194cc893dd0b027ab0661e024e5abf76a9ee23d0c413f5185ddf0f50846b8c996356b560413b5697e23cc463eb6f16390359115b65018 diff --git a/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-fix_tests.patch b/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-fix_tests.patch new file mode 100644 index 000000000000..8d611b72f81a --- /dev/null +++ b/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-fix_tests.patch @@ -0,0 +1,40 @@ +Author: Ole Streicher <olebole@debian.org> +Description: Make sure that opened FITS files are closed after the test +--- a/montage_wrapper/tests/test_wrappers.py ++++ b/montage_wrapper/tests/test_wrappers.py +@@ -46,21 +46,21 @@ + + def test_mosaic(self): + mosaic(os.path.join(self.tmpdir, 'raw'),os.path.join(self.tmpdir, 'mosaic'), hdu=0) +- hdu = fits.open(os.path.join(self.tmpdir, 'mosaic', 'mosaic.fits'))[0] +- assert hdu.data.shape == (288, 282) +- valid = hdu.data[~np.isnan(hdu.data)] +- assert len(valid) == 65029 +- assert_allclose(np.std(valid), 0.12658458001333581, 1e-5) +- assert_allclose(np.mean(valid), 0.4995945318627074, 1e-5) +- assert_allclose(np.median(valid), 0.5003376603126526, 1e-5) ++ with fits.open(os.path.join(self.tmpdir, 'mosaic', 'mosaic.fits')) as hdu: ++ assert hdu[0].data.shape == (288, 282) ++ valid = hdu[0].data[~np.isnan(hdu[0].data)] ++ assert len(valid) == 65029 ++ assert_allclose(np.std(valid), 0.12658458001333581, 1e-5) ++ assert_allclose(np.mean(valid), 0.4995945318627074, 1e-5) ++ assert_allclose(np.median(valid), 0.5003376603126526, 1e-5) + + @pytest.mark.xfail() # results are not consistent on different machines + def test_mosaic_background_match(self): + mosaic(os.path.join(self.tmpdir, 'raw'),os.path.join(self.tmpdir, 'mosaic_bkgmatch'), background_match=True) +- hdu = fits.open(os.path.join(self.tmpdir, 'mosaic_bkgmatch', 'mosaic.fits'))[0] +- assert hdu.data.shape == (288, 282) +- valid = hdu.data[~np.isnan(hdu.data)] +- assert len(valid) == 65029 +- assert_allclose(np.std(valid), 0.12661606622654725) +- assert_allclose(np.mean(valid), 0.4994805202294361) +- assert_allclose(np.median(valid), 0.5002447366714478) ++ with fits.open(os.path.join(self.tmpdir, 'mosaic_bkgmatch', 'mosaic.fits')) as hdu: ++ assert hdu[0].data.shape == (288, 282) ++ valid = hdu[0].data[~np.isnan(hdu[0].data)] ++ assert len(valid) == 65029 ++ assert_allclose(np.std(valid), 0.12661606622654725) ++ assert_allclose(np.mean(valid), 0.4994805202294361) ++ assert_allclose(np.median(valid), 0.5002447366714478) diff --git a/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-increase_rtol.patch b/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-increase_rtol.patch new file mode 100644 index 000000000000..285b525a4df5 --- /dev/null +++ b/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-increase_rtol.patch @@ -0,0 +1,17 @@ +Author: Ole Streicher <olebole@debian.org> +Description: Increase rtol of asserts to let the tests succeed with montage-4.0 +--- a/montage_wrapper/tests/test_wrappers.py ++++ b/montage_wrapper/tests/test_wrappers.py +@@ -50,9 +50,9 @@ + assert hdu.data.shape == (288, 282) + valid = hdu.data[~np.isnan(hdu.data)] + assert len(valid) == 65029 +- assert_allclose(np.std(valid), 0.12658458001333581) +- assert_allclose(np.mean(valid), 0.4995945318627074) +- assert_allclose(np.median(valid), 0.5003376603126526) ++ assert_allclose(np.std(valid), 0.12658458001333581, 1e-5) ++ assert_allclose(np.mean(valid), 0.4995945318627074, 1e-5) ++ assert_allclose(np.median(valid), 0.5003376603126526, 1e-5) + + @pytest.mark.xfail() # results are not consistent on different machines + def test_mosaic_background_match(self): diff --git a/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-use_configparser.patch b/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-use_configparser.patch new file mode 100644 index 000000000000..082c3678e125 --- /dev/null +++ b/dev-python/montage-wrapper/files/montage-wrapper-0.9.8-use_configparser.patch @@ -0,0 +1,18 @@ +Author: Vincent Prat <vinceprat@free.fr> +Description: Use ConfigParser module instead of the one embedded in distutils.config +--- a/setup.py ++++ b/setup.py +@@ -21,8 +21,11 @@ + from astropy_helpers.version_helpers import generate_version_py + + # Get some values from the setup.cfg +-from distutils import config +-conf = config.ConfigParser() ++try: ++ from configparser import ConfigParser ++except: ++ from ConfigParser import ConfigParser ++conf = ConfigParser() + conf.read(['setup.cfg']) + metadata = dict(conf.items('metadata')) + diff --git a/dev-python/montage-wrapper/metadata.xml b/dev-python/montage-wrapper/metadata.xml new file mode 100644 index 000000000000..aa3e481c13e8 --- /dev/null +++ b/dev-python/montage-wrapper/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>sci-astronomy@gentoo.org</email> + <name>Gentoo Astronomy Project</name> + </maintainer> + <longdescription> + This Astropy-affiliated package provides a python wrapper to the + Montage Astronomical Image Mosaic Engine, including both functions to + access individual Montage commands, and high-level functions to + facilitate mosaicking and re-projecting. +</longdescription> + <upstream> + <remote-id type="pypi">montage-wrapper</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/montage-wrapper/montage-wrapper-0.9.8.ebuild b/dev-python/montage-wrapper/montage-wrapper-0.9.8.ebuild new file mode 100644 index 000000000000..4dfca3796e6c --- /dev/null +++ b/dev-python/montage-wrapper/montage-wrapper-0.9.8.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) + +inherit distutils-r1 + +DESCRIPTION="Python wrapper for the Montage mosaicking toolkit" +HOMEPAGE="http://www.astropy.org/montage-wrapper/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="doc test" + +RDEPEND=" + dev-python/astropy[${PYTHON_USEDEP}] + sci-astronomy/montage" +DEPEND=" + dev-python/astropy[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( sci-astronomy/montage )" + +PATCHES=( + "${FILESDIR}/${P}-increase_rtol.patch" + "${FILESDIR}/${P}-fix_tests.patch" + "${FILESDIR}/${P}-use_configparser.patch" +) + +python_prepare_all() { + # use system astropy-helpers instead of bundled one + sed -i -e '/auto_use/s/True/False/' setup.cfg || die + distutils-r1_python_prepare_all +} + +python_compile_all() { + use doc && PYTHONPATH=".." emake -C docs html +} + +python_test() { + ${EPYTHON} setup.py test +} + +python_install_all() { + use doc && HTML_DOCS=( docs/_build/html/. ) + distutils-r1_python_install_all +} diff --git a/dev-python/montage-wrapper/montage-wrapper-0.9.9.ebuild b/dev-python/montage-wrapper/montage-wrapper-0.9.9.ebuild new file mode 100644 index 000000000000..409d24f27653 --- /dev/null +++ b/dev-python/montage-wrapper/montage-wrapper-0.9.9.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} ) + +inherit distutils-r1 + +DESCRIPTION="Python wrapper for the Montage mosaicking toolkit" +HOMEPAGE="http://www.astropy.org/montage-wrapper/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="doc test" + +RDEPEND=" + dev-python/astropy[${PYTHON_USEDEP}] + sci-astronomy/montage" +DEPEND=" + dev-python/astropy[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( sci-astronomy/montage )" + +python_prepare_all() { + # use system astropy-helpers instead of bundled one + sed -i -e '/auto_use/s/True/False/' setup.cfg || die + distutils-r1_python_prepare_all +} + +python_compile_all() { + if use doc; then + PYTHONPATH=".." emake -C docs html + HTML_DOCS=( docs/_build/html/. ) + fi +} + +python_test() { + esetup.py test || die "tests failed with ${EPYTHON}" +} |