From d8934cd0dc6828d13a8100579af1be26f16267eb Mon Sep 17 00:00:00 2001 From: Ole Streicher Date: Wed, 25 Jan 2017 15:17:26 +0000 Subject: [PATCH] Import python-astropy_1.3-8.debian.tar.xz [dgit import tarball python-astropy 1.3-8 python-astropy_1.3-8.debian.tar.xz] --- astropy-utils.install | 1 + astropy-utils.manpages | 8 + changelog | 516 +++++++++++ clean | 22 + compat | 1 + control | 147 +++ copyright | 129 +++ fits2bitmap.1 | 58 ++ fitscheck.1 | 71 ++ fitsdiff.1 | 87 ++ fitsheader.1 | 36 + fitsinfo.1 | 31 + ...se-plugin-for-doctests-in-.rst-files.patch | 123 +++ ...PY_LT_1_12-works-for-beta-prerelease.patch | 22 + ...default-value-for-remote_data-option.patch | 35 + .../Use-parametrize-instead-of-yield.patch | 850 ++++++++++++++++++ patches/disable_helper.patch | 21 + patches/external_python_pkgs.patch | 196 ++++ patches/fix_for_cfitsio_3380.patch | 23 + patches/mark_known_failures.patch | 84 ++ patches/only_python3-binaries.patch | 22 + patches/series | 9 + python-astropy-doc.doc-base | 11 + python-astropy-doc.docs | 1 + python-astropy-doc.lintian-overrides | 5 + python-astropy.install | 1 + python-astropy.lintian-overrides | 5 + python3-astropy.install | 1 + python3-astropy.lintian-overrides | 5 + rules | 62 ++ samp_hub.1 | 130 +++ source/format | 1 + source/lintian-overrides | 10 + tests/control | 7 + tests/python-astropy | 8 + tests/python3-astropy | 9 + upstream/metadata | 28 + upstream/signing-key.asc | 52 ++ volint.1 | 13 + watch | 3 + wcslint.1 | 13 + 41 files changed, 2857 insertions(+) create mode 100644 astropy-utils.install create mode 100644 astropy-utils.manpages create mode 100644 changelog create mode 100644 clean create mode 100644 compat create mode 100644 control create mode 100644 copyright create mode 100644 fits2bitmap.1 create mode 100644 fitscheck.1 create mode 100644 fitsdiff.1 create mode 100644 fitsheader.1 create mode 100644 fitsinfo.1 create mode 100644 patches/Allow-pytest-3.x-to-use-plugin-for-doctests-in-.rst-files.patch create mode 100644 patches/Ensure-NUMPY_LT_1_12-works-for-beta-prerelease.patch create mode 100644 patches/Fix-default-value-for-remote_data-option.patch create mode 100644 patches/Use-parametrize-instead-of-yield.patch create mode 100644 patches/disable_helper.patch create mode 100644 patches/external_python_pkgs.patch create mode 100644 patches/fix_for_cfitsio_3380.patch create mode 100644 patches/mark_known_failures.patch create mode 100644 patches/only_python3-binaries.patch create mode 100644 patches/series create mode 100644 python-astropy-doc.doc-base create mode 100644 python-astropy-doc.docs create mode 100644 python-astropy-doc.lintian-overrides create mode 100644 python-astropy.install create mode 100644 python-astropy.lintian-overrides create mode 100644 python3-astropy.install create mode 100644 python3-astropy.lintian-overrides create mode 100755 rules create mode 100644 samp_hub.1 create mode 100644 source/format create mode 100644 source/lintian-overrides create mode 100644 tests/control create mode 100755 tests/python-astropy create mode 100755 tests/python3-astropy create mode 100644 upstream/metadata create mode 100644 upstream/signing-key.asc create mode 100644 volint.1 create mode 100644 watch create mode 100644 wcslint.1 diff --git a/astropy-utils.install b/astropy-utils.install new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/astropy-utils.install @@ -0,0 +1 @@ +usr/bin diff --git a/astropy-utils.manpages b/astropy-utils.manpages new file mode 100644 index 0000000..6a3e46c --- /dev/null +++ b/astropy-utils.manpages @@ -0,0 +1,8 @@ +debian/fits2bitmap.1 +debian/fitscheck.1 +debian/fitsdiff.1 +debian/fitsheader.1 +debian/fitsinfo.1 +debian/samp_hub.1 +debian/volint.1 +debian/wcslint.1 diff --git a/changelog b/changelog new file mode 100644 index 0000000..51dee52 --- /dev/null +++ b/changelog @@ -0,0 +1,516 @@ +python-astropy (1.3-8) unstable; urgency=medium + + * Switch to unstable. Closes: #852550 + * Revert unrelated "Improved detection of ascii fast_reader in non-fast + parsers" + + -- Ole Streicher Wed, 25 Jan 2017 16:17:26 +0100 + +python-astropy (1.3-8~exp2) experimental; urgency=medium + + * Fix pytest section, finally re-enabling doctests + + -- Ole Streicher Thu, 19 Jan 2017 17:27:30 +0100 + +python-astropy (1.3-8~exp1) experimental; urgency=medium + + * Switch to experimental for some tests + * Try to fix doctest failures + * Improved detection of ascii fast_reader in non-fast parsers + + -- Ole Streicher Thu, 19 Jan 2017 09:57:22 +0100 + +python-astropy (1.3-7) unstable; urgency=medium + + * Allow stderr in all tests + + -- Ole Streicher Sun, 15 Jan 2017 14:35:17 +0100 + +python-astropy (1.3-6) unstable; urgency=medium + + * Override missing-build-dependency-for-dh_-command + * Add python-astropy-affiliated to suggestions + * Add pytest to package dependencies + * Fix default value for remote_data option. Closes: #849501 + * Remove wcslib 4.24 compatibility property. Closes: #844525 + + -- Ole Streicher Sat, 14 Jan 2017 11:28:01 +0100 + +python-astropy (1.3-5) unstable; urgency=medium + + * Manually add dependencies for external packages + + -- Ole Streicher Thu, 12 Jan 2017 22:51:46 +0100 + +python-astropy (1.3-4) unstable; urgency=medium + + * Mark doc package as Multi-Arch: foreign as suggested by Multiarch hinter + * Remove wcsaxes suggestions since this is now part of astropy + * Use external modules instead of convenience copies. Closes: #849502 + * Temporarily disable doctests (not working with pytest 3.0.5) + * Remove explicite dh_strip_nondeterminism + + -- Ole Streicher Thu, 12 Jan 2017 12:17:23 +0100 + +python-astropy (1.3-3) unstable; urgency=medium + + * Ensure NUMPY_LT_1_12 works for beta prerelease. Closes: #849271 + + -- Ole Streicher Thu, 29 Dec 2016 09:52:44 +0100 + +python-astropy (1.3-2) unstable; urgency=low + + * Disable TestDisplayWorldCoordinate.test_cube_coords to fix FTBFS on MIPS + + -- Ole Streicher Fri, 23 Dec 2016 17:58:24 +0100 + +python-astropy (1.3-1) unstable; urgency=low + + * New upstream version 1.3 + * Switch back to unstable + * Rediff patches + + -- Ole Streicher Fri, 23 Dec 2016 15:13:46 +0100 + +python-astropy (1.3~rc1-1) experimental; urgency=low + + * Add python3-pkg-resources to astropy-tools dependencies. Closes: #839746 + * Disable failing VO SSL test to avoid FTBFS with recent Python release. + Closes: #844984 + * New upstream version 1.3~rc1 + * Rediff patches + * Re-enable WCS.all_world2pix test (should be fixed now) + + -- Ole Streicher Tue, 13 Dec 2016 09:44:29 +0100 + +python-astropy (1.2.1-1) unstable; urgency=low + + * New upstream version + + -- Ole Streicher Thu, 23 Jun 2016 09:48:06 +0200 + +python-astropy (1.2-1) unstable; urgency=low + + * New upstream version. Switch back to unstable + + -- Ole Streicher Mon, 20 Jun 2016 15:10:14 +0200 + +python-astropy (1.2~rc1-3) experimental; urgency=low + + * Re-enable unfixed yet tests + + -- Ole Streicher Thu, 16 Jun 2016 14:06:19 +0200 + +python-astropy (1.2~rc1-2) experimental; urgency=low + + * Temporarily disable all xfail marks + + -- Ole Streicher Tue, 14 Jun 2016 21:32:33 +0200 + +python-astropy (1.2~rc1-1) experimental; urgency=low + + * New upstream RC. Switch to experimental + * Install Python 3 versions of the scripts + * Push Standards-Version to 3.9.8. No changes needed + + -- Ole Streicher Sun, 12 Jun 2016 10:32:16 +0200 + +python-astropy (1.1.2-1) unstable; urgency=low + + * Add ASCL-Id + * New upstream version + * Fix cfitsio related tests. Closes: #816715 + + -- Ole Streicher Fri, 11 Mar 2016 10:54:46 +0100 + +python-astropy (1.1.1-3) unstable; urgency=medium + + * Fix for newer pytest. Closes: #812648 + * Fix for wcslib 5.13 + * Fix for known test issue with new numpy + * Push standards-version to 3.9.7. No changes needed. + * Adjust VCS entries in d/control + + -- Ole Streicher Sun, 14 Feb 2016 15:09:01 +0100 + +python-astropy (1.1.1-2) unstable; urgency=low + + * Fix dependency of python-astropy-utils on python-astropy + * Finally fix test failure + * Switch back to unstable since bugfix is approved upstream + + -- Ole Streicher Thu, 14 Jan 2016 23:06:52 +0100 + +python-astropy (1.1.1-1~exp1) experimental; urgency=low + + * New upstream version + * Depend python-astropy-utils on python-astropy of the same version. + Closes: #807834 + * Revert astropy.wcs to 1.1 to workaround test failure + * Switch to experimental since WCS seems to be buggy + + -- Ole Streicher Thu, 14 Jan 2016 11:14:05 +0100 + +python-astropy (1.1-1) unstable; urgency=low + + * New upstream version + * Switch back to unstable + + -- Ole Streicher Sat, 12 Dec 2015 10:02:22 +0100 + +python-astropy (1.1~rc2-1) experimental; urgency=low + + * New upstream RC version + + -- Ole Streicher Tue, 08 Dec 2015 09:29:29 +0100 + +python-astropy (1.1~rc1-1) experimental; urgency=low + + * New upstream RC version + + -- Ole Streicher Tue, 24 Nov 2015 21:09:40 +0100 + +python-astropy (1.1~b1-1) experimental; urgency=low + + * New upstream beta version + * [Martin Pitt] Ignore stderr for python3 test to avoid failing on + the ResourceWarning stderr message. Closes: #803068 + + -- Ole Streicher Fri, 16 Oct 2015 08:58:30 +0200 + +python-astropy (1.0.5-2) unstable; urgency=low + + * Fix FTBS on i386 + + -- Ole Streicher Thu, 08 Oct 2015 15:44:51 +0200 + +python-astropy (1.0.5-1) unstable; urgency=low + + * New upstream version, providing Python-3.5 compatibility. Closes: #800727 + * Limit wcslib-dev version to pre-5 releases + + -- Ole Streicher Tue, 06 Oct 2015 13:26:14 +0200 + +python-astropy (1.0.4-1) unstable; urgency=low + + * New upstream version + * Re-enable dh_strip_nondeterminism override. See #791574 for details. + + -- Ole Streicher Thu, 27 Aug 2015 10:32:44 +0200 + +python-astropy (1.0.3-3) unstable; urgency=low + + * Extend Suggests, and build/test-depend on scipy for more extended tests + * Fix conflicts/replaces of astropy-utils with pyfits-utils. Closes: #790530 + * Temporarily remove dh_strip_nondeterminism + * Override image-file-in-usr-lib lintian + + -- Ole Streicher Thu, 16 Jul 2015 10:46:32 +0200 + +python-astropy (1.0.3-2) unstable; urgency=low + + * Fix FTBS with hurd-i386 + + -- Ole Streicher Wed, 24 Jun 2015 10:38:18 +0200 + +python-astropy (1.0.3-1) unstable; urgency=low + + * New upstream version + + -- Ole Streicher Sun, 07 Jun 2015 17:55:56 +0200 + +python-astropy (1.0.2-1) unstable; urgency=low + + * New upstream version. + * Create upstream/metadata with bibliographic information + * Create debci control file + * New binary package astropy-utils. Conflicts with pyfits-utils. + * Package png files as well. Closes: #783573 + * switch back to unstable + + -- Ole Streicher Thu, 16 Apr 2015 22:15:02 +0200 + +python-astropy (1.0-1~exp) experimental; urgency=low + + * New upstream version. + + -- Ole Streicher Thu, 19 Feb 2015 09:09:44 +0100 + +python-astropy (1.0~rc2-1) experimental; urgency=medium + + * New upstream release candidate + + -- Ole Streicher Thu, 12 Feb 2015 09:26:56 +0100 + +python-astropy (1.0~rc1-3) experimental; urgency=low + + * Fix last FTBS on Hurd + + -- Ole Streicher Thu, 05 Feb 2015 21:41:57 +0100 + +python-astropy (1.0~rc1-2) experimental; urgency=low + + * Fix FTBS on several platforms + * Disable failing tests (temporartily) + + -- Ole Streicher Sun, 01 Feb 2015 11:13:52 +0100 + +python-astropy (1.0~rc1-1) experimental; urgency=low + + * New upstream release candidate + + -- Ole Streicher Wed, 28 Jan 2015 09:17:42 +0100 + +python-astropy (0.4.2-2) unstable; urgency=medium + + * Don't set defalt SSL protocol in vo/samp/client.py. Closes: #775780 + + -- Ole Streicher Mon, 19 Jan 2015 21:07:18 +0100 + +python-astropy (0.4.2-1) unstable; urgency=low + + * New upstream release. + * Build-depend on libcfitsio-dev instead of libcfitsio3-dev. Closes: #761716 + * Upgrade to Standards-Version 3.9.6 (no changes needed) + + -- Ole Streicher Wed, 24 Sep 2014 14:49:35 +0200 + +python-astropy (0.4.1+dfsg2-1) unstable; urgency=low + + * Remove astropy-helper and use external dependency. Closes: #761055 + * Support numpy 1.9. Closes: #761392 + * Update uploaders email address + + -- Ole Streicher Sun, 14 Sep 2014 13:50:29 +0200 + +python-astropy (0.4.1+dfsg-1) unstable; urgency=low + + * New upstream version + * Exclude precompiled files from source tarball + + -- Ole Streicher Sun, 10 Aug 2014 10:22:07 +0200 + +python-astropy (0.4-4) unstable; urgency=low + + * build-depend on wcslib >= 4.23. Closes: #755485 + + -- Ole Streicher Tue, 22 Jul 2014 17:22:16 +0200 + +python-astropy (0.4-3) unstable; urgency=low + + * Revert build-depends-indep since it does not work yet. + + -- Ole Streicher Fri, 18 Jul 2014 16:50:55 +0200 + +python-astropy (0.4-2) unstable; urgency=low + + * Fix locale on build + + -- Ole Streicher Fri, 18 Jul 2014 09:16:16 +0200 + +python-astropy (0.4-1) unstable; urgency=low + + * New upstream version + + -- Ole Streicher Wed, 16 Jul 2014 20:21:39 +0200 + +python-astropy (0.4~rc2-3) experimental; urgency=low + + * Convert from python-support to dh_python + + -- Ole Streicher Mon, 14 Jul 2014 09:46:47 +0200 + +python-astropy (0.4~rc2-2) experimental; urgency=low + + * Fix FTBS on powerpc, s390 + + -- Ole Streicher Sun, 13 Jul 2014 18:56:28 +0200 + +python-astropy (0.4~rc2-1) experimental; urgency=low + + * New upstream prerelease + + -- Ole Streicher Sat, 12 Jul 2014 18:51:26 +0200 + +python-astropy (0.4~rc1-2) experimental; urgency=low + + * Fix FTBS on powerpc and s390x + + -- Ole Streicher Wed, 09 Jul 2014 13:16:06 +0200 + +python-astropy (0.4~rc1-1) experimental; urgency=low + + * New upstream prerelease + * Adjust watch file for prerelease + + -- Ole Streicher Mon, 07 Jul 2014 16:07:05 +0200 + +python-astropy (0.3.2-3) unstable; urgency=low + + * Fix checksum calculation and test on 32-bit + + -- Ole Streicher Sat, 17 May 2014 17:05:58 +0200 + +python-astropy (0.3.2-2) unstable; urgency=low + + * Mark known failures as xfail. + * Change maintainer and VCS location to debian-astro + + -- Ole Streicher Wed, 14 May 2014 14:47:35 +0200 + +python-astropy (0.3.2-1) unstable; urgency=low + + * New upstream version. Closes: #743554 + * Don't repack since all sources are included now + + -- Ole Streicher Wed, 14 May 2014 09:21:18 +0200 + +python-astropy (0.3.1+dfsg-1) unstable; urgency=low + + * New upstream version + + -- Ole Streicher Thu, 06 Mar 2014 11:40:55 +0100 + +python-astropy (0.3+dfsg-3) unstable; urgency=low + + * Re-integrate 0.3-6 fixes which were left out by another mistake :-) + + -- Ole Streicher Fri, 24 Jan 2014 11:31:26 +0100 + +python-astropy (0.3+dfsg-2) unstable; urgency=low + + * Re-integrate 0.3-5 fixes which were left out by mistake + + -- Ole Streicher Fri, 24 Jan 2014 11:11:46 +0100 + +python-astropy (0.3+dfsg-1) unstable; urgency=low + + * Remove sourceless files jqery*.js. Closes: #735770 + + -- Ole Streicher Fri, 24 Jan 2014 09:43:27 +0100 + +python-astropy (0.3-6) unstable; urgency=low + + * Fix another FTBS causes on python-3.4. + + -- Ole Streicher Thu, 16 Jan 2014 16:27:55 +0100 + +python-astropy (0.3-5) unstable; urgency=low + + * Include upstream fixes to build on python-3.4. Closes: #734293 + * Upgrade to Standards-Version 3.9.5 (no changes needed) + + -- Ole Streicher Wed, 15 Jan 2014 09:57:05 +0100 + +python-astropy (0.3-4) unstable; urgency=low + + * Mark known s390 failures as xfail. + + -- Ole Streicher Fri, 20 Dec 2013 10:43:16 +0100 + +python-astropy (0.3-3) unstable; urgency=low + + * Fix vo_test.py for big endian. + + -- Ole Streicher Tue, 10 Dec 2013 11:23:38 +0100 + +python-astropy (0.3-2) unstable; urgency=low + + * Fix doctest and mark other known test failures on big endian until + they get fixed upstream. + + -- Ole Streicher Mon, 09 Dec 2013 14:23:04 +0100 + +python-astropy (0.3-1) unstable; urgency=low + + * New upstream version. + * Remove legacy packages that are no longer supported upstream. + + -- Ole Streicher Sat, 30 Nov 2013 12:56:34 +0100 + +python-astropy (0.2.5-1) unstable; urgency=low + + * New upstream version. + + -- Ole Streicher Sun, 27 Oct 2013 18:29:01 +0100 + +python-astropy (0.2.4-3) unstable; urgency=low + + * Fix "Conflicts" of python3-astropy-legacy. Closes: #719770 + + -- Ole Streicher Thu, 15 Aug 2013 14:33:37 +0200 + +python-astropy (0.2.4-2) unstable; urgency=low + + * Enable python3 packages + + -- Ole Streicher Mon, 05 Aug 2013 21:04:23 +0200 + +python-astropy (0.2.4-1) unstable; urgency=low + + * New upstream version. + + -- Ole Streicher Fri, 26 Jul 2013 17:41:26 +0200 + +python-astropy (0.2.3-2~1) experimental; urgency=low + + * Fix FTBS on MIPS and MIPSEL + + -- Ole Streicher Fri, 21 Jun 2013 16:31:15 +0200 + +python-astropy (0.2.3-1) unstable; urgency=low + + * New upstream version; incorporates all previous patches + + -- Ole Streicher Fri, 07 Jun 2013 14:40:05 +0200 + +python-astropy (0.2.1-1) unstable; urgency=low + + * Fix FTBS (unit test failure) on HURD + * Change distribution to unstable + + -- Ole Streicher Tue, 30 Apr 2013 10:36:01 +0200 + +python-astropy (0.2.1-1~exp6) experimental; urgency=low + + * Fix FTBS (unit test failure) on MIPS + + -- Ole Streicher Fri, 26 Apr 2013 09:57:59 +0200 + +python-astropy (0.2.1-1~exp5) experimental; urgency=low + + * Fix FTBS (unit test failure) on bigendian machines + + -- Ole Streicher Mon, 22 Apr 2013 19:37:00 +0200 + +python-astropy (0.2.1-1~exp4) experimental; urgency=low + + * Fix FTBS (unit test failure) on Hurd + + -- Ole Streicher Sun, 14 Apr 2013 18:39:00 +0200 + +python-astropy (0.2.1-1~exp3) experimental; urgency=low + + * Suggest optional packages + + -- Ole Streicher Sun, 14 Apr 2013 12:17:00 +0200 + +python-astropy (0.2.1-1~exp2) experimental; urgency=low + + * increase test verbosity to catch bigendian FTBS + + -- Ole Streicher Wed, 10 Apr 2013 16:21:00 +0200 + +python-astropy (0.2.1-1~exp1) experimental; urgency=low + + * New upstream release + * Infrastructure to build python3 packages (but py3 still disabled) + * Fix FTBS: set a writeable HOME + MPLCONFIGDIR + + -- Ole Streicher Thu, 10 Apr 2013 09:10:00 +0200 + +python-astropy (0.2~b2-1) experimental; urgency=low + + * Initial release. (Closes: #678168) + + -- Ole Streicher Wed, 30 Jan 2013 10:00:00 +0100 diff --git a/clean b/clean new file mode 100644 index 0000000..add9bec --- /dev/null +++ b/clean @@ -0,0 +1,22 @@ +astropy/astropy.cfg +astropy/convolution/boundary_extend.c +astropy/convolution/boundary_fill.c +astropy/convolution/boundary_none.c +astropy/convolution/boundary_wrap.c +astropy/cython_version.py +astropy/io/ascii/cparser.c +astropy/modeling/src/wcsconfig.h +astropy/table/_np_utils.c +astropy/time/erfa_time.c +astropy/version.py +astropy/wcs/include/astropy_wcs/wcsconfig.h +astropy/wcs/include/docstrings.h +astropy/wcs/include/wcsconfig.h +astropy/wcs/src/docstrings.c +astropy/extern/configobj/* +astropy/extern/ply/* +astropy/extern/six/* +astropy/extern/js/* +astropy/extern/css/* +astropy/extern/pytest.py +docs/api/* diff --git a/compat b/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/compat @@ -0,0 +1 @@ +9 diff --git a/control b/control new file mode 100644 index 0000000..8b61ca1 --- /dev/null +++ b/control @@ -0,0 +1,147 @@ +Source: python-astropy +Maintainer: Debian Astronomy Maintainers +Uploaders: Ole Streicher +Section: python +Priority: optional +Build-Depends: cython, + debhelper (>= 9), + dh-python, + graphviz, + libcfitsio-dev | libcfitsio3-dev, + liberfa-dev (>= 1.1.0), + libexpat1-dev, + libjs-jquery, + libjs-jquery-datatables, + pkg-config, + python-all-dev (>= 2.6.6-3~), + python-astropy-helpers (>= 1.1~), + python-configobj, + python-matplotlib, + python-nose, + python-numpy (>= 1.4), + python-ply, + python-pytest, + python-scipy, + python-setuptools (>= 0.6.4), + python-six (>= 1.10.0), + python-sphinx (>= 1.0.7+dfsg), + python-yaml, + python3-all-dev, + python3-astropy-helpers (>= 1.1~), + python3-configobj, + python3-matplotlib, + python3-nose, + python3-numpy (>= 1:1.6.2), + python3-ply, + python3-pytest, + python3-scipy, + python3-setuptools (>= 0.6.4), + python3-six (>= 1.10.0), + python3-yaml, + wcslib-dev (>= 5.8), + zlib1g-dev +Standards-Version: 3.9.8 +Vcs-Browser: https://anonscm.debian.org/cgit/debian-astro/packages/python-astropy.git +Vcs-Git: https://anonscm.debian.org/git/debian-astro/packages/python-astropy.git +Homepage: http://astropy.org +X-Python-Version: >= 2.6 +X-Python3-Version: >= 3.2 + +Package: python-astropy +Architecture: any +Depends: python-configobj, + python-ply, + python-pytest, + python-six (>= 1.10.0), + ${misc:Depends}, + ${python:Depends}, + ${shlibs:Depends} +Suggests: libxml2-utils, + python-astropy-affiliated, + python-astropy-doc, + python-beautifulsoup, + python-h5py, + python-matplotlib, + python-pandas, + python-scipy, + python-tz, + python-yaml +Recommends: libjs-jquery, + libjs-jquery-datatables +Description: Core functionality for performing astrophysics with Python + The astropy package contains core functionality and some common tools + needed for performing astronomy and astrophysics research with Python. + It can be extended by a number of "affiliated packages" that are + intended to work with the core package. + +Package: python3-astropy +Architecture: any +Depends: python3-configobj, + python3-ply, + python3-pytest, + python3-six (>= 1.10.0), + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends} +Suggests: libxml2-utils, + python-astropy-doc, + python3-astropy-affiliated, + python3-beautifulsoup, + python3-h5py, + python3-matplotlib, + python3-pandas, + python3-scipy, + python3-tz, + python3-yaml +Recommends: libjs-jquery, + libjs-jquery-datatables +Description: Core functionality for performing astrophysics with Python3 + The astropy package contains core functionality and some common tools + needed for performing astronomy and astrophysics research with Python3. + It can be extended by a number of "affiliated packages" that are + intended to work with the core package. + +Package: python-astropy-doc +Architecture: all +Multi-Arch: foreign +Section: doc +Depends: ${misc:Depends}, + ${sphinxdoc:Depends} +Description: Core functionality for performing astrophysics with Python (doc) + The astropy package contains core functionality and some common tools + needed for performing astronomy and astrophysics research with Python. + It can be extended by a number of "affiliated packages" that are + intended to work with the core package. + . + This package contains the package documentation. + +Package: astropy-utils +Architecture: all +Section: science +Depends: python3-astropy (<< ${source:Version}.1~), + python3-astropy (>= ${source:Version}), + python3-pkg-resources, + ${misc:Depends}, + ${python3:Depends} +Breaks: fitscheck (<< 1:3.1.2-1~), + pyfits-utils (<<1:3.3-4~), + python-pyfits (<< 1:3.0.7-4~) +Replaces: fitscheck (<< 1:3.1.2-1~), + pyfits-utils (<<1:3.3-4~), + python-pyfits (<< 1:3.0.7-4~) +Description: Command line tools from astropy + The astropy package contains core functionality and some common tools + needed for performing astronomy and astrophysics research with Python. + . + This package contains the tools that come with astropy: + . + * fitscheck: Detect and fix FITS standards violations + * fits2bitmap: Create a bitmap file from a FITS image. + * fitsdiff: Compare two FITS image files and report the differences in + header keywords and data. + * fitsheader: Print the header(s) of one or more FITS file(s) to the + standard output in a human-readable format. + * samp_hub: SAMP Hub Server. + * volint: Check a VOTable file for compliance to the VOTable specification + * wcslint: Check the WCS keywords in a FITS file for compliance against + the standards diff --git a/copyright b/copyright new file mode 100644 index 0000000..b79b22b --- /dev/null +++ b/copyright @@ -0,0 +1,129 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: astropy +Upstream-Author: The Astropy Developers +Source: http://www.astropy.org/ + +Files: * astropy/io/fits/* + astropy_helpers/astropy_helpers/sphinx/ext/compiler_unparse.py + astropy_helpers/astropy_helpers/sphinx/ext/comment_eater.py + astropy_helpers/astropy_helpers/sphinx/ext/traitsdoc.py + astropy/extern/configobj/* + astropy/extern/js/jquery.dataTables.js +Copyright: Copyright (c) 2011, Astropy Developers, + 2004-2005 Association of Universities for Research in Astronomy, + 2006 Enthought, Inc., + 2010-2011 Smithsonian Astrophysical Observatory, + 2003-2010 Michael Foord, Mark Andrews, Nicola Larosa, + 1995-2010 Jean-loup Gailly and Mark Adler, + 2001-2011 David M. Beazley (Dabeaz LLC) + 2008-2013 Allan Jardine +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + . + 3. Neither the name of AURA and its representatives nor the names + of the Smithsonian Astrophysical Observatory, Enthought Inc., Michael Foord, + the name of Voidspace, the names of its contributors, David Beazley, or + Dabeaz LLC, Allan Jardine nor SpryMedia, may not be used to endorse or + promote products derived from this software without specific prior + written permission. + . + THIS SOFTWARE IS PROVIDED BY ITS AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL AURA BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. + +Files: cextern/expat/* +Copyright: 2001-2007 Expat maintainers, + 1998-2003 Thai Open Source Software Center Ltd and Clark Cooper + 2014 jQuery Foundation and other contributors +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, includingwithout limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Files: astropy_helpers/astropy_helpers/sphinx/ext/numpydoc.py + astropy_helpers/astropy_helpers/sphinx/ext/docscrape.py + astropy_helpers/astropy_helpers/sphinx/ext/docscrape_sphinx.py + astropy_helpers/astropy_helpers/sphinx/ext/phantom_import.py + debian/* +Copyright: Copyright (C) 2008 Stefan van der Walt , + Pauli Virtanen , + 2012-2015 Ole Streicher +License: BSD-2-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: cextern/wcslib/* +Copyright: Copyright (C) 1995-2012, Mark Calabretta +License: LGPL-3 + WCSLIB is free software: you can redistribute it and/or modify it under the + terms of the GNU Lesser General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + . + WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for + more details. + . + On Debian systems, the full text of the GNU Lesser General Public + License version 3 can be found in the file + `/usr/share/common-licenses/LGPL-3'. + . + Correspondence concerning WCSLIB may be directed to: + Internet email: mcalabre@atnf.csiro.au + Postal address: Dr. Mark Calabretta + Australia Telescope National Facility, CSIRO + PO Box 76 + Epping NSW 1710 + AUSTRALIA +Comment: Note that these files are not used in the package build process, so + the copyright information is included here only as a reference. diff --git a/fits2bitmap.1 b/fits2bitmap.1 new file mode 100644 index 0000000..8d044cc --- /dev/null +++ b/fits2bitmap.1 @@ -0,0 +1,58 @@ +.TH FITS2BITMAP 1 "April 2015" "fits2bitmap" "astropy 1.0.2" +.SH NAME +fits2bitmap \- Create a bitmap file from a FITS image. +.SH DESCRIPTION +usage: fits2bitmap [\-h] [\-e hdu] [\-o filename] [\-\-scale SCALE] [\-\-power POWER] +.IP +[\-\-asinh_a ASINH_A] [\-\-min_cut MIN_CUT] [\-\-max_cut MAX_CUT] +[\-\-min_percent MIN_PERCENT] [\-\-max_percent MAX_PERCENT] +[\-\-percent PERCENT] [\-\-cmap colormap_name] +filename [filename ...] +.SS "positional arguments:" +.TP +filename +Path to one or more FITS files to convert +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-e\fR hdu, \fB\-\-ext\fR hdu +specify the HDU extension number or name +.TP +\fB\-o\fR filename +Filename for the output image (Default is a PNG file +with the same name as the FITS file) +.TP +\fB\-\-scale\fR SCALE +Type of image scaling ("linear", "sqrt", "power", +"log", or "asinh") +.TP +\fB\-\-power\fR POWER +Power index for "power" scaling +.TP +\fB\-\-asinh_a\fR ASINH_A +The value in normalized image where the asinh curve +transitions from linear to logarithmic behavior (used +only for "asinh" scaling) +.TP +\fB\-\-min_cut\fR MIN_CUT +The pixel value of the minimum cut level +.TP +\fB\-\-max_cut\fR MAX_CUT +The pixel value of the maximum cut level +.TP +\fB\-\-min_percent\fR MIN_PERCENT +The percentile value used to determine the minimum cut +level +.TP +\fB\-\-max_percent\fR MAX_PERCENT +The percentile value used to determine the maximum cut +level +.TP +\fB\-\-percent\fR PERCENT +The percentage of the image values used to determine +the pixel values of the minimum and maximum cut levels +.TP +\fB\-\-cmap\fR colormap_name +matplotlib color map name diff --git a/fitscheck.1 b/fitscheck.1 new file mode 100644 index 0000000..3406852 --- /dev/null +++ b/fitscheck.1 @@ -0,0 +1,71 @@ +.TH fitscheck 1 "April 2015" "fitscheck" "astropy 1.0.2" +.SH NAME +fitscheck \- script to detect and fix FITS standards violations +.SH SYNOPSIS +.B fitscheck +[\fIOPTION\fR]... [\fIFILE\fR]... +.SH DESCRIPTION +.PP +\fBfitscheck\fR is a command line script based on pyfits for verifying +and updating the CHECKSUM and DATASUM keywords of FITS files. +\fBitscheck\fR can also detect and often fix other FITS standards +violations. \fBfitscheck\fR facilitates re\-writing the non-standard +checksums originally generated by pyfits with standard checksums which +will interoperate with cfitsio. +.PP +\fBfitscheck\fR will refuse to write new checksums if the checksum keywords +are missing or their values are bad. Use \fB\-\-force\fR to write new +checksums regardless of whether or not they currently exist or pass. +Use \fB\-\-ignore-missing\fR to tolerate missing checksum keywords without +comment. +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Display terse usage information (help). +.TP +\fB\-k\fR [\fIstandard\fR | \fInonstandard\fR | \fIeither\fR | \fInone\fR], \fB\-\-checksum\fR=[\fIstandard\fR | \fInonstandard\fR | \fIeither\fR | \fInone\fR] +Choose FITS checksum mode or none. Defaults to standard. +.TP +\fB\-w\fR, \fB\-\-write\fR +Write out file checksums and/or FITS compliance fixes. +.TP +\fB\-f\fR, \fB\-\-force\fR +Do file update even if original checksum was bad. +.TP +\fB\-c\fR, \fB\-\-compliance\fR +Do FITS compliance checking, fix if possible. +.TP +\fB\-i\fR, \fB\-\-ignore\-missing\fR +Ignore missing checksums. +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Generate extra output. +.SH "EXAMPLES" +.B "% fitscheck --checksum either --write *.fits" +.br +Verify and update checksums, tolerating non-standard checksums, updating to standard checksum. + +.B "% fitscheck --write --force *.fits" +.br +Write new checksums, even if existing checksums are bad or missing. + +.B "% fitscheck --compliance *.fits" +.br +Verify standard checksums and FITS compliance without changing the files. + +.B "% fitscheck --checksum nonstandard *.fits" +.br +Verify original nonstandard checksums only. + +.B "% fitscheck --checksum none --compliance --write *.fits" +.br +Only check and fix compliance problems, ignoring checksums. + +.B "% fitscheck *.fits" +.br +Verify standard interoperable checksums. + +.B "% fitscheck --checksum none --write *.fits" +.br +Delete checksum keywords. + diff --git a/fitsdiff.1 b/fitsdiff.1 new file mode 100644 index 0000000..51d9c4a --- /dev/null +++ b/fitsdiff.1 @@ -0,0 +1,87 @@ +.TH fitsdiff 1 "April 2015" "fitsdiff" "astropy 1.0.2" +.SH NAME +fitsdiff \- compare two FITS image files and report the differences in header keywords and data. +.SH SYNOPSIS +.B fitsdiff +[\fIOPTION\fR]... \fIFILE1\fR \fIFILE2\fR +.SH DESCRIPTION +.PP +\fBfitsdiff\fR is a command line script based on pyfits to compare two +FITS image files and report the differences in header keywords and data. +.PP +\fIFILE1\fR and \fIFILE2\fR are the two files to be compared. They may also be +wild cards, in such cases, they must be enclosed by double or single quotes, or +they may be directory names. If both are directory names, all files in each of +the directories will be included; if only one is directory name, then the +directory name will be prefixed to the file name(s) specified by the other +argument. For example: +.TP +.B "% fitsdiff ""*.fits"" ""/machine/data1"" +.PP +will compare all FITS files in the current directory to the corresponding files +in the directory \fI/machine/data1\fR. +.PP +If the two files are identical within the specified conditions, it will report +"No difference is found." If the value(s) of \fI-c\fR and \fI-k\fR takes the form +\fI\@filename\fR, list is in the text file \fIfilename\fR, and each line in that text +file contains one keyword. +.PP +\fBfitsdiff\fR commandline arguments can also be set using the environment variable +\fIFITSDIFF_SETTINGS\fR. If the \fIFITSDIFF_SETTINGS\fR environment variable is present, +each argument present will override the corresponding argument on the +commandline. This environment variable exists to make it easier to change the +behavior of \fBfitsdiff\fR on a global level, such as in a set of regression tests. +.SH GENERIC OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Display terse usage information (help). +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Produce no output and just return a status code. +.TP +\fB\-n\fR \fIINTEGER\fR, \fB\-\-num\-diffs\fR=\fIINTEGER\fR +Max number of data differences (image pixel or table element) to report per extension (default 10). +.TP +\fB\-d\fR \fINUMBER\fR, \fB\-\-difference-tolerance\fR=\fINUMBER\fR +The relative tolerance for comparison of two numbers, +specifically two floating point numbers. This applies +to data in both images and tables, and to floating +point keyword values in headers (default 0.0). +.TP +\fB\-b\fR, \fB\-\-no\-ignore\-blanks\fR +Don't ignore trailing blanks (whitespace) in string +values. Otherwise trailing blanks both in header +keywords/values and in table column values) are not +treated as significant i.e. without this option 'ABC ' and 'ABC' are considered equivalent. +.TP +\fB\-\-no\-ignore\-blank\-cards\fR +Don't ignore entirely blank cards in headers. Normally \fIfitsdiff\fR does not +consider blank cards when comparing headers, but this will ensure that even blank +cards match up. +.TP +\fB\-o\fR \fIFILE\fR, \fB\-\-output\-file\fR=\fIFILE\fR +Output results to this file; otherwise results are printed to stdout. +.SH "HEADER COMPARISON OPTIONS" +.TP +\fB\-k\fR \fIKEYWORDS\fR, \fB\-\-ignore\-keywords\fR=\fIKEYWORDS\fR +Comma-separated list of keywords not to be compared. +Keywords may contain wildcard patterns. To exclude +all keywords, use "*"; make sure to have double or +single quotes around the asterisk. +.TP +\fB\-c\fR \fIKEYWORDS\fR, \fB\-\-ignore\-comments\fR=\fIKEYWORDS\fR +Comma-separated list of keywords whose comments will not be compared. +Wildcards may be used as with \fI\-\-ignore-keywords\fR. +.SH "TABLE COMPARISON OPTIONS" +.TP +\fB\-f\fR \fICOLUMNS\fR, \fB\-\-ignore\-fields\fR=\fICOLUMNS\fR +Comma-separated list of fields (i.e. columns) not to be compared. +All columns may be excluded using "*" as with \fI\-\-ignore-keywords\fR. +.SH "EXAMPLES" +.B "% fitsdiff -k filename,filtnam1 -n 5 -d 1.e-6 test1.fits test2" +.br +This command will compare files \fItest1.fits\fR and \fItest2.fits\fR, report maximum of 5 +different pixels values per extension, only report data values larger than +1.e-6 relative to each other, and will neglect the different values of +keywords \fIFILENAME\fR and \fIFILTNAM1\fR (or their very existence). + diff --git a/fitsheader.1 b/fitsheader.1 new file mode 100644 index 0000000..4add989 --- /dev/null +++ b/fitsheader.1 @@ -0,0 +1,36 @@ +.TH FITSHEADER 1 "April 2015" "fitsheader" "astropy 1.0.2" +.SH NAME +fitsheader \- Print the header(s) of a FITS file. +.SH DESCRIPTION +usage: fitsheader [\-h] [\-e HDU] [\-k KEYWORD] [\-t [FORMAT]] [\-c] +.IP +filename [filename ...] +.PP +Print the header(s) of a FITS file. Optional arguments allow the desired +extension(s), keyword(s), and output format to be specified. Note that in the +case of a compressed image, the decompressed header is shown by default. +.SS "positional arguments:" +.TP +filename +path to one or more files; wildcards are supported +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-e\fR HDU, \fB\-\-extension\fR HDU +specify the extension by name or number; this argument +can be repeated to select multiple extensions +.TP +\fB\-k\fR KEYWORD, \fB\-\-keyword\fR KEYWORD +specify a keyword; this argument can be repeated to +select multiple keywords; also supports wildcards +.TP +\fB\-t\fR [FORMAT], \fB\-\-table\fR [FORMAT] +print the header(s) in machine\-readable table format; +the default format is "ascii.fixed_width" (can be +"ascii.csv", "ascii.html", "ascii.latex", "fits", etc) +.TP +\fB\-c\fR, \fB\-\-compressed\fR +for compressed image data, show the true header which +describes the compression rather than the data diff --git a/fitsinfo.1 b/fitsinfo.1 new file mode 100644 index 0000000..8b87dcb --- /dev/null +++ b/fitsinfo.1 @@ -0,0 +1,31 @@ +.TH fitsinfo 1 "April 2015" "fitsdiff" "astropy 1.1" +.SH NAME +fitsinfo \- Print a summary of the HDUs in one or more FITS files(s) +.SH SYNOPSIS +.B fitsinfo +\fIfilename\fR [\fIfilename\fR ...] +.SH DESCRIPTION +.PP +\fBfitsinfo\fR is a command-line script based on astropy.io.fits for +printing a summary of the HDUs in one or more FITS files(s) to the +standard output. +.SH EXAMPLES +.PP +Example usage of \fBfitsinfo\fR: +.PP +1. Print a summary of the HDUs in a FITS file: +.PP + $ fitsinfo filename.fits + + Filename: filename.fits + No. Name Type Cards Dimensions Format + 0 PRIMARY PrimaryHDU 138 () + 1 SCI ImageHDU 61 (800, 800) int16 + 2 SCI ImageHDU 61 (800, 800) int16 + 3 SCI ImageHDU 61 (800, 800) int16 + 4 SCI ImageHDU 61 (800, 800) int16 +.PP +2. Print a summary of HDUs of all the FITS files in the current directory: +.PP + $ fitsinfo *.fits +. diff --git a/patches/Allow-pytest-3.x-to-use-plugin-for-doctests-in-.rst-files.patch b/patches/Allow-pytest-3.x-to-use-plugin-for-doctests-in-.rst-files.patch new file mode 100644 index 0000000..5c140f3 --- /dev/null +++ b/patches/Allow-pytest-3.x-to-use-plugin-for-doctests-in-.rst-files.patch @@ -0,0 +1,123 @@ +From: Marten van Kerkwijk +Date: Wed, 11 Jan 2017 21:59:16 -0500 +Subject: Allow pytest 3.x to use plugin for doctests in .rst files. + +Pull request: https://github.com/astropy/astropy/pull/5688 +--- + astropy/tests/pytest_plugins.py | 17 ++++------------- + astropy/tests/tests/test_runner.py | 16 +++++++++------- + setup.cfg | 2 +- + 3 files changed, 14 insertions(+), 21 deletions(-) + +diff --git a/astropy/tests/pytest_plugins.py b/astropy/tests/pytest_plugins.py +index 27b683d..64f7b74 100644 +--- a/astropy/tests/pytest_plugins.py ++++ b/astropy/tests/pytest_plugins.py +@@ -180,7 +180,8 @@ def pytest_configure(config): + + # uses internal doctest module parsing mechanism + finder = DocTestFinderPlus() +- runner = doctest.DebugRunner(verbose=False, optionflags=opts) ++ runner = doctest.DebugRunner(verbose=False, optionflags=opts, ++ checker=AstropyOutputChecker()) + for test in finder.find(module): + if test.examples: # skip empty doctests + if config.getvalue("remote_data") != 'any': +@@ -191,21 +192,11 @@ def pytest_configure(config): + yield doctest_plugin.DoctestItem( + test.name, self, runner, test) + +- # This is for py.test prior to 2.4.0 +- def runtest(self): +- return +- +- class DocTestTextfilePlus(doctest_plugin.DoctestTextfile): ++ class DocTestTextfilePlus(doctest_plugin.DoctestItem, pytest.Module): + def runtest(self): + # satisfy `FixtureRequest` constructor... + self.funcargs = {} +- try: +- self._fixtureinfo = doctest_plugin.FuncFixtureInfo((), [], {}) +- fixture_request = doctest_plugin.FixtureRequest(self) +- except AttributeError: # pytest >= 2.8.0 +- python_plugin = config.pluginmanager.getplugin('python') +- self._fixtureinfo = python_plugin.FuncFixtureInfo((), [], {}) +- fixture_request = python_plugin.FixtureRequest(self) ++ fixture_request = doctest_plugin._setup_fixtures(self) + + failed, tot = doctest.testfile( + str(self.fspath), module_relative=False, +diff --git a/astropy/tests/tests/test_runner.py b/astropy/tests/tests/test_runner.py +index a147cd9..0642c7f 100644 +--- a/astropy/tests/tests/test_runner.py ++++ b/astropy/tests/tests/test_runner.py +@@ -1,9 +1,11 @@ +-from astropy.tests.runner import TestRunner, TestRunnerBase, keyword ++from astropy.tests.runner import TestRunner as T_Runner ++from astropy.tests.runner import TestRunnerBase as T_RunnerBase ++from astropy.tests.runner import keyword + from astropy.tests.helper import pytest + + + def test_disable_kwarg(): +- class no_remote_data(TestRunner): ++ class no_remote_data(T_Runner): + @keyword() + def remote_data(self, remote_data, kwargs): + return NotImplemented +@@ -14,13 +16,13 @@ def test_disable_kwarg(): + + + def test_wrong_kwarg(): +- r = TestRunner('.') ++ r = T_Runner('.') + with pytest.raises(TypeError): + r.run_tests(spam='eggs') + + + def test_invalid_kwarg(): +- class bad_return(TestRunnerBase): ++ class bad_return(T_RunnerBase): + @keyword() + def remote_data(self, remote_data, kwargs): + return 'bob' +@@ -31,7 +33,7 @@ def test_invalid_kwarg(): + + + def test_new_kwarg(): +- class Spam(TestRunnerBase): ++ class Spam(T_RunnerBase): + @keyword() + def spam(self, spam, kwargs): + return [spam] +@@ -44,7 +46,7 @@ def test_new_kwarg(): + + + def test_priority(): +- class Spam(TestRunnerBase): ++ class Spam(T_RunnerBase): + @keyword() + def spam(self, spam, kwargs): + return [spam] +@@ -61,7 +63,7 @@ def test_priority(): + + + def test_docs(): +- class Spam(TestRunnerBase): ++ class Spam(T_RunnerBase): + @keyword() + def spam(self, spam, kwargs): + """ +diff --git a/setup.cfg b/setup.cfg +index 206e6f8..5b3e995 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -12,7 +12,7 @@ all_files = 1 + upload-dir = docs/_build/html + show-response = 1 + +-[pytest] ++[tool:pytest] + minversion = 2.3.3 + norecursedirs = ".tox" "build" "docs[\/]_build" "astropy[\/]extern" "astropy[\/]utils[\/]compat[\/]futures" + doctest_plus = enabled diff --git a/patches/Ensure-NUMPY_LT_1_12-works-for-beta-prerelease.patch b/patches/Ensure-NUMPY_LT_1_12-works-for-beta-prerelease.patch new file mode 100644 index 0000000..9c44156 --- /dev/null +++ b/patches/Ensure-NUMPY_LT_1_12-works-for-beta-prerelease.patch @@ -0,0 +1,22 @@ +From: Marten van Kerkwijk +Date: Sat, 24 Dec 2016 17:06:08 -0500 +Subject: Ensure NUMPY_LT_1_12 works for beta prerelease. + +Pull request: https://github.com/astropy/astropy/pull/5646 +--- + astropy/utils/compat/numpycompat.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/astropy/utils/compat/numpycompat.py b/astropy/utils/compat/numpycompat.py +index fbdd029..bda721f 100644 +--- a/astropy/utils/compat/numpycompat.py ++++ b/astropy/utils/compat/numpycompat.py +@@ -21,7 +21,7 @@ NUMPY_LT_1_9_1 = not minversion('numpy', '1.9.1') + NUMPY_LT_1_10 = not minversion('numpy', '1.10.0') + NUMPY_LT_1_10_4 = not minversion('numpy', '1.10.4') + NUMPY_LT_1_11 = not minversion('numpy', '1.11.0') +-NUMPY_LT_1_12 = not minversion('numpy', '1.12dev') ++NUMPY_LT_1_12 = not minversion('numpy', '1.12') + + + def _monkeypatch_unicode_mask_fill_values(): diff --git a/patches/Fix-default-value-for-remote_data-option.patch b/patches/Fix-default-value-for-remote_data-option.patch new file mode 100644 index 0000000..d104e3f --- /dev/null +++ b/patches/Fix-default-value-for-remote_data-option.patch @@ -0,0 +1,35 @@ +From: Thomas Robitaille +Date: Thu, 12 Jan 2017 11:54:25 +0000 +Subject: Fix default value for remote_data option + +Pull request: https://github.com/astropy/astropy/pull/5689 +--- + astropy/tests/runner.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/astropy/tests/runner.py b/astropy/tests/runner.py +index cf11c2f..6f1e6b4 100644 +--- a/astropy/tests/runner.py ++++ b/astropy/tests/runner.py +@@ -353,7 +353,7 @@ class TestRunner(TestRunnerBase): + + return [] + +- @keyword() ++ @keyword(default_value='none') + def remote_data(self, remote_data, kwargs): + """ + remote_data : {'none', 'astropy', 'any'}, optional +@@ -369,9 +369,10 @@ class TestRunner(TestRunnerBase): + remote_data = 'none' + elif remote_data not in ('none', 'astropy', 'any'): + warnings.warn("The remote_data option should be one of " +- "none/astropy/any. For backward-compatibility, " ++ "none/astropy/any (found {0}). For backward-compatibility, " + "assuming 'any', but you should change the option to be " +- "one of the supported ones to avoid issues in future.", ++ "one of the supported ones to avoid issues in " ++ "future.".format(remote_data), + AstropyDeprecationWarning) + remote_data = 'any' + diff --git a/patches/Use-parametrize-instead-of-yield.patch b/patches/Use-parametrize-instead-of-yield.patch new file mode 100644 index 0000000..1019ff1 --- /dev/null +++ b/patches/Use-parametrize-instead-of-yield.patch @@ -0,0 +1,850 @@ +From: kelle +Date: Sat, 7 Jan 2017 17:45:29 -0500 +Subject: Use parametrize instead of yield. + +Pull request: https://github.com/astropy/astropy/pull/5678 +Pull request: https://github.com/astropy/astropy/pull/5682 +--- + astropy/io/votable/tests/vo_test.py | 5 +- + astropy/units/tests/test_format.py | 466 ++++++++++++++++-------------------- + astropy/wcs/tests/test_profiling.py | 99 +++----- + astropy/wcs/tests/test_wcs.py | 146 +++++------ + 4 files changed, 298 insertions(+), 418 deletions(-) + +diff --git a/astropy/io/votable/tests/vo_test.py b/astropy/io/votable/tests/vo_test.py +index 587fc59..31acb9c 100644 +--- a/astropy/io/votable/tests/vo_test.py ++++ b/astropy/io/votable/tests/vo_test.py +@@ -737,13 +737,10 @@ def table_from_scratch(): + + + def test_open_files(): +- def test_file(filename): +- parse(filename, pedantic=False) +- + for filename in get_pkg_data_filenames('data', pattern='*.xml'): + if filename.endswith('custom_datatype.xml'): + continue +- yield test_file, filename ++ parse(filename, pedantic=False) + + + @raises(VOTableSpecError) +diff --git a/astropy/units/tests/test_format.py b/astropy/units/tests/test_format.py +index 9316a59..b5e9d12 100644 +--- a/astropy/units/tests/test_format.py ++++ b/astropy/units/tests/test_format.py +@@ -13,7 +13,7 @@ from __future__ import (absolute_import, unicode_literals, division, + from ...extern import six + + from numpy.testing.utils import assert_allclose +-from ...tests.helper import raises, pytest, catch_warnings ++from ...tests.helper import pytest, catch_warnings + + from ... import units as u + from ...constants import si +@@ -22,246 +22,205 @@ from .. import format as u_format + from ..utils import is_effectively_unity + + +-def test_unit_grammar(): +- def _test_unit_grammar(s, unit): ++@pytest.mark.parametrize('strings, unit', [ ++ (["m s", "m*s", "m.s"], u.m * u.s), ++ (["m/s", "m*s**-1", "m /s", "m / s", "m/ s"], u.m / u.s), ++ (["m**2", "m2", "m**(2)", "m**+2", "m+2", "m^(+2)"], u.m ** 2), ++ (["m**-3", "m-3", "m^(-3)", "/m3"], u.m ** -3), ++ (["m**(1.5)", "m(3/2)", "m**(3/2)", "m^(3/2)"], u.m ** 1.5), ++ (["2.54 cm"], u.Unit(u.cm * 2.54)), ++ (["10+8m"], u.Unit(u.m * 1e8)), ++ # This is the VOUnits documentation, but doesn't seem to follow the ++ # unity grammar (["3.45 10**(-4)Jy"], 3.45 * 1e-4 * u.Jy) ++ (["sqrt(m)"], u.m ** 0.5), ++ (["dB(mW)", "dB (mW)"], u.DecibelUnit(u.mW)), ++ (["mag"], u.mag), ++ (["mag(ct/s)"], u.MagUnit(u.ct / u.s)), ++ (["dex"], u.dex), ++ (["dex(cm s**-2)", "dex(cm/s2)"], u.DexUnit(u.cm / u.s**2))]) ++def test_unit_grammar(strings, unit): ++ for s in strings: + print(s) + unit2 = u_format.Generic.parse(s) + assert unit2 == unit + +- data = [ +- (["m s", "m*s", "m.s"], u.m * u.s), +- (["m/s", "m*s**-1", "m /s", "m / s", "m/ s"], u.m / u.s), +- (["m**2", "m2", "m**(2)", "m**+2", "m+2", "m^(+2)"], u.m ** 2), +- (["m**-3", "m-3", "m^(-3)", "/m3"], u.m ** -3), +- (["m**(1.5)", "m(3/2)", "m**(3/2)", "m^(3/2)"], u.m ** 1.5), +- (["2.54 cm"], u.Unit(u.cm * 2.54)), +- (["10+8m"], u.Unit(u.m * 1e8)), +- # This is the VOUnits documentation, but doesn't seem to follow the +- # unity grammar (["3.45 10**(-4)Jy"], 3.45 * 1e-4 * u.Jy) +- (["sqrt(m)"], u.m ** 0.5), +- (["dB(mW)", "dB (mW)"], u.DecibelUnit(u.mW)), +- (["mag"], u.mag), +- (["mag(ct/s)"], u.MagUnit(u.ct / u.s)), +- (["dex"], u.dex), +- (["dex(cm s**-2)", "dex(cm/s2)"], u.DexUnit(u.cm / u.s**2)) +- ] +- +- for strings, unit in data: +- for s in strings: +- yield _test_unit_grammar, s, unit +- +- +-def test_unit_grammar_fail(): +- @raises(ValueError) +- def _test_unit_grammar_fail(s): +- u_format.Generic.parse(s) +- +- data = ['sin( /pixel /s)', +- 'mag(mag)', +- 'dB(dB(mW))', +- 'dex()'] +- +- for s in data: +- yield _test_unit_grammar_fail, s +- +- +-def test_cds_grammar(): +- def _test_cds_grammar(s, unit): ++ ++@pytest.mark.parametrize('string', ['sin( /pixel /s)', 'mag(mag)', ++ 'dB(dB(mW))', 'dex()']) ++def test_unit_grammar_fail(string): ++ with pytest.raises(ValueError): ++ print(string) ++ u_format.Generic.parse(string) ++ ++@pytest.mark.parametrize('strings, unit', [ ++ (["0.1nm"], u.AA), ++ (["mW/m2"], u.Unit(u.erg / u.cm ** 2 / u.s)), ++ (["mW/(m2)"], u.Unit(u.erg / u.cm ** 2 / u.s)), ++ (["km/s", "km.s-1"], u.km / u.s), ++ (["10pix/nm"], u.Unit(10 * u.pix / u.nm)), ++ (["1.5x10+11m"], u.Unit(1.5e11 * u.m)), ++ (["1.5×10+11m"], u.Unit(1.5e11 * u.m)), ++ (["m2"], u.m ** 2), ++ (["10+21m"], u.Unit(u.m * 1e21)), ++ (["2.54cm"], u.Unit(u.cm * 2.54)), ++ (["20%"], 0.20 * u.dimensionless_unscaled), ++ (["10+9"], 1.e9 * u.dimensionless_unscaled), ++ (["2x10-9"], 2.e-9 * u.dimensionless_unscaled), ++ (["---"], u.dimensionless_unscaled), ++ (["ma"], u.ma), ++ (["mAU"], u.mAU), ++ (["uarcmin"], u.uarcmin), ++ (["uarcsec"], u.uarcsec), ++ (["kbarn"], u.kbarn), ++ (["Gbit"], u.Gbit), ++ (["Gibit"], 2 ** 30 * u.bit), ++ (["kbyte"], u.kbyte), ++ (["mRy"], 0.001 * u.Ry), ++ (["mmag"], u.mmag), ++ (["Mpc"], u.Mpc), ++ (["Gyr"], u.Gyr), ++ (["°"], u.degree), ++ (["°/s"], u.degree / u.s), ++ (["Å"], u.AA), ++ (["Å/s"], u.AA / u.s), ++ (["\\h"], si.h)]) ++def test_cds_grammar(strings, unit): ++ for s in strings: + print(s) + unit2 = u_format.CDS.parse(s) + assert unit2 == unit + +- data = [ +- (["0.1nm"], u.AA), +- (["mW/m2"], u.Unit(u.erg / u.cm ** 2 / u.s)), +- (["mW/(m2)"], u.Unit(u.erg / u.cm ** 2 / u.s)), +- (["km/s", "km.s-1"], u.km / u.s), +- (["10pix/nm"], u.Unit(10 * u.pix / u.nm)), +- (["1.5x10+11m"], u.Unit(1.5e11 * u.m)), +- (["1.5×10+11m"], u.Unit(1.5e11 * u.m)), +- (["m2"], u.m ** 2), +- (["10+21m"], u.Unit(u.m * 1e21)), +- (["2.54cm"], u.Unit(u.cm * 2.54)), +- (["20%"], 0.20 * u.dimensionless_unscaled), +- (["10+9"], 1.e9 * u.dimensionless_unscaled), +- (["2x10-9"], 2.e-9 * u.dimensionless_unscaled), +- (["---"], u.dimensionless_unscaled), +- (["ma"], u.ma), +- (["mAU"], u.mAU), +- (["uarcmin"], u.uarcmin), +- (["uarcsec"], u.uarcsec), +- (["kbarn"], u.kbarn), +- (["Gbit"], u.Gbit), +- (["Gibit"], 2 ** 30 * u.bit), +- (["kbyte"], u.kbyte), +- (["mRy"], 0.001 * u.Ry), +- (["mmag"], u.mmag), +- (["Mpc"], u.Mpc), +- (["Gyr"], u.Gyr), +- (["°"], u.degree), +- (["°/s"], u.degree / u.s), +- (["Å"], u.AA), +- (["Å/s"], u.AA / u.s), +- (["\\h"], si.h)] +- +- for strings, unit in data: +- for s in strings: +- yield _test_cds_grammar, s, unit +- +- +-def test_cds_grammar_fail(): +- @raises(ValueError) +- def _test_cds_grammar_fail(s): +- print(s) +- u_format.CDS.parse(s) +- +- data = ['0.1 nm', +- 'solMass(3/2)', +- 'km / s', +- 'km s-1', +- 'pix0.1nm', +- 'pix/(0.1nm)', +- 'km*s', +- 'km**2', +- '5x8+3m', +- '0.1---', +- '---m', +- 'm---', +- 'mag(s-1)', +- 'dB(mW)', +- 'dex(cm s-2)'] +- +- for s in data: +- yield _test_cds_grammar_fail, s +- +- +-def test_ogip_grammar(): +- def _test_ogip_grammar(s, unit): ++ ++@pytest.mark.parametrize('string', [ ++ '0.1 nm', ++ 'solMass(3/2)', ++ 'km / s', ++ 'km s-1', ++ 'pix0.1nm', ++ 'pix/(0.1nm)', ++ 'km*s', ++ 'km**2', ++ '5x8+3m', ++ '0.1---', ++ '---m', ++ 'm---', ++ 'mag(s-1)', ++ 'dB(mW)', ++ 'dex(cm s-2)']) ++def test_cds_grammar_fail(string): ++ with pytest.raises(ValueError): ++ print(string) ++ u_format.CDS.parse(string) ++ ++ ++# These examples are taken from the EXAMPLES section of ++# http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/general/ogip_93_001/ ++@pytest.mark.parametrize('strings, unit', [ ++ (["count /s", "count/s", "count s**(-1)", "count / s", "count /s "], ++ u.count / u.s), ++ (["/pixel /s", "/(pixel * s)"], (u.pixel * u.s) ** -1), ++ (["count /m**2 /s /eV", "count m**(-2) * s**(-1) * eV**(-1)", ++ "count /(m**2 * s * eV)"], ++ u.count * u.m ** -2 * u.s ** -1 * u.eV ** -1), ++ (["erg /pixel /s /GHz", "erg /s /GHz /pixel", "erg /pixel /(s * GHz)"], ++ u.erg / (u.s * u.GHz * u.pixel)), ++ (["keV**2 /yr /angstrom", "10**(10) keV**2 /yr /m"], ++ # Though this is given as an example, it seems to violate the rules ++ # of not raising scales to powers, so I'm just excluding it ++ # "(10**2 MeV)**2 /yr /m" ++ u.keV**2 / (u.yr * u.angstrom)), ++ (["10**(46) erg /s", "10**46 erg /s", "10**(39) J /s", "10**(39) W", ++ "10**(15) YW", "YJ /fs"], ++ 10**46 * u.erg / u.s), ++ (["10**(-7) J /cm**2 /MeV", "10**(-9) J m**(-2) eV**(-1)", ++ "nJ m**(-2) eV**(-1)", "nJ /m**2 /eV"], ++ 10 ** -7 * u.J * u.cm ** -2 * u.MeV ** -1), ++ (["sqrt(erg /pixel /s /GHz)", "(erg /pixel /s /GHz)**(0.5)", ++ "(erg /pixel /s /GHz)**(1/2)", ++ "erg**(0.5) pixel**(-0.5) s**(-0.5) GHz**(-0.5)"], ++ (u.erg * u.pixel ** -1 * u.s ** -1 * u.GHz ** -1) ** 0.5), ++ (["(count /s) (/pixel /s)", "(count /s) * (/pixel /s)", ++ "count /pixel /s**2"], ++ (u.count / u.s) * (1.0 / (u.pixel * u.s)))]) ++def test_ogip_grammar(strings, unit): ++ for s in strings: + print(s) + unit2 = u_format.OGIP.parse(s) + assert unit2 == unit + +- # These examples are taken from the EXAMPLES section of +- # http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/general/ogip_93_001/ +- data = [ +- (["count /s", "count/s", "count s**(-1)", "count / s", "count /s "], +- u.count / u.s), +- (["/pixel /s", "/(pixel * s)"], (u.pixel * u.s) ** -1), +- (["count /m**2 /s /eV", "count m**(-2) * s**(-1) * eV**(-1)", +- "count /(m**2 * s * eV)"], +- u.count * u.m ** -2 * u.s ** -1 * u.eV ** -1), +- (["erg /pixel /s /GHz", "erg /s /GHz /pixel", "erg /pixel /(s * GHz)"], +- u.erg / (u.s * u.GHz * u.pixel)), +- (["keV**2 /yr /angstrom", "10**(10) keV**2 /yr /m", +- # Though this is given as an example, it seems to violate the rules +- # of not raising scales to powers, so I'm just excluding it +- # "(10**2 MeV)**2 /yr /m" +- ], +- u.keV**2 / (u.yr * u.angstrom)), +- (["10**(46) erg /s", "10**46 erg /s", "10**(39) J /s", "10**(39) W", +- "10**(15) YW", "YJ /fs"], +- 10**46 * u.erg / u.s), +- (["10**(-7) J /cm**2 /MeV", "10**(-9) J m**(-2) eV**(-1)", +- "nJ m**(-2) eV**(-1)", "nJ /m**2 /eV"], +- 10 ** -7 * u.J * u.cm ** -2 * u.MeV ** -1), +- (["sqrt(erg /pixel /s /GHz)", "(erg /pixel /s /GHz)**(0.5)", +- "(erg /pixel /s /GHz)**(1/2)", +- "erg**(0.5) pixel**(-0.5) s**(-0.5) GHz**(-0.5)"], +- (u.erg * u.pixel ** -1 * u.s ** -1 * u.GHz ** -1) ** 0.5), +- (["(count /s) (/pixel /s)", "(count /s) * (/pixel /s)", +- "count /pixel /s**2"], +- (u.count / u.s) * (1.0 / (u.pixel * u.s)))] +- +- for strings, unit in data: +- for s in strings: +- yield _test_ogip_grammar, s, unit +- +- +-def test_ogip_grammar_fail(): +- @raises(ValueError) +- def _test_ogip_grammar_fail(s): +- u_format.OGIP.parse(s) +- +- data = ['log(photon /m**2 /s /Hz)', +- 'sin( /pixel /s)', +- 'log(photon /cm**2 /s /Hz) /(sin( /pixel /s))', +- 'log(photon /cm**2 /s /Hz) (sin( /pixel /s))**(-1)', +- 'dB(mW)', 'dex(cm/s**2)'] +- +- for s in data: +- yield _test_ogip_grammar_fail, s +- +- +-def test_roundtrip(): +- def _test_roundtrip(unit): +- a = core.Unit(unit.to_string('generic'), format='generic') +- b = core.Unit(unit.decompose().to_string('generic'), format='generic') +- assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) +- assert_allclose(b.decompose().scale, unit.decompose().scale, rtol=1e-2) +- +- for key, val in u.__dict__.items(): +- if isinstance(val, core.UnitBase) and not isinstance(val, core.PrefixUnit): +- yield _test_roundtrip, val +- +- +-def test_roundtrip_vo_unit(): +- def _test_roundtrip_vo_unit(unit, skip_decompose): +- a = core.Unit(unit.to_string('vounit'), format='vounit') +- assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) +- if skip_decompose: +- return +- u = unit.decompose().to_string('vounit') +- assert ' ' not in u +- b = core.Unit(u, format='vounit') +- assert_allclose(b.decompose().scale, unit.decompose().scale, rtol=1e-2) +- +- x = u_format.VOUnit +- for key, val in x._units.items(): +- if isinstance(val, core.UnitBase) and not isinstance(val, core.PrefixUnit): +- yield _test_roundtrip_vo_unit, val, val in (u.mag, u.dB) +- +- +-def test_roundtrip_fits(): +- def _test_roundtrip_fits(unit): +- s = unit.to_string('fits') +- a = core.Unit(s, format='fits') +- assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) +- +- for key, val in u_format.Fits._units.items(): +- if isinstance(val, core.UnitBase) and not isinstance(val, core.PrefixUnit): +- yield _test_roundtrip_fits, val +- + +-def test_roundtrip_cds(): +- def _test_roundtrip_cds(unit): +- a = core.Unit(unit.to_string('cds'), format='cds') +- assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) +- try: +- b = core.Unit(unit.decompose().to_string('cds'), format='cds') +- except ValueError: # skip mag: decomposes into dex, unknown to OGIP +- return ++@pytest.mark.parametrize('string', [ ++ 'log(photon /m**2 /s /Hz)', ++ 'sin( /pixel /s)', ++ 'log(photon /cm**2 /s /Hz) /(sin( /pixel /s))', ++ 'log(photon /cm**2 /s /Hz) (sin( /pixel /s))**(-1)', ++ 'dB(mW)', 'dex(cm/s**2)']) ++def test_ogip_grammar_fail(string): ++ with pytest.raises(ValueError): ++ print(string) ++ u_format.OGIP.parse(string) ++ ++ ++@pytest.mark.parametrize('unit', [val for key, val in u.__dict__.items() ++ if (isinstance(val, core.UnitBase) and ++ not isinstance(val, core.PrefixUnit))]) ++def test_roundtrip(unit): ++ a = core.Unit(unit.to_string('generic'), format='generic') ++ b = core.Unit(unit.decompose().to_string('generic'), format='generic') ++ assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) ++ assert_allclose(b.decompose().scale, unit.decompose().scale, rtol=1e-2) ++ ++ ++@pytest.mark.parametrize('unit', [ ++ val for key, val in u_format.VOUnit._units.items() ++ if (isinstance(val, core.UnitBase) and ++ not isinstance(val, core.PrefixUnit))]) ++def test_roundtrip_vo_unit(unit): ++ a = core.Unit(unit.to_string('vounit'), format='vounit') ++ assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) ++ if unit not in (u.mag, u.dB): ++ ud = unit.decompose().to_string('vounit') ++ assert ' ' not in ud ++ b = core.Unit(ud, format='vounit') + assert_allclose(b.decompose().scale, unit.decompose().scale, rtol=1e-2) + +- x = u_format.CDS +- for key, val in x._units.items(): +- if isinstance(val, core.UnitBase) and not isinstance(val, core.PrefixUnit): +- yield _test_roundtrip_cds, val + ++@pytest.mark.parametrize('unit', [ ++ val for key, val in u_format.Fits._units.items() ++ if (isinstance(val, core.UnitBase) and ++ not isinstance(val, core.PrefixUnit))]) ++def test_roundtrip_fits(unit): ++ s = unit.to_string('fits') ++ a = core.Unit(s, format='fits') ++ assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) + +-def test_roundtrip_ogip(): +- def _test_roundtrip_ogip(unit): +- a = core.Unit(unit.to_string('ogip'), format='ogip') +- assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) +- try: +- b = core.Unit(unit.decompose().to_string('ogip'), format='ogip') +- except ValueError: # skip mag: decomposes into dex, unknown to OGIP +- return +- assert_allclose(b.decompose().scale, unit.decompose().scale, rtol=1e-2) + +- x = u_format.OGIP +- for key, val in x._units.items(): +- if isinstance(val, core.UnitBase) and not isinstance(val, core.PrefixUnit): +- yield _test_roundtrip_ogip, val ++@pytest.mark.parametrize('unit', [ ++ val for key, val in u_format.CDS._units.items() ++ if (isinstance(val, core.UnitBase) and ++ not isinstance(val, core.PrefixUnit))]) ++def test_roundtrip_cds(unit): ++ a = core.Unit(unit.to_string('cds'), format='cds') ++ assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) ++ try: ++ b = core.Unit(unit.decompose().to_string('cds'), format='cds') ++ except ValueError: # skip mag: decomposes into dex, unknown to OGIP ++ return ++ assert_allclose(b.decompose().scale, unit.decompose().scale, rtol=1e-2) ++ ++ ++@pytest.mark.parametrize('unit', [ ++ val for key, val in u_format.OGIP._units.items() ++ if (isinstance(val, core.UnitBase) and ++ not isinstance(val, core.PrefixUnit))]) ++def test_roundtrip_ogip(unit): ++ a = core.Unit(unit.to_string('ogip'), format='ogip') ++ assert_allclose(a.decompose().scale, unit.decompose().scale, rtol=1e-2) ++ try: ++ b = core.Unit(unit.decompose().to_string('ogip'), format='ogip') ++ except ValueError: # skip mag: decomposes into dex, unknown to OGIP ++ return ++ assert_allclose(b.decompose().scale, unit.decompose().scale, rtol=1e-2) + + + def test_fits_units_available(): +@@ -307,22 +266,16 @@ def test_latex_inline_scale(): + assert fluxunit.to_string('latex_inline') == latex_inline + + +-def test_format_styles(): ++@pytest.mark.parametrize('format_spec, string', [ ++ ('generic','erg / (cm2 s)'), ++ ('s', 'erg / (cm2 s)'), ++ ('console', ' erg \n ------\n s cm^2'), ++ ('latex', '$\\mathrm{\\frac{erg}{s\\,cm^{2}}}$'), ++ ('latex_inline', '$\\mathrm{erg\\,s^{-1}\\,cm^{-2}}$'), ++ ('>20s',' erg / (cm2 s)')]) ++def test_format_styles(format_spec, string): + fluxunit = u.erg / (u.cm ** 2 * u.s) +- def _test_format_styles(format_spec, s): +- assert format(fluxunit, format_spec) == s +- +- format_s_pairs = [ +- ('generic','erg / (cm2 s)'), +- ('s', 'erg / (cm2 s)'), +- ('console', ' erg \n ------\n s cm^2'), +- ('latex', '$\\mathrm{\\frac{erg}{s\\,cm^{2}}}$'), +- ('latex_inline', '$\\mathrm{erg\\,s^{-1}\\,cm^{-2}}$'), +- ('>20s',' erg / (cm2 s)'), +- ] +- +- for format_, s in format_s_pairs: +- yield _test_format_styles, format_, s ++ assert format(fluxunit, format_spec) == string + + + def test_flatten_to_known(): +@@ -332,10 +285,9 @@ def test_flatten_to_known(): + assert myunit2.to_string('fits') == 'bit3 erg Hz-1' + + +-@raises(ValueError) + def test_flatten_impossible(): + myunit = u.def_unit("FOOBAR_Two") +- with u.add_enabled_units(myunit): ++ with u.add_enabled_units(myunit), pytest.raises(ValueError): + myunit.to_string('fits') + + +@@ -434,34 +386,20 @@ def test_deprecated_did_you_mean_units(): + assert '0.1nm' in six.text_type(w[0].message) + + +-def test_fits_function(): ++@pytest.mark.parametrize('string', ['mag(ct/s)', 'dB(mW)', 'dex(cm s**-2)']) ++def test_fits_function(string): + # Function units cannot be written, so ensure they're not parsed either. +- @raises(ValueError) +- def _test_fits_grammar_fail(s): +- print(s) +- u_format.Fits().parse(s) +- +- data = ['mag(ct/s)', +- 'dB(mW)', +- 'dex(cm s**-2)'] +- +- for s in data: +- yield _test_fits_grammar_fail, s ++ with pytest.raises(ValueError): ++ print(string) ++ u_format.Fits().parse(string) + + +-def test_vounit_function(): ++@pytest.mark.parametrize('string', ['mag(ct/s)', 'dB(mW)', 'dex(cm s**-2)']) ++def test_vounit_function(string): + # Function units cannot be written, so ensure they're not parsed either. +- @raises(ValueError) +- def _test_vounit_grammar_fail(s): +- print(s) +- u_format.VOUnit().parse(s) +- +- data = ['mag(ct/s)', +- 'dB(mW)', +- 'dex(cm s**-2)'] +- +- for s in data: +- yield _test_vounit_grammar_fail, s ++ with pytest.raises(ValueError): ++ print(string) ++ u_format.VOUnit().parse(string) + + + def test_vounit_binary_prefix(): +diff --git a/astropy/wcs/tests/test_profiling.py b/astropy/wcs/tests/test_profiling.py +index a17a076..57d9a93 100644 +--- a/astropy/wcs/tests/test_profiling.py ++++ b/astropy/wcs/tests/test_profiling.py +@@ -7,84 +7,61 @@ import os + + import numpy as np + ++from ...tests.helper import pytest + from ...utils.data import get_pkg_data_filenames, get_pkg_data_contents + from ...utils.misc import NumpyRNGContext + + from ... import wcs + ++#hdr_map_file_list = list(get_pkg_data_filenames("maps", pattern="*.hdr")) + +-def test_maps(): +- def test_map(filename): +- header = get_pkg_data_contents(os.path.join("maps", filename)) +- wcsobj = wcs.WCS(header) +- +- with NumpyRNGContext(123456789): +- x = np.random.rand(2 ** 12, wcsobj.wcs.naxis) +- world = wcsobj.wcs_pix2world(x, 1) +- pix = wcsobj.wcs_world2pix(x, 1) +- +- hdr_file_list = list(get_pkg_data_filenames("maps", pattern="*.hdr")) +- +- # actually perform a test for each one +- for filename in hdr_file_list: +- +- # use the base name of the file, because everything we yield +- # will show up in the test name in the pandokia report +- filename = os.path.basename(filename) +- +- # yield a function name and parameters to make a generated test +- yield test_map, filename ++# use the base name of the file, because everything we yield ++# will show up in the test name in the pandokia report ++hdr_map_file_list = [os.path.basename(fname) for fname in get_pkg_data_filenames("maps", pattern="*.hdr")] + +- # AFTER we tested with every file that we found, check to see that we +- # actually have the list we expect. If N=0, we will not have performed +- # any tests at all. If N < n_data_files, we are missing some files, +- # so we will have skipped some tests. Without this check, both cases +- # happen silently! ++# Checking the number of files before reading them in. ++# OLD COMMENTS: ++# AFTER we tested with every file that we found, check to see that we ++# actually have the list we expect. If N=0, we will not have performed ++# any tests at all. If N < n_data_files, we are missing some files, ++# so we will have skipped some tests. Without this check, both cases ++# happen silently! + +- # how many do we expect to see? +- n_data_files = 28 +- +- if len(hdr_file_list) != n_data_files: +- assert False, ( +- "test_maps has wrong number data files: found {}, expected " +- " {}".format(len(hdr_file_list), n_data_files)) +- # b.t.w. If this assert happens, py.test reports one more test +- # than it would have otherwise. ++def test_read_map_files(): ++ # how many map files we expect to see ++ n_map_files = 28 + ++ assert len(hdr_map_file_list) == n_map_files, ( ++ "test_read_map_files has wrong number data files: found {}, expected " ++ " {}".format(len(hdr_map_file_list), n_map_files)) + +-def test_spectra(): +- def test_spectrum(filename): +- header = get_pkg_data_contents(os.path.join("spectra", filename)) ++@pytest.mark.parametrize("filename", hdr_map_file_list) ++def test_map(filename): ++ header = get_pkg_data_contents(os.path.join("maps", filename)) + wcsobj = wcs.WCS(header) ++ + with NumpyRNGContext(123456789): +- x = np.random.rand(2 ** 16, wcsobj.wcs.naxis) ++ x = np.random.rand(2 ** 12, wcsobj.wcs.naxis) + world = wcsobj.wcs_pix2world(x, 1) + pix = wcsobj.wcs_world2pix(x, 1) + +- hdr_file_list = list(get_pkg_data_filenames("spectra", pattern="*.hdr")) ++hdr_spec_file_list = [os.path.basename(fname) for fname in get_pkg_data_filenames("spectra", pattern="*.hdr")] + +- # actually perform a test for each one +- for filename in hdr_file_list: ++def test_read_spec_files(): ++ # how many spec files expected ++ n_spec_files = 6 + +- # use the base name of the file, because everything we yield +- # will show up in the test name in the pandokia report +- filename = os.path.basename(filename) +- +- # yield a function name and parameters to make a generated test +- yield test_spectrum, filename +- +- # AFTER we tested with every file that we found, check to see that we +- # actually have the list we expect. If N=0, we will not have performed +- # any tests at all. If N < n_data_files, we are missing some files, +- # so we will have skipped some tests. Without this check, both cases +- # happen silently! +- +- # how many do we expect to see? +- n_data_files = 6 +- +- if len(hdr_file_list) != n_data_files: +- assert False, ( ++ assert len(hdr_spec_file_list) == n_spec_files, ( + "test_spectra has wrong number data files: found {}, expected " +- " {}".format(len(hdr_file_list), n_data_files)) ++ " {}".format(len(hdr_spec_file_list), n_spec_files)) + # b.t.w. If this assert happens, py.test reports one more test + # than it would have otherwise. ++ ++@pytest.mark.parametrize("filename", hdr_spec_file_list) ++def test_spectrum(filename): ++ header = get_pkg_data_contents(os.path.join("spectra", filename)) ++ wcsobj = wcs.WCS(header) ++ with NumpyRNGContext(123456789): ++ x = np.random.rand(2 ** 16, wcsobj.wcs.naxis) ++ world = wcsobj.wcs_pix2world(x, 1) ++ pix = wcsobj.wcs_world2pix(x, 1) +diff --git a/astropy/wcs/tests/test_wcs.py b/astropy/wcs/tests/test_wcs.py +index cf9db9a..12e77bc 100644 +--- a/astropy/wcs/tests/test_wcs.py ++++ b/astropy/wcs/tests/test_wcs.py +@@ -26,99 +26,67 @@ from ...io import fits + from ...extern.six.moves import range + + +-# test_maps() is a generator +-def test_maps(): ++class TestMaps(object): ++ def setup(self): ++ # get the list of the hdr files that we want to test ++ self._file_list = list(get_pkg_data_filenames("maps", pattern="*.hdr")) + +- # test_map() is the function that is called to perform the generated test +- def test_map(filename): +- +- # the test parameter is the base name of the file to use; find +- # the file in the installed wcs test directory +- header = get_pkg_data_contents( +- os.path.join("maps", filename), encoding='binary') +- wcsobj = wcs.WCS(header) +- +- world = wcsobj.wcs_pix2world([[97, 97]], 1) +- +- assert_array_almost_equal(world, [[285.0, -66.25]], decimal=1) +- +- pix = wcsobj.wcs_world2pix([[285.0, -66.25]], 1) +- +- assert_array_almost_equal(pix, [[97, 97]], decimal=0) +- +- # get the list of the hdr files that we want to test +- hdr_file_list = list(get_pkg_data_filenames("maps", pattern="*.hdr")) +- +- # actually perform a test for each one +- for filename in hdr_file_list: +- +- # use the base name of the file, because everything we yield +- # will show up in the test name in the pandokia report +- filename = os.path.basename(filename) +- +- # yield a function name and parameters to make a generated test +- yield test_map, filename +- +- # AFTER we tested with every file that we found, check to see that we +- # actually have the list we expect. If N=0, we will not have performed +- # any tests at all. If N < n_data_files, we are missing some files, +- # so we will have skipped some tests. Without this check, both cases +- # happen silently! +- +- # how many do we expect to see? +- n_data_files = 28 +- +- if len(hdr_file_list) != n_data_files: +- assert False, ( +- "test_maps has wrong number data files: found {}, expected " +- " {}".format(len(hdr_file_list), n_data_files)) +- # b.t.w. If this assert happens, py.test reports one more test +- # than it would have otherwise. ++ def test_consistency(self): ++ # Check to see that we actually have the list we expect, so that we ++ # do not get in a situation where the list is empty or incomplete and ++ # the tests still seem to pass correctly. + ++ # how many do we expect to see? ++ n_data_files = 28 + +-# test_spectra() is a generator +-def test_spectra(): +- +- # test_spectrum() is the function that is called to perform the +- # generated test +- def test_spectrum(filename): +- +- # the test parameter is the base name of the file to use; find +- # the file in the installed wcs test directory +- header = get_pkg_data_contents( +- os.path.join("spectra", filename), encoding='binary') +- +- all_wcs = wcs.find_all_wcs(header) +- assert len(all_wcs) == 9 +- +- # get the list of the hdr files that we want to test +- hdr_file_list = list(get_pkg_data_filenames("spectra", pattern="*.hdr")) +- +- # actually perform a test for each one +- for filename in hdr_file_list: +- +- # use the base name of the file, because everything we yield +- # will show up in the test name in the pandokia report +- filename = os.path.basename(filename) +- +- # yield a function name and parameters to make a generated test +- yield test_spectrum, filename +- +- # AFTER we tested with every file that we found, check to see that we +- # actually have the list we expect. If N=0, we will not have performed +- # any tests at all. If N < n_data_files, we are missing some files, +- # so we will have skipped some tests. Without this check, both cases +- # happen silently! +- +- # how many do we expect to see? +- n_data_files = 6 +- +- if len(hdr_file_list) != n_data_files: +- assert False, ( ++ assert len(self._file_list) == n_data_files, ( ++ "test_spectra has wrong number data files: found {}, expected " ++ " {}".format(len(self._file_list), n_data_files)) ++ ++ def test_maps(self): ++ for filename in self._file_list: ++ # use the base name of the file, so we get more useful messages ++ # for failing tests. ++ filename = os.path.basename(filename) ++ # Now find the associated file in the installed wcs test directory. ++ header = get_pkg_data_contents( ++ os.path.join("maps", filename), encoding='binary') ++ # finally run the test. ++ wcsobj = wcs.WCS(header) ++ world = wcsobj.wcs_pix2world([[97, 97]], 1) ++ assert_array_almost_equal(world, [[285.0, -66.25]], decimal=1) ++ pix = wcsobj.wcs_world2pix([[285.0, -66.25]], 1) ++ assert_array_almost_equal(pix, [[97, 97]], decimal=0) ++ ++ ++class TestSpectra(object): ++ def setup(self): ++ self._file_list = list(get_pkg_data_filenames("spectra", ++ pattern="*.hdr")) ++ ++ def test_consistency(self): ++ # Check to see that we actually have the list we expect, so that we ++ # do not get in a situation where the list is empty or incomplete and ++ # the tests still seem to pass correctly. ++ ++ # how many do we expect to see? ++ n_data_files = 6 ++ ++ assert len(self._file_list) == n_data_files, ( + "test_spectra has wrong number data files: found {}, expected " +- " {}".format(len(hdr_file_list), n_data_files)) +- # b.t.w. If this assert happens, py.test reports one more test +- # than it would have otherwise. ++ " {}".format(len(self._file_list), n_data_files)) ++ ++ def test_spectra(self): ++ for filename in self._file_list: ++ # use the base name of the file, so we get more useful messages ++ # for failing tests. ++ filename = os.path.basename(filename) ++ # Now find the associated file in the installed wcs test directory. ++ header = get_pkg_data_contents( ++ os.path.join("spectra", filename), encoding='binary') ++ # finally run the test. ++ all_wcs = wcs.find_all_wcs(header) ++ assert len(all_wcs) == 9 + + + def test_fixes(): diff --git a/patches/disable_helper.patch b/patches/disable_helper.patch new file mode 100644 index 0000000..16acc22 --- /dev/null +++ b/patches/disable_helper.patch @@ -0,0 +1,21 @@ +From: Ole Streicher +Date: Tue, 13 Dec 2016 09:41:39 +0100 +Subject: Disable astropy-helpers copy + +--- + setup.cfg | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.cfg b/setup.cfg +index cc67de4..206e6f8 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -23,7 +23,7 @@ open_files_ignore = "astropy.log" "/etc/hosts" + bitmap = static/wininst_background.bmp + + [ah_bootstrap] +-auto_use = True ++auto_use = False + + [pep8] + # E101 - mix of tabs and spaces diff --git a/patches/external_python_pkgs.patch b/patches/external_python_pkgs.patch new file mode 100644 index 0000000..f4f5238 --- /dev/null +++ b/patches/external_python_pkgs.patch @@ -0,0 +1,196 @@ +From: Ole Streicher +Date: Thu, 12 Jan 2017 11:37:47 +0100 +Subject: Use external python modules instead of convenience copies + +--- + astropy/coordinates/angle_utilities.py | 2 +- + astropy/extern/configobj.py | 5 ++++- + astropy/extern/six.py | 2 +- + astropy/table/jsviewer.py | 14 ++++++++------ + astropy/table/tests/test_jsviewer.py | 6 +++--- + astropy/tests/helper.py | 2 +- + astropy/units/format/cds.py | 4 ++-- + astropy/units/format/generic.py | 4 ++-- + astropy/units/format/ogip.py | 4 ++-- + 9 files changed, 24 insertions(+), 19 deletions(-) + +diff --git a/astropy/coordinates/angle_utilities.py b/astropy/coordinates/angle_utilities.py +index ddaeaf6..06eefaf 100644 +--- a/astropy/coordinates/angle_utilities.py ++++ b/astropy/coordinates/angle_utilities.py +@@ -64,7 +64,7 @@ class _AngleParser(object): + + @classmethod + def _make_parser(cls): +- from ..extern.ply import lex, yacc ++ from ply import lex, yacc + + # List of token names. + tokens = ( +diff --git a/astropy/extern/configobj.py b/astropy/extern/configobj.py +index 8d1bd8c..e3bb0e0 100644 +--- a/astropy/extern/configobj.py ++++ b/astropy/extern/configobj.py +@@ -7,5 +7,8 @@ currently installed version of python. + Also, this should actually never actually show up as a docstring, because + it should get overwritten by the appropriate configobj docstring. + """ ++from __future__ import absolute_import ++import validate ++import configobj ++ + +-from .configobj import configobj, validate, __doc__ +diff --git a/astropy/extern/six.py b/astropy/extern/six.py +index 5398fc0..fb3a30c 100644 +--- a/astropy/extern/six.py ++++ b/astropy/extern/six.py +@@ -13,7 +13,7 @@ _SIX_MIN_VERSION = StrictVersion('1.10.0') + # Update this to prevent Astropy from using its bundled copy of six + # (but only if some other version of at least _SIX_MIN_VERSION can + # be provided) +-_SIX_SEARCH_PATH = ['astropy.extern.bundled.six', 'six'] ++_SIX_SEARCH_PATH = ['six'] + + + def _find_module(name, path=None): +diff --git a/astropy/table/jsviewer.py b/astropy/table/jsviewer.py +index ae99eb9..d856cf8 100644 +--- a/astropy/table/jsviewer.py ++++ b/astropy/table/jsviewer.py +@@ -30,8 +30,8 @@ class Conf(_config.ConfigNamespace): + conf = Conf() + + +-EXTERN_JS_DIR = abspath(join(dirname(extern.__file__), 'js')) +-EXTERN_CSS_DIR = abspath(join(dirname(extern.__file__), 'css')) ++EXTERN_JS_DIR = '/usr/share/javascript' ++EXTERN_CSS_DIR = EXTERN_JS_DIR + + IPYNB_JS_SCRIPT = """ +