summaryrefslogtreecommitdiff
path: root/dev-python/spectral-cube
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/spectral-cube
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/spectral-cube')
-rw-r--r--dev-python/spectral-cube/Manifest5
-rw-r--r--dev-python/spectral-cube/files/spectral-cube-0.4.0-looseversion.patch139
-rw-r--r--dev-python/spectral-cube/metadata.xml19
-rw-r--r--dev-python/spectral-cube/spectral-cube-0.4.0.ebuild51
4 files changed, 214 insertions, 0 deletions
diff --git a/dev-python/spectral-cube/Manifest b/dev-python/spectral-cube/Manifest
new file mode 100644
index 000000000000..4dc4c5ca445d
--- /dev/null
+++ b/dev-python/spectral-cube/Manifest
@@ -0,0 +1,5 @@
+AUX spectral-cube-0.4.0-looseversion.patch 6250 SHA256 26a56223699fcb448efce2ab0a35e8dc42893c3f91fc5a9b5ea961da4e4fcceb SHA512 caaec6f1e405e6986a148495be716e120ac8a6abb0738d7f1906efde4d4097966b10fce73dd8b538b3ea616a5245ffb1b876c1a16ad85e2362206b7d0d52ffdb WHIRLPOOL 070914bae28f9671505dd88301e45a69a65b78104272e539f3e4e6cf19ca6ee5de04a1b55f0500d0872b3b0c2ebed262f355c9bfd65a24aaf76d0545821688e8
+DIST spectral-cube-0.4.0.tar.gz 290453 SHA256 a08e60b314c0f6e44a3207725f962e4b9d4c9196232344f83828ca376d4c7877 SHA512 20970d1be0d836bd07ea96ee909300f28eaf2ab4ded7b4525eb68399d242b864fe93120a16ef2ef35eba5f547c0cbe90b07c27ef44ab1910dbbe97230fbab84e WHIRLPOOL 66c7d9b6d41c050dcd56048951a5a6a8c0306ae180a3042a7a066d4edd5f4ae654fad27ab325ca3e78d7a3e92d0167bc5057ca069e8db960aa23c4b18fcf78ab
+EBUILD spectral-cube-0.4.0.ebuild 1220 SHA256 997721224047bfd44d5a86a302103a60e7f2b15d7f6eab5b2031e68182a38c96 SHA512 ce81e06d16155c7ede52b180a5068d9cbda36c59657d6d8f2aecb6dd4f6d49457af2195169ef771a6fc5ee2dd55c1f7c26bda8114465c438b07e63b94da79a9b WHIRLPOOL 1538df1de461877c7f228fca53ee4560db3cc1edec31c3c8252830d0b63edc37490a0341f17dc23310b8dc8f72ddf87f5bdd4e309adec0bbb6a0a25db471b1c0
+MISC ChangeLog 382 SHA256 ec1e930d0cd892be7bdd9ad7740d1d1430f03581506e7e34bc0c4f550f80ba70 SHA512 e82a3b2383e37624cbef7518f0e4937a6e58b0122b550f23d306a332cad4b96c4851c612286bededf79ff9e6fe67a30d2e02b022748adf6b57c170394799538c WHIRLPOOL 0b7c350427ad220e8fe6c51c932382bf0fb59b453f70f6cfa03f70813d06dc0753c7b3108300e9549bd1b72cdf906231e90d541fe857d4bdc031153d05aa5e58
+MISC metadata.xml 773 SHA256 c097f01e6f5b77eddceec4f49b7a3abc96ba110cd64478bba381febc18119327 SHA512 407cdc09e494af2429bf809dc946bc7e05c300e9e4cbad68e75021628f2cfc187561c3a183081cf13cb7b892631d2bceebd5ae0a0109957a1936ec64ea4f6d4f WHIRLPOOL d00c818f543e02c99a2f6ef845e72a5ee34ce10e62c59265c9981b48249dade29de4f51c3cde5f860fca9493af20e8a825871240522180b0c31001f639e3f48b
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..a3c130ebbf28
--- /dev/null
+++ b/dev-python/spectral-cube/spectral-cube-0.4.0.ebuild
@@ -0,0 +1,51 @@
+# 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="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
+}