dev-python/montage-wrapper: Initial import

Package-Manager: portage-2.3.0_rc1
This commit is contained in:
Sébastien Fabbro
2016-06-07 22:00:06 +00:00
parent b439ca6913
commit bd2bae0edf
6 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST montage-wrapper-0.9.8.tar.gz 208240 SHA256 8f7c468f602e3fa38907e481abaede08fbc4cd17faae0b82d86638c0418aa98e SHA512 a9aeb48f86d055448fdfed3a5c3762b554627db10f1374cbd3f7af6002721ae04e9f47828c2084147be40f79c1c4ce6e56568bf61a6cdd78a31ce91de6365ec1 WHIRLPOOL f224a4fe9dba626700e85a78b309f5db0bf1bac26d27457f6f3eb8a53ae58effbe70043c8c1f311029e36e36082540a9da634821df75366056e9ecb7dbc602f1

View File

@@ -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)

View File

@@ -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):

View File

@@ -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'))

View File

@@ -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>

View File

@@ -0,0 +1,51 @@
# 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
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
}