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/spectral-cube | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/spectral-cube')
-rw-r--r-- | dev-python/spectral-cube/Manifest | 4 | ||||
-rw-r--r-- | dev-python/spectral-cube/files/spectral-cube-0.4.0-looseversion.patch | 139 | ||||
-rw-r--r-- | dev-python/spectral-cube/metadata.xml | 19 | ||||
-rw-r--r-- | dev-python/spectral-cube/spectral-cube-0.4.0.ebuild | 51 |
4 files changed, 213 insertions, 0 deletions
diff --git a/dev-python/spectral-cube/Manifest b/dev-python/spectral-cube/Manifest new file mode 100644 index 000000000000..e8332a9010b4 --- /dev/null +++ b/dev-python/spectral-cube/Manifest @@ -0,0 +1,4 @@ +AUX spectral-cube-0.4.0-looseversion.patch 6250 BLAKE2B 8ac525adbe36563ca793f2d628977551387271e129905523506e1eb126ce288a936fc14da615c388e2ee0ed632499e056fae81bc53c6524977c97d06b6df7cea SHA512 caaec6f1e405e6986a148495be716e120ac8a6abb0738d7f1906efde4d4097966b10fce73dd8b538b3ea616a5245ffb1b876c1a16ad85e2362206b7d0d52ffdb +DIST spectral-cube-0.4.0.tar.gz 290453 BLAKE2B 3e41ca0e6d925e36269c638aabc9e4df70ac8abf9ac2a59c4425435bbcb2d0b9b1ec1140e47828d597665a0164dc7c0b88d929762ca5c7bf72b5b16aa31f97d1 SHA512 20970d1be0d836bd07ea96ee909300f28eaf2ab4ded7b4525eb68399d242b864fe93120a16ef2ef35eba5f547c0cbe90b07c27ef44ab1910dbbe97230fbab84e +EBUILD spectral-cube-0.4.0.ebuild 1224 BLAKE2B f62c8c3887f33e290e81f0541c6bcafdf3672aa1c1c2a51fc2fa5967f24677cc2d7fd7c1e265eb0ea501ed5cb3ef0a5076272017abfca3c284b84f59ca78d054 SHA512 6018fe52f2e7f570da8326420ae1a83d1fa9c65ae9104bcfa96a7bbda1af4de6fcf4103ab1cf520f7d34ae8cea87c27148c92670dd436876db426c894fe58e55 +MISC metadata.xml 773 BLAKE2B ed1f11a1efd762bc880b9d10d40780c8876c6d6a2216ad0617d9219db1fa9e56b2ea1aa05a653fd613715703f12320df349fdd1ed2b1331972ca6c7773a9b717 SHA512 407cdc09e494af2429bf809dc946bc7e05c300e9e4cbad68e75021628f2cfc187561c3a183081cf13cb7b892631d2bceebd5ae0a0109957a1936ec64ea4f6d4f diff --git a/dev-python/spectral-cube/files/spectral-cube-0.4.0-looseversion.patch b/dev-python/spectral-cube/files/spectral-cube-0.4.0-looseversion.patch new file mode 100644 index 000000000000..42147de559a5 --- /dev/null +++ b/dev-python/spectral-cube/files/spectral-cube-0.4.0-looseversion.patch @@ -0,0 +1,139 @@ +From: Ole Streicher <olebole@debian.org> +Date: Tue, 12 Jul 2016 08:54:59 +0200 +Subject: Use LooseVersion instead of StrictVersion. + +StrictVersion fails on numpy RCs. LooseVersion is a compromise until something better is available. +--- + spectral_cube/np_compat.py | 4 ++-- + spectral_cube/spectral_cube.py | 4 ++-- + spectral_cube/tests/test_masks.py | 4 ++-- + spectral_cube/tests/test_moments.py | 4 ++-- + spectral_cube/tests/test_spectral_cube.py | 10 +++++----- + 5 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/spectral_cube/np_compat.py b/spectral_cube/np_compat.py +index e72b4d9..dd9080a 100644 +--- a/spectral_cube/np_compat.py ++++ b/spectral_cube/np_compat.py +@@ -1,7 +1,7 @@ + from __future__ import print_function, absolute_import, division + + import numpy as np +-from distutils.version import StrictVersion ++from distutils.version import LooseVersion + + def allbadtonan(function): + """ +@@ -11,7 +11,7 @@ def allbadtonan(function): + """ + def f(data, axis=None): + result = function(data, axis=axis) +- if StrictVersion(np.__version__) >= StrictVersion('1.9.0'): ++ if LooseVersion(np.__version__) >= LooseVersion('1.9.0'): + if axis is None: + if np.all(np.isnan(data)): + return np.nan +diff --git a/spectral_cube/spectral_cube.py b/spectral_cube/spectral_cube.py +index 231245d..fa61119 100644 +--- a/spectral_cube/spectral_cube.py ++++ b/spectral_cube/spectral_cube.py +@@ -34,7 +34,7 @@ from .lower_dimensional_structures import (Projection, Slice, OneDSpectrum, + LowerDimensionalObject) + from .base_class import BaseNDClass, SpectralAxisMixinClass, DOPPLER_CONVENTIONS + +-from distutils.version import StrictVersion ++from distutils.version import LooseVersion + + __all__ = ['SpectralCube', 'VaryingResolutionSpectralCube'] + +@@ -2072,7 +2072,7 @@ class BaseSpectralCube(BaseNDClass, SpectralAxisMixinClass): + import yt + + if ('dev' in yt.__version__ or +- StrictVersion(yt.__version__) >= StrictVersion('3.0')): ++ LooseVersion(yt.__version__) >= LooseVersion('3.0')): + + from yt.frontends.fits.api import FITSDataset + from yt.units.unit_object import UnitParseError +diff --git a/spectral_cube/tests/test_masks.py b/spectral_cube/tests/test_masks.py +index 9116cb3..42a2125 100644 +--- a/spectral_cube/tests/test_masks.py ++++ b/spectral_cube/tests/test_masks.py +@@ -14,7 +14,7 @@ from .. import (BooleanArrayMask, SpectralCube, LazyMask, LazyComparisonMask, + FunctionMask, CompositeMask) + from ..masks import is_broadcastable_and_smaller, dims_to_skip, view_of_subset + +-from distutils.version import StrictVersion ++from distutils.version import LooseVersion + + + def test_spectral_cube_mask(): +@@ -370,7 +370,7 @@ def test_flat_mask(): + assert np.all(cube.sum(axis=0)[mask_array] == mcube.sum(axis=0)[mask_array]) + assert np.all(np.isnan(mcube.sum(axis=0)[~mask_array])) + +-@pytest.mark.skipif(StrictVersion(np.__version__) < StrictVersion('1.7'), ++@pytest.mark.skipif(LooseVersion(np.__version__) < LooseVersion('1.7'), + reason='Numpy <1.7 does not support multi-slice indexing.') + def test_flat_mask_spectral(): + cube, data = cube_and_raw('adv.fits') +diff --git a/spectral_cube/tests/test_moments.py b/spectral_cube/tests/test_moments.py +index 9b118fd..82eff40 100644 +--- a/spectral_cube/tests/test_moments.py ++++ b/spectral_cube/tests/test_moments.py +@@ -1,7 +1,7 @@ + from __future__ import print_function, absolute_import, division + + import warnings +-from distutils.version import StrictVersion ++from distutils.version import LooseVersion + + import pytest + import numpy as np +@@ -78,7 +78,7 @@ axis_order = pytest.mark.parametrize(('axis', 'order'), + (1, 0), (1, 1), (1, 2), + (2, 0), (2, 1), (2, 2))) + +-if StrictVersion(astropy.__version__[:3]) >= StrictVersion('1.0'): ++if LooseVersion(astropy.__version__[:3]) >= LooseVersion('1.0'): + # The relative error is slightly larger on astropy-dev + # There is no obvious reason for this. + rtol = 2e-7 +diff --git a/spectral_cube/tests/test_spectral_cube.py b/spectral_cube/tests/test_spectral_cube.py +index 025e6bd..4dce3bb 100644 +--- a/spectral_cube/tests/test_spectral_cube.py ++++ b/spectral_cube/tests/test_spectral_cube.py +@@ -4,7 +4,7 @@ import operator + import itertools + import warnings + import mmap +-from distutils.version import StrictVersion, LooseVersion ++from distutils.version import LooseVersion, LooseVersion + + # needed to test for warnings later + warnings.simplefilter('always', UserWarning) +@@ -468,12 +468,12 @@ class TestNumpyMethods(BaseTest): + scmed = self.c.apply_numpy_function(np.median, axis=0) + # this checks whether numpy <=1.9.3 has a bug? + # as far as I can tell, np==1.9.3 no longer has this bug/feature +- #if StrictVersion(np.__version__) <= StrictVersion('1.9.3'): ++ #if LooseVersion(np.__version__) <= LooseVersion('1.9.3'): + # # print statements added so we get more info in the travis builds +- # print("Numpy version is: {0}".format(StrictVersion(np.__version__))) ++ # print("Numpy version is: {0}".format(LooseVersion(np.__version__))) + # assert np.count_nonzero(np.isnan(scmed)) == 5 + #else: +- # print("Numpy version is: {0}".format(StrictVersion(np.__version__))) ++ # print("Numpy version is: {0}".format(LooseVersion(np.__version__))) + assert np.count_nonzero(np.isnan(scmed)) == 6 + + scmed = self.c.apply_numpy_function(np.nanmedian, axis=0) +@@ -667,7 +667,7 @@ def test_read_write_rountrip(tmpdir): + assert cube.shape == cube.shape + assert_allclose(cube._data, cube2._data) + if (((hasattr(_wcs, '__version__') +- and StrictVersion(_wcs.__version__) < StrictVersion('5.9')) ++ and LooseVersion(_wcs.__version__) < LooseVersion('5.9')) + or not hasattr(_wcs, '__version__'))): + # see https://github.com/astropy/astropy/pull/3992 for reasons: + # we should upgrade this for 5.10 when the absolute accuracy is diff --git a/dev-python/spectral-cube/metadata.xml b/dev-python/spectral-cube/metadata.xml new file mode 100644 index 000000000000..0cc45ca202a5 --- /dev/null +++ b/dev-python/spectral-cube/metadata.xml @@ -0,0 +1,19 @@ +<?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 lang="en"> + The spectral-cube astronomy python module provides an easy way to + read, manipulate, analyze, and write data cubes with two + positional dimensions and one spectral dimension, optionally with + Stokes parameters. It aims to be a versatile data container for + building custom analysis routines. + </longdescription> + <upstream> + <remote-id type="pypi">spectral-cube</remote-id> + <remote-id type="github">astropy/spectral-cube</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/spectral-cube/spectral-cube-0.4.0.ebuild b/dev-python/spectral-cube/spectral-cube-0.4.0.ebuild new file mode 100644 index 000000000000..0b0359cc65db --- /dev/null +++ b/dev-python/spectral-cube/spectral-cube-0.4.0.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2018 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="Manipulate astronomical data cubes with Python" +HOMEPAGE="https://spectral-cube.readthedocs.org/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" + +LICENSE="BSD" +SLOT="0" +IUSE="doc test" + +RDEPEND="dev-python/astropy[${PYTHON_USEDEP}]" +DEPEND="${RDEPEND} + dev-python/astropy-helpers[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) + test? ( dev-python/pytest[${PYTHON_USEDEP}] )" + +PATCHES=( "${FILESDIR}"/${P}-looseversion.patch ) + +python_prepare_all() { + sed -i -e '/auto_use/s/True/False/' setup.cfg || die + distutils-r1_python_prepare_all +} + +python_compile_all() { + if use doc; then + python_setup + PYTHONPATH="${BUILD_DIR}"/lib \ + esetup.py build_sphinx --no-intersphinx + fi +} + +python_test() { + pushd spectral_cube/tests/data > /dev/null + "${PYTHON}" make_test_cubes.py + popd > /dev/null + esetup.py test +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/html/ ) + distutils-r1_python_install_all +} |