diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/montage-wrapper | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/montage-wrapper')
7 files changed, 192 insertions, 0 deletions
diff --git a/dev-python/montage-wrapper/Manifest b/dev-python/montage-wrapper/Manifest new file mode 100644 index 000000000000..36de7286a043 --- /dev/null +++ b/dev-python/montage-wrapper/Manifest @@ -0,0 +1,8 @@ +AUX montage-wrapper-0.9.8-fix_tests.patch 2291 BLAKE2B 0b5f121acda42c76341b52c52e88fd551021730b89af2239e03a06aaa4c7756624068a5dd71e8e87a921c9661454f1cfc36f839a1ca49b6e1e85614aa4406cb5 SHA512 1466905009a5dadd1f6cf95ab4b97384d2332cac850f61f8766dc7a9b07454fa1c3840e9b5720325db515e36ee8c321610a7ae1c5c24c0272f2f5fe25eafe226 +AUX montage-wrapper-0.9.8-increase_rtol.patch 872 BLAKE2B 7ec522c84cfc987ffe1dba6d893849ab2ccc109e2d8f800c47361108b10ef5dd8b725aaa08522975ef5cea6e82fc6b7f2822dbb5d776ea0f582bd9eecc8ff3a9 SHA512 221f0549abef1a1a7a5d2a6edc47da96c54fecd0fe3d4a762153309523731194bb9254fa352ca88eaa13e0cabeae2913ca5313b2dc4feaba705a9af6df92ff12 +AUX montage-wrapper-0.9.8-use_configparser.patch 533 BLAKE2B c39cd970eae5063c60727d0f35661f5b877ae72ed527d6c28c657f886248c6d4c3e1af4ef87eb73f6a4915746d8a69eedf249e7aec2216235a33af40a173c9b3 SHA512 ed81511da9665429ffbcf2424db7aefa63f0f0a93932380c3685d90918b30a45970f658a8ef69d860c23f216da473884c816b56ffa49d763a620fabf2997c042 +DIST montage-wrapper-0.9.8.tar.gz 208240 BLAKE2B 697eb310207cdf760f1d2ae23a840717817e85ff118886d475c73787aed4a4b644f5ab70d551686a4a746af001321846af76b9c7911ddd24943d30bd5afa128e SHA512 a9aeb48f86d055448fdfed3a5c3762b554627db10f1374cbd3f7af6002721ae04e9f47828c2084147be40f79c1c4ce6e56568bf61a6cdd78a31ce91de6365ec1 +DIST montage-wrapper-0.9.9.tar.gz 187490 BLAKE2B 1c7f06e1c168a96b574ce7a65c99aad9482a523b0c6288e8686410fdd4c9102a27cf098ab5e56895888e17147f20d8c5eb0c8785527543757b6a4166a409e4e0 SHA512 a113a9f1ca03ca158ed6d8a4520c6710804a5ac10bae3dd0c0231390f771479c43f0cdd08e302c59ac1d608c4865d4b0d7a3a233ad068d40d3f1c0efbc343533 +EBUILD montage-wrapper-0.9.8.ebuild 1146 BLAKE2B 648245dcc1c5468183373e59ab949a4a11e8e3d5231ba95f8309dbec55d6b69dda7e73c5d225d842e005eccbffab5e91e667387805da6fe2285e736337a0d655 SHA512 53bea7dd0c18f1cc88aaa90f8891de82717fa0f533ec2d2b5dbf612d750c2ec8c9972f36dda791fd74eddf197a4016827dffe89ace9cadb27cbb80daedc1421f +EBUILD montage-wrapper-0.9.9.ebuild 989 BLAKE2B 909d5d03104f580870d73fa4aeacf4164b3b5c4adab0c72ddd39846355ac367a846b6f762a4cc6ad3d4badc1737b34d2a91cd38252ab06e6d0ba7dddf6e18313 SHA512 4c363a10eb6932ca947501e22132acfd9c92389acc69fdb1c1158c13711cc9c9b1946567428fd2f24ce6a2c3d1b85ee32f3b427f51dde55be6c388561f1166ff +MISC metadata.xml 640 BLAKE2B 45c551a8657052c12d943a5a6ba3a14755574f7e7b1157f5a237a67e5575f07eb4354d3b310b949d7851a4da43d2fd76d724c14bb5d7a7b2a924e84a1234541c SHA512 ebc6b77919fd327e395610b3479a1bb84b2457cdd08ba850a0e9098b95284705fea84092eeb2322e51686dd8214cd281b681cbc8d28bc0d99068f73ca685cb83 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}" +} |