debian/0000775000000000000000000000000012316332654007175 5ustar debian/source/0000775000000000000000000000000012270435753010500 5ustar debian/source/lintian-overrides0000664000000000000000000000035312270435753014062 0ustar # We don't use the convinience copies of wcslib and expat, so we can # safely ignore their lintian warnings. outdated-autotools-helper-file cextern/expat/conftools/config.* outdated-autotools-helper-file cextern/wcslib/config/config.* debian/source/format0000664000000000000000000000001412270435753011706 0ustar 3.0 (quilt) debian/python-astropy.install0000664000000000000000000000005012270435753013603 0ustar usr/lib/python2*/dist-packages/astropy* debian/copyright0000664000000000000000000002344112270435753011137 0ustar 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/sphinx/ext/compiler_unparse.py astropy/sphinx/ext/comment_eater.py astropy/sphinx/ext/traitsdoc.py astropy/extern/configobj_*/* 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) 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 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 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/sphinx/ext/numpydoc.py astropy/sphinx/ext/docscrape.py astropy/sphinx/ext/docscrape_sphinx.py astropy/sphinx/ext/phantom_import.py debian/* Copyright: Copyright (C) 2008 Stefan van der Walt , Pauli Virtanen , 2012 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. Files: cextern/sofa/* Copyright: Copyright (C) 2012 Standards Of Fundamental Astronomy Board of the International Astronomical Union. License: SOFA BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING TERMS AND CONDITIONS WHICH APPLY TO ITS USE. . 1. The Software is owned by the IAU SOFA Board ("SOFA"). . 2. Permission is granted to anyone to use the SOFA software for any purpose, including commercial applications, free of charge and without payment of royalties, subject to the conditions and restrictions listed below. . 3. You (the user) may copy and distribute SOFA source code to others, and use and adapt its code and algorithms in your own software, on a world-wide, royalty-free basis. That portion of your distribution that does not consist of intact and unchanged copies of SOFA source code files is a "derived work" that must comply with the following requirements: . a) Your work shall be marked or carry a statement that it (i) uses routines and computations derived by you from software provided by SOFA under license to you; and (ii) does not itself constitute software provided by and/or endorsed by SOFA. . b) The source code of your derived work must contain descriptions of how the derived work is based upon, contains and/or differs from the original SOFA software. . c) The name(s) of all routine(s) in your derived work shall not include the prefix "iau" or "sofa" or trivial modifications thereof such as changes of case. . d) The origin of the SOFA components of your derived work must not be misrepresented; you must not claim that you wrote the original software, nor file a patent application for SOFA software or algorithms embedded in the SOFA software. . e) These requirements must be reproduced intact in any source distribution and shall apply to anyone to whom you have granted a further right to modify the source code of your derived work. . Note that, as originally distributed, the SOFA software is intended to be a definitive implementation of the IAU standards, and consequently third-party modifications are discouraged. All variations, no matter how minor, must be explicitly marked as such, as explained above. . 4. You shall not cause the SOFA software to be brought into disrepute, either by misuse, or use for inappropriate tasks, or by inappropriate modification. . 5. The SOFA software is provided "as is" and SOFA makes no warranty as to its use or performance. SOFA does not and cannot warrant the performance or results which the user may obtain by using the SOFA software. SOFA makes no warranties, express or implied, as to non-infringement of third party rights, merchantability, or fitness for any particular purpose. In no event will SOFA be liable to the user for any consequential, incidental, or special damages, including any lost profits or lost savings, even if a SOFA representative has been advised of such damages, or for any claim by any third party. . 6. The provision of any version of the SOFA software under the terms and conditions specified herein does not imply that future versions will also be made available under the same terms and conditions. . In any published work or commercial product which uses the SOFA software directly, acknowledgement (see www.iausofa.org) is appreciated. . Correspondence concerning SOFA software should be addressed as follows: . By email: sofa@ukho.gov.uk By post: IAU SOFA Center HM Nautical Almanac Office UK Hydrographic Office Admiralty Way, Taunton Somerset, TA1 2DN United Kingdom Comment: Note that these files are not used in the package build process, so the copyright information is included here only as a reference. debian/python3-astropy.lintian-overrides0000664000000000000000000000024212270435753015661 0ustar # The hardening is switched on, but does not cover all functions mentioned # in hardening-check. hardening-no-fortify-functions */astropy/utils/xml/_iterparser.* debian/python3-astropy.install0000664000000000000000000000005012270435753013666 0ustar usr/lib/python3*/dist-packages/astropy* debian/python-astropy-doc.docs0000664000000000000000000000002212270435753013627 0ustar docs/_build/html debian/python-astropy-doc.doc-base0000664000000000000000000000064412270435753014366 0ustar Document: python-astropy Title: Astropy Documentation Author: The Astropy Collaboration. Section: Science/Astronomy Abstract: Astropy is a community-driven package intended to contain much of the core functionality and some common tools needed for performing astronomy and astrophysics with Python. Format: HTML Index: /usr/share/doc/python-astropy-doc/html/index.html Files: /usr/share/doc/python-astropy-doc/html/ debian/changelog0000664000000000000000000001050612316332654011051 0ustar python-astropy (0.3+dfsg-3build1) trusty; urgency=medium * No change rebuild to drop python3.3 compiled extension. -- Dimitri John Ledkov Mon, 31 Mar 2014 19:36:28 +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 debian/python-astropy.lintian-overrides0000664000000000000000000000024312270435753015577 0ustar # The hardening is switched on, but does not cover all functions mentioned # in hardening-check. hardening-no-fortify-functions */astropy/utils/xml/_iterparser.so debian/control0000664000000000000000000000560412316332654010605 0ustar Source: python-astropy Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Science Maintainers Uploaders: Ole Streicher Section: python Priority: optional Build-Depends: cython, debhelper (>= 9), graphviz, libcfitsio3-dev, liberfa-dev, libexpat1-dev, pkg-config, python-all-dev (>= 2.6.6-3~), python-matplotlib, python-nose, python-numpy (>= 1.4), python-setuptools (>= 0.6.4), python-sphinx (>= 1.0.7+dfsg), python-support, python3-all-dev, python3-matplotlib, python3-nose, python3-numpy (>= 1:1.6.2), python3-setuptools (>= 0.6.4), python3-tk, wcslib-dev (>= 4.20), zlib1g-dev Standards-Version: 3.9.5 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/python-astropy.git Vcs-Git: git://anonscm.debian.org/debian-science/packages/python-astropy.git Homepage: http://astropy.org X-Python-Version: >= 2.6 X-Python3-Version: >= 3.2 Package: python-astropy Architecture: any Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends} Suggests: python-astropy-doc, python-h5py, python-scipy, libxml2-utils 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 is expected to be extended by a number of "affiliated packages" that are intended to work with the core package. . The current release is a developer preview. Package: python3-astropy Architecture: any Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends} Suggests: python-astropy-doc 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 is expected to be extended by a number of "affiliated packages" that are intended to work with the core package. . The current release is a developer preview. Package: python-astropy-doc Architecture: all 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 is expected to be extended by a number of "affiliated packages" that are intended to work with the core package. . This package contains the package documentation. debian/rules0000775000000000000000000000310512270435753010257 0ustar #!/usr/bin/make -f PYTHON2:=$(shell pyversions -vr) PYTHON3:=$(shell py3versions -vr) # set the MPLCONFIGDIR to avoid writing into non writable location export HOME=$(CURDIR)/build export MPLCONFIGDIR=$(CURDIR)/build # Prevent setuptools/distribute from accessing the internet. export http_proxy = http://127.0.9.1:9 %: dh $@ --with python2,python3,sphinxdoc build-python%: python$* setup.py build --use-system-libraries # We need to build python2 first, since cython is currently only available for # python2, and we need cython to (re-) generate some of the C files. override_dh_auto_build: $(PYTHON2:%=build-python%) $(PYTHON3:%=build-python%) #dh_auto_build install-python%: python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb override_dh_auto_install: $(PYTHON3:%=install-python%) dh_auto_install rm -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/astropy/sphinx/themes/bootstrap-astropy/static/*.png override_dh_auto_build: dh_auto_build -- --use-system-libraries override_dh_shlibdeps: dh_shlibdeps dh_numpy dh_numpy3 override_dh_installdocs-indep: python setup.py build_sphinx dh_installdocs override_dh_sphinxdoc-arch: # sphinxdoc is only needed on indep and does not work here. override_dh_installchangelogs: dh_installchangelogs docs/changelog.rst override_dh_auto_clean: dh_auto_clean rm -rf build astropy.egg-info rm -rf docs/_build docs/_generated ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) test-python%: python$* setup.py test -vv --args -v override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%) endif debian/watch0000664000000000000000000000024512270435753010232 0ustar # watch control file for uscan version=3 opts=dversionmangle=s/\+dfsg// \ http://pypi.python.org/packages/source/a/astropy/astropy-([0-9].*)\.tar\.gz debian uupdate debian/python-astropy-doc.lintian-overrides0000664000000000000000000000045012270435753016342 0ustar # We store an extra license file since this is linked within the # HTML documentation. It seems to be better to keep this file than # to remove these links or to link to the machine-readable Debian # copyright file. extra-license-file usr/share/doc/python-astropy-doc/html/_sources/license.txt debian/clean0000664000000000000000000000055712270435753010214 0ustar astropy/astropy.cfg astropy/cython_version.py astropy/convolution/boundary_extend.c astropy/convolution/boundary_fill.c astropy/convolution/boundary_none.c astropy/convolution/boundary_wrap.c astropy/table/_np_utils.c astropy/time/erfa_time.c astropy/version.py astropy/wcs/include/docstrings.h astropy/wcs/include/wcsconfig.h astropy/wcs/src/docstrings.c docs/api/* debian/patches/0000775000000000000000000000000012270440322010613 5ustar debian/patches/parallel_fk4_no_fk4.pytch0000664000000000000000000000462112270435753015503 0ustar From 830e4e97ad161342d2df6feff4568a49e05d6fe4 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 10 Dec 2013 10:59:25 -0500 Subject: [PATCH] Speed up fk4_no_e_fk4 test. --- .../tests/accuracy/test_fk4_no_e_fk4.py | 41 ++++++++++------------ 1 file changed, 18 insertions(+), 23 deletions(-) --- a/astropy/coordinates/tests/accuracy/test_fk4_no_e_fk4.py +++ b/astropy/coordinates/tests/accuracy/test_fk4_no_e_fk4.py @@ -25,31 +25,26 @@ t = Table.read(os.path.join(ROOT, 'fk4_no_e_fk4.csv'), format='ascii') - for i in range(len(t)): + # FK4 to FK5 + c1 = FK4(t['ra_in'], t['dec_in'], + unit=(u.degree, u.degree), + obstime=Time(t['obstime'], scale='utc')) + c2 = c1.transform_to(FK4NoETerms) + + # Find difference + diff = angular_separation(c2.ra.radian, c2.dec.radian, + np.radians(t['ra_fk4ne']), np.radians(t['dec_fk4ne'])) + + assert np.all(np.degrees(diff) * 3600. < TOLERANCE) + + # FK5 to FK4 + c1 = FK4NoETerms(t['ra_in'], t['dec_in'], + unit=(u.degree, u.degree), + obstime=Time(t['obstime'], scale='utc')) + c2 = c1.transform_to(FK4) + + # Find difference + diff = angular_separation(c2.ra.radian, c2.dec.radian, + np.radians(t['ra_fk4']), np.radians(t['dec_fk4'])) - # Extract row - r = t[i] - - # FK4 to FK5 - c1 = FK4(r['ra_in'], r['dec_in'], - unit=(u.degree, u.degree), - obstime=Time(r['obstime'], scale='utc')) - c2 = c1.transform_to(FK4NoETerms) - - # Find difference - diff = angular_separation(c2.ra.radian, c2.dec.radian, - np.radians(r['ra_fk4ne']), np.radians(r['dec_fk4ne'])) - - assert np.degrees(diff) * 3600. < TOLERANCE - - # FK5 to FK4 - c1 = FK4NoETerms(r['ra_in'], r['dec_in'], - unit=(u.degree, u.degree), - obstime=Time(r['obstime'], scale='utc')) - c2 = c1.transform_to(FK4) - - # Find difference - diff = angular_separation(c2.ra.radian, c2.dec.radian, - np.radians(r['ra_fk4']), np.radians(r['dec_fk4'])) - - assert np.degrees(diff) * 3600. < TOLERANCE + assert np.all(np.degrees(diff) * 3600. < TOLERANCE) debian/patches/CUNITfix.patch0000664000000000000000000000507612270435753013251 0ustar From 86afcd019cb1c3f49b03bd1ce4c06d1b91bd4d3e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 2 Dec 2013 13:45:33 -0500 Subject: [PATCH] Fix reporting of which CUNITn element was changed by unitfix --- CHANGES.rst | 5 +++++ astropy/wcs/tests/data/validate.txt | 2 +- cextern/patches/cunit-fix-message.diff | 11 +++++++++++ cextern/trim_wcslib.sh | 2 ++ cextern/wcslib/C/wcs.c | 2 +- 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 cextern/patches/cunit-fix-message.diff --- a/CHANGES.rst +++ b/CHANGES.rst @@ -653,6 +653,11 @@ - Fixed a crash that could sometimes occur when running the test suite on systems with platform names containing non-ASCII characters. [#1698] + - When a unit is "fixed" by `astropy.wcs.WCS.fix` or + `astropy.wcs.Wcsprm.unitfix`, it now correctly reports the + ``CUNIT`` field that was changed. (This requires that astropy + was built with the locally distributed version of wcslib). [#1854] + Other Changes and Additions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- a/astropy/wcs/tests/data/validate.txt +++ b/astropy/wcs/tests/data/validate.txt @@ -11,6 +11,6 @@ WCS key ' ': - The WCS transformation has more axes (3) than the image it is associated with (0) - - 'celfix' made the change 'In CUNIT2 : Mismatched units type + - 'celfix' made the change 'In CUNIT3 : Mismatched units type 'length': have 'Hz', want 'm''. - 'unitfix' made the change 'Changed units: 'HZ ' -> 'Hz''. --- /dev/null +++ b/cextern/patches/cunit-fix-message.diff @@ -0,0 +1,11 @@ +--- a/wcslib/C/wcs.c ++++ b/wcslib/C/wcs.c +@@ -2037,7 +2037,7 @@ int wcs_units(struct wcsprm *wcs) + if (wcsunitse(wcs->cunit[i], units, &scale, &offset, &power, + &uniterr)) { + wcserr_set(WCSERR_SET(WCSERR_BAD_COORD_TRANS), +- "In CUNIT%d%.1s: %s", i, (*wcs->alt)?wcs->alt:"", uniterr->msg); ++ "In CUNIT%d%.1s: %s", i+1, (*wcs->alt)?wcs->alt:"", uniterr->msg); + free(uniterr); + return WCSERR_BAD_COORD_TRANS; + } --- a/cextern/wcslib/C/wcs.c +++ b/cextern/wcslib/C/wcs.c @@ -2037,7 +2037,7 @@ if (wcsunitse(wcs->cunit[i], units, &scale, &offset, &power, &uniterr)) { wcserr_set(WCSERR_SET(WCSERR_BAD_COORD_TRANS), - "In CUNIT%d%.1s: %s", i, (*wcs->alt)?wcs->alt:"", uniterr->msg); + "In CUNIT%d%.1s: %s", i+1, (*wcs->alt)?wcs->alt:"", uniterr->msg); free(uniterr); return WCSERR_BAD_COORD_TRANS; } debian/patches/mark_known_failures.patch0000664000000000000000000003613412270435753015717 0ustar Author: Ole Streicher Description: Fix doctest and mark other known test failures on big endian until they get fixed upstream. . The patch for pytest_plugins.py is taken from the git version of this file. Bug: https://github.com/astropy/astropy/issues/1849 Bug: https://github.com/astropy/astropy/issues/1885 --- a/astropy/io/fits/tests/test_connect.py +++ b/astropy/io/fits/tests/test_connect.py @@ -30,6 +30,7 @@ [2.3, 4.5, 6.7, 8.9])), dtype=[('a', int), ('b', 'U1'), ('c', float)]) + @pytest.mark.xfail def test_simple(self, tmpdir): filename = str(tmpdir.join('test_simple.fits')) t1 = Table(self.data) @@ -37,6 +38,7 @@ t2 = Table.read(filename) assert equal_data(t1, t2) + @pytest.mark.xfail def test_simple_meta(self, tmpdir): filename = str(tmpdir.join('test_simple.fits')) t1 = Table(self.data) @@ -64,6 +66,7 @@ assert len(l) == 1 assert l[0].message.startswith('Meta-data keyword ttype1 will be ignored since it conflicts with a FITS reserved keyword') + @pytest.mark.xfail def test_simple_noextension(self, tmpdir): """ Test that file type is recognized without extension @@ -74,6 +77,7 @@ t2 = Table.read(filename) assert equal_data(t1, t2) + @pytest.mark.xfail def test_with_units(self, tmpdir): filename = str(tmpdir.join('test_with_units.fits')) t1 = Table(self.data) @@ -85,6 +89,7 @@ assert t2['a'].unit == u.m assert t2['c'].unit == u.km / u.s + @pytest.mark.xfail def test_masked(self, tmpdir): filename = str(tmpdir.join('test_masked.fits')) t1 = Table(self.data, masked=True) @@ -102,6 +107,7 @@ # assert np.all(t1['b'].mask == t2['b'].mask) # assert np.all(t1['c'].mask == t2['c'].mask) + @pytest.mark.xfail def test_read_from_fileobj(self, tmpdir): filename = str(tmpdir.join('test_read_from_fileobj.fits')) hdu = BinTableHDU(self.data) @@ -138,6 +144,7 @@ def setup_method(self, method): warnings.filterwarnings('always') + @pytest.mark.xfail def test_read(self, tmpdir): filename = str(tmpdir.join('test_read.fits')) self.hdus.writeto(filename) @@ -155,6 +162,7 @@ assert exc.value.args[0] == 'No table found in hdu=0' @pytest.mark.parametrize('hdu', [1, 'first']) + @pytest.mark.xfail def test_read_with_hdu_1(self, tmpdir, hdu): filename = str(tmpdir.join('test_read_with_hdu_1.fits')) self.hdus.writeto(filename) --- a/astropy/tests/pytest_plugins.py +++ b/astropy/tests/pytest_plugins.py @@ -14,10 +14,12 @@ import locale import math import os +import re import shutil import subprocess import sys import tempfile +import warnings from .helper import pytest @@ -32,8 +34,12 @@ help="fail if any test leaves files open") parser.addoption("--doctest-plus", action="store_true", - help="enable running doctests with additional features not " - "found in the normal doctest plugin") + help="enable running doctests with additional " + "features not found in the normal doctest " + "plugin") + + parser.addoption("--doctest-rst", action="store_true", + help="enable running doctests in .rst documentation") parser.addini("doctest_plus", "enable running doctests with additional " "features not found in the normal doctest plugin") @@ -42,6 +48,59 @@ "like the norecursedirs option but applies only to doctest " "collection", type="args", default=()) + parser.addini("doctest_rst", + "Run the doctests in the rst documentation", + default=False) + + +class OutputCheckerFix(doctest.OutputChecker): + """ + A special doctest OutputChecker that normalizes a number of things common + to astropy doctests. + + - Removes u'' prefixes on string literals + - In Numpy dtype strings, removes the leading pipe, i.e. '|S9' -> + 'S9'. Numpy 1.7 no longer includes it in display. + """ + + _literal_re = re.compile( + r"(\W|^)[uU]([rR]?[\'\"])", re.UNICODE) + _remove_byteorder = re.compile( + r"([\'\"])[|<>]([biufcSaUV][0-9]+)([\'\"])", re.UNICODE) + + _original_output_checker = doctest.OutputChecker + + def do_fixes(self, want, got): + want = re.sub(self._literal_re, r'\1\2', want) + want = re.sub(self._remove_byteorder, r'\1\2\3', want) + + got = re.sub(self._literal_re, r'\1\2', got) + got = re.sub(self._remove_byteorder, r'\1\2\3', got) + return want, got + + def check_output(self, want, got, flags): + if flags & FIX: + want, got = self.do_fixes(want, got) + # Can't use super here because doctest.OutputChecker is not a + # new-style class. + return self._original_output_checker.check_output( + self, want, got, flags) + + def output_difference(self, want, got, flags): + if flags & FIX: + want, got = self.do_fixes(want, got) + # Can't use super here because doctest.OutputChecker is not a + # new-style class. + return self._original_output_checker.output_difference( + self, want, got, flags) + + +# We monkey-patch in our replacement doctest OutputChecker. Not +# great, but there isn't really an API to replace the checker when +# using doctest.testfile, unfortunately. +FIX = doctest.register_optionflag('FIX') +doctest.OutputChecker = OutputCheckerFix + def pytest_configure(config): doctest_plugin = config.pluginmanager.getplugin('doctest') @@ -49,6 +108,13 @@ (config.getini('doctest_plus') or config.option.doctest_plus)): return + # These are the default doctest options we use for everything. + # There shouldn't be any need to manually put them in doctests + # themselves. + opts = (doctest.ELLIPSIS | + doctest.NORMALIZE_WHITESPACE | + FIX) + class DocTestModulePlus(doctest_plugin.DoctestModule): # pytest 2.4.0 defines "collect". Prior to that, it defined # "runtest". The "collect" approach is better, because we can @@ -64,7 +130,6 @@ # uses internal doctest module parsing mechanism finder = DocTestFinderPlus() - opts = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE runner = doctest.DebugRunner(verbose=False, optionflags=opts) for test in finder.find(module): if test.examples: # skip empty doctests @@ -75,13 +140,87 @@ def runtest(self): return - config.pluginmanager.register(DoctestPlus(DocTestModulePlus), - 'doctestplus') + class DocTestTextfilePlus(doctest_plugin.DoctestTextfile): + def runtest(self): + # satisfy `FixtureRequest` constructor... + self.funcargs = {} + self._fixtureinfo = doctest_plugin.FuncFixtureInfo((), [], {}) + fixture_request = doctest_plugin.FixtureRequest(self) + failed, tot = doctest.testfile( + str(self.fspath), module_relative=False, + optionflags=opts, parser=DocTestParserPlus(), + extraglobs=dict(getfixture=fixture_request.getfuncargvalue), + raise_on_error=True, verbose=False, encoding='utf-8') + + class DocTestParserPlus(doctest.DocTestParser): + """ + An extension to the builtin DocTestParser that handles the + special directives for skipping tests. + The directives are: -class DoctestPlus(object): + - ``.. doctest-skip::``: Skip the next doctest chunk. - def __init__(self, doctest_module_item_cls): + - ``.. doctest-requires:: module1, module2``: Skip the next + doctest chunk if the given modules/packages are not + installed. + + - ``.. doctest-skip-all``: Skip all subsequent doctests. + """ + + def parse(self, s, name=None): + result = doctest.DocTestParser.parse(self, s, name=name) + + # result is a sequence of alternating text chunks and + # doctest.Example objects. We need to look in the text + # chunks for the special directives that help us determine + # whether the following examples should be skipped. + + required = [] + skip_next = False + skip_all = False + + for entry in result: + if isinstance(entry, six.string_types) and entry: + required = [] + skip_next = False + lines = entry.strip().splitlines() + + if '.. doctest-skip-all' in (x.strip() for x in lines): + skip_all = True + continue + + if not len(lines): + continue + + last_line = lines[-1] + match = re.match( + r'\.\.\s+doctest-skip\s*::', last_line) + if match: + skip_next = True + continue + + match = re.match( + r'\.\.\s+doctest-requires\s*::\s+(.*)', + last_line) + if match: + required = re.split(r'\s*,?\s*', match.group(1)) + elif isinstance(entry, doctest.Example): + if (skip_all or skip_next or + not DocTestFinderPlus.check_required_modules(required)): + entry.options[doctest.SKIP] = True + + return result + + config.pluginmanager.register( + DoctestPlus(DocTestModulePlus, DocTestTextfilePlus, + config.getini('doctest_rst') or config.option.doctest_rst), + 'doctestplus') + + +class DoctestPlus(object): + def __init__(self, doctest_module_item_cls, doctest_textfile_item_cls, + run_rst_doctests): """ doctest_module_item_cls should be a class inheriting `pytest.doctest.DoctestItem` and `pytest.File`. This class handles @@ -90,8 +229,14 @@ available at import time, depending on whether or not the doctest plugin for py.test is available. """ - self._doctest_module_item_cls = doctest_module_item_cls + self._doctest_textfile_item_cls = doctest_textfile_item_cls + self._run_rst_doctests = run_rst_doctests + + if run_rst_doctests and six.PY3: + warnings.warn( + "Running doctests in .rst files is not yet supported on Python 3") + self._run_rst_doctests = False def pytest_ignore_collect(self, path, config): """Skip paths that match any of the doctest_norecursedirs patterns.""" @@ -131,11 +276,23 @@ __doctest_requires__ = {('func1', 'func2'): ['scipy']} """ - - config = parent.config if path.ext == '.py': + if path.basename == 'conf.py': + return None + # Don't override the built-in doctest plugin return self._doctest_module_item_cls(path, parent) + elif self._run_rst_doctests and path.ext == '.rst': + # Ignore generated .rst files + parts = str(path).split(os.path.sep) + if (path.basename.startswith('_') or + any(x.startswith('_') for x in parts) or + any(x == 'api' for x in parts)): + return None + + # TODO: Get better names on these items when they are + # displayed in py.test output + return self._doctest_textfile_item_cls(path, parent) class DocTestFinderPlus(doctest.DocTestFinder): @@ -146,6 +303,20 @@ # Caches the results of import attempts _import_cache = {} + @classmethod + def check_required_modules(cls, mods): + for mod in mods: + if mod in cls._import_cache: + return cls._import_cache[mod] + try: + imp.find_module(mod) + except ImportError: + cls._import_cache[mod] = False + return False + else: + cls._import_cache[mod] = True + return True + def find(self, obj, name=None, module=None, globs=None, extraglobs=None): tests = doctest.DocTestFinder.find(self, obj, name, module, globs, @@ -176,16 +347,8 @@ if not fnmatch.fnmatch(test.name, '.'.join((name, pat))): continue - for mod in mods: - if mod in self._import_cache: - return self._import_cache[mod] - try: - imp.find_module(mod) - except ImportError: - self._import_cache[mod] = False - return False - else: - self._import_cache[mod] = True + if not self.check_required_modules(mods): + return False return True tests = list(filter(test_filter, tests)) @@ -289,7 +452,7 @@ def pytest_report_header(config): from .. import __version__ - stdoutencoding = sys.stdout.encoding or 'ascii' + stdoutencoding = getattr(sys.stdout, 'encoding') or 'ascii' s = "\nRunning tests with Astropy version {0}.\n".format(__version__) s += "Running tests in {0}.\n\n".format(" ".join(config.args)) --- a/astropy/io/votable/tests/vo_test.py +++ b/astropy/io/votable/tests/vo_test.py @@ -127,7 +127,7 @@ new_dtypes = [] for dtype in dtypes: dtype = list(dtype) - dtype[1] = dtype[1].replace(b'<', b'>') + dtype[1] = dtype[1].replace(str('<'), str('>')) new_dtypes.append(tuple(dtype)) dtypes = new_dtypes assert table.array.dtype == dtypes --- a/astropy/modeling/tests/test_fitters.py +++ b/astropy/modeling/tests/test_fitters.py @@ -69,6 +69,7 @@ self.cheb2 = models.Chebyshev2D(2, 2) self.fitter = fitting.LinearLSQFitter() + @pytest.mark.xfail def test_default_params(self): self.cheb2.parameters = np.arange(9) p = np.array([1344., 1772., 400., 1860., 2448., 552., 432., 568., @@ -77,6 +78,7 @@ model = self.fitter(self.cheb2, self.x, self.y, z) utils.assert_almost_equal(model.parameters, p) + @pytest.mark.xfail def test_poly2D_cheb2D(self): model = self.fitter(self.cheb2, self.x, self.y, self.z) z1 = model(self.x, self.y) --- a/astropy/modeling/tests/test_input.py +++ b/astropy/modeling/tests/test_input.py @@ -53,6 +53,7 @@ m(self.x2) @pytest.mark.parametrize(('model', 'params'), model2d_params) + @pytest.mark.xfail def test_input2D(self, model, params): m = model(*params) m(self.x, self.y) debian/patches/python3.4.patch0000664000000000000000000004221012270440322013401 0ustar From: Thomas Robitaille Date: Mon, 6 Jan 2014 12:14:00 +0100 Subject: Fixes for Python 3.4. This merges the patches from the pull request #1945: b3942c4, f653064, 16ae7a6, 1d51d8e, 07806be, de32f06. Origin: https://github.com/astropy/astropy/pull/1945 Bug-Debian: http://bugs.debian.org/734293 --- a/astropy/logger.py +++ b/astropy/logger.py @@ -551,9 +551,13 @@ if isinstance(level, int): rv = level elif str(level) == level: - if level not in logging._levelNames: + if sys.version_info[:2] >= (3, 4): + names = logging._nameToLevel + else: + names = logging._levelNames + if level not in names: raise ValueError("Unknown level: %r" % level) - rv = logging._levelNames[level] + rv = names[level] else: raise TypeError("Level not an integer or a valid string: %r" % level) return rv --- a/astropy/nddata/flag_collection.py +++ b/astropy/nddata/flag_collection.py @@ -40,6 +40,6 @@ if value.shape == self.shape: OrderedDict.__setitem__(self, item, value, **kwargs) else: - raise ValueError("flags array shape {0:s} does not match data shape {1:s}".format(value.shape, self.shape)) + raise ValueError("flags array shape {0} does not match data shape {1}".format(value.shape, self.shape)) else: raise TypeError("flags should be given as a Numpy array") --- a/astropy/table/np_utils.py +++ b/astropy/table/np_utils.py @@ -81,7 +81,7 @@ col_name_count = _counter(col_name_list) repeated_names = [name for name, count in col_name_count.items() if count > 1] if repeated_names: - raise TableMergeError('Merging column names resulted in duplicates: {0:s}. ' + raise TableMergeError('Merging column names resulted in duplicates: {0}. ' 'Change uniq_col_name or table_names args to fix this.' .format(repeated_names)) --- a/CHANGES.rst +++ b/CHANGES.rst @@ -658,6 +658,8 @@ ``CUNIT`` field that was changed. (This requires that astropy was built with the locally distributed version of wcslib). [#1854] + - Fixed compatibility with Python 3.4. [#1945] + Other Changes and Additions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- a/astropy/cosmology/tests/test_cosmology.py +++ b/astropy/cosmology/tests/test_cosmology.py @@ -95,40 +95,40 @@ """ Test string representation of built in classes""" cosmo = core.LambdaCDM(70, 0.3, 0.5) expected = 'LambdaCDM(H0=70 km / (Mpc s), Om0=0.3, Ode0=0.5, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.LambdaCDM(70, 0.3, 0.5, m_nu=u.Quantity(0.01, u.eV)) expected = 'LambdaCDM(H0=70 km / (Mpc s), Om0=0.3, Ode0=0.5, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0.01 0.01 0.01] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.FlatLambdaCDM(50.0, 0.27) expected = 'FlatLambdaCDM(H0=50 km / (Mpc s), Om0=0.27, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.wCDM(60.0, 0.27, 0.6, w0=-0.8, name='test1') expected = 'wCDM(name="test1", H0=60 km / (Mpc s), Om0=0.27, Ode0=0.6, w0=-0.8, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.FlatwCDM(65.0, 0.27, w0=-0.6, name='test2') expected = 'FlatwCDM(name="test2", H0=65 km / (Mpc s), Om0=0.27, w0=-0.6, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.w0waCDM(60.0, 0.25, 0.4, w0=-0.6, wa=0.1, name='test3') expected = 'w0waCDM(name="test3", H0=60 km / (Mpc s), Om0=0.25, Ode0=0.4, w0=-0.6, wa=0.1, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.Flatw0waCDM(55.0, 0.35, w0=-0.9, wa=-0.2, name='test4') expected = 'Flatw0waCDM(name="test4", H0=55 km / (Mpc s), Om0=0.35, w0=-0.9, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.wpwaCDM(50.0, 0.3, 0.3, wp=-0.9, wa=-0.2, zp=0.3, name='test5') expected = 'wpwaCDM(name="test5", H0=50 km / (Mpc s), Om0=0.3, Ode0=0.3, wp=-0.9, wa=-0.2, zp=0.3, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected cosmo = core.w0wzCDM(55.0, 0.4, 0.8, w0=-1.05, wz=-0.2, m_nu=u.Quantity([0.001, 0.01, 0.015], u.eV)) expected = 'w0wzCDM(H0=55 km / (Mpc s), Om0=0.4, Ode0=0.8, w0=-1.05, wz=-0.2 Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0.001 0.01 0.015] eV)' - assert "{0:s}".format(cosmo) == expected + assert str(cosmo) == expected @pytest.mark.skipif('not HAS_SCIPY') def test_flat_z1(): --- a/astropy/cosmology/core.py +++ b/astropy/cosmology/core.py @@ -244,14 +244,14 @@ def _namelead(self): """ Helper function for constructing __repr__""" if self.name is None: - return "{0:s}(".format(self.__class__.__name__) + return "{0}(".format(self.__class__.__name__) else: - return "{0:s}(name=\"{1:s}\", ".format(self.__class__.__name__, + return "{0}(name=\"{1}\", ".format(self.__class__.__name__, self.name) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, "\ - "Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6:s})" + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, "\ + "Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0, self._Tcmb0, self._Neff, self.m_nu) @@ -1465,8 +1465,8 @@ return 1.0 / np.sqrt(zp1 ** 3 * (Or * zp1 + Om0) + Ode0) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Tcmb0={3:.4g}, "\ - "Neff={4:.3g}, m_nu={5:s})" + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Tcmb0={3:.4g}, "\ + "Neff={4:.3g}, m_nu={5})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Tcmb0, self._Neff, self.m_nu) @@ -1643,8 +1643,8 @@ Ode0 * zp1 ** (3 * (1 + w0))) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, w0={4:.3g}, "\ - "Tcmb0={5:.4g}, Neff={6:.3g}, m_nu={7:s})" + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, w0={4:.3g}, "\ + "Tcmb0={5:.4g}, Neff={6:.3g}, m_nu={7})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0, self._w0, self._Tcmb0, self._Neff, self.m_nu) @@ -1769,8 +1769,8 @@ Ode0 * zp1 ** (3 * (1 + w0))) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, w0={3:.3g}, Tcmb0={4:.4g}, "\ - "Neff={5:.3g}, m_nu={6:s})" + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, w0={3:.3g}, Tcmb0={4:.4g}, "\ + "Neff={5:.3g}, m_nu={6})" return retstr.format(self._namelead(), self._H0, self._Om0, self._w0, self._Tcmb0, self._Neff, self.m_nu) @@ -1906,9 +1906,9 @@ np.exp(-3 * self._wa * z / zp1) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, "\ + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, "\ "Ode0={3:.3g}, w0={4:.3g}, wa={5:.3g}, Tcmb0={6:.4g}, "\ - "Neff={7:.3g}, m_nu={8:s})" + "Neff={7:.3g}, m_nu={8})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0, self._w0, self._wa, self._Tcmb0, self._Neff, self.m_nu) @@ -1978,8 +1978,8 @@ self._wa = float(wa) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, "\ - "w0={3:.3g}, Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6:s})" + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, "\ + "w0={3:.3g}, Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6})" return retstr.format(self._namelead(), self._H0, self._Om0, self._w0, self._Tcmb0, self._Neff, self.m_nu) @@ -2134,9 +2134,9 @@ np.exp(-3 * self._wa * z / zp1) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, wp={4:.3g}, "\ + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, wp={4:.3g}, "\ "wa={5:.3g}, zp={6:.3g}, Tcmb0={7:.4g}, Neff={8:.3g}, "\ - "m_nu={9:s})" + "m_nu={9})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0, self._wp, self._wa, self._zp, self._Tcmb0, self._Neff, self.m_nu) @@ -2279,9 +2279,9 @@ np.exp(-3 * self._wz * z) def __repr__(self): - retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, "\ + retstr = "{0}H0={1:.3g}, Om0={2:.3g}, "\ "Ode0={3:.3g}, w0={4:.3g}, wz={5:.3g} Tcmb0={6:.4g}, "\ - "Neff={7:.3g}, m_nu={8:s})" + "Neff={7:.3g}, m_nu={8})" return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0, self._w0, self._wz, self._Tcmb0, self._Neff, self.m_nu) --- a/astropy/vo/validator/tests/data/printcat.out +++ b/astropy/vo/validator/tests/data/printcat.out @@ -1,43 +1,43 @@ { - "capabilityClass": "ConeSearch", - "capabilityStandardID": "ivo://ivoa.net/std/ConeSearch", - "capabilityValidationLevel": "", - "contentLevel": "#Research#", - "description": "USNO-A2.0 is a catalog of 526,280,881 stars, and is based on a re-reduction of the Precision Measuring Machine (PMM) scans that were the basis for the USNO-A1.0 catalog. The major difference between A2.0 and A1.0 is that A1.0 used the Guide Star Catalog (Lasker et al. 1986, see Cat. <I/220>) as its reference frame whereas A2.0 uses the ICRF as realized by the USNO ACT catalog (Urban et al. 1997, see Cat. II/246>). A2.0 presents right ascension and declination (J2000, epoch of the mean of the blue and red plate) and the blue and red magnitude for each star. Usage of the ACT catalog as well as usage of new astrometric and photometric reduction algorithms should provide improved astrometry (mostly in the reduction of systematic errors) and improved photometry (because the brightest stars on each plate had B and V magnitudes measured by the Tycho experiment on the Hipparcos satellite). The basic format of the catalog and its compilation is the same as for A1.0, and most users should be able to migrate to this newer version with minimal effort.\n\nThis particular record describes access specifically to the \"out\" table within this catalog through the VO-standard ConeSearch service interface. It can be used automatically by compliant tools and applications. Consult the referenceURL for more information about this table.", - "duplicatesIgnored": 0, - "identifier": "ivo://CDS.VizieR/I/252#out", - "interfaceClass": "ParamHTTP", - "interfaceRole": "std?", - "interfaceVersion": "", - "maxRadius": 180.0, - "maxRecords": 9999, - "publisher": "CDS", - "publisherID": "ivo://CDS", - "referenceURL": "http://cdsarc.u-strasbg.fr/cgi-bin/Cat?I/252", - "regionOfRegard": NaN, - "resourceID": "ivo://CDS.VizieR/I/252", - "shortName": "I/252", - "subject": "#Positional_Data#", - "tags": "Catalog", - "title": "The USNO-A2.0 Catalogue (Monet+ 1998)", - "type": "#Catalog#", - "updated": "2011-09-14T20:20:21", - "url": "http://vizier.u-strasbg.fr/viz-bin/votable/-A?-source=I/252/out&", - "validate_expected": "good", - "validate_network_error": null, - "validate_nexceptions": 0, - "validate_nwarnings": 1, - "validate_out_db_name": "good", - "validate_version": "1.1", + "capabilityClass": "ConeSearch", + "capabilityStandardID": "ivo://ivoa.net/std/ConeSearch", + "capabilityValidationLevel": "", + "contentLevel": "#Research#", + "description": "USNO-A2.0 is a catalog of 526,280,881 stars, and is based on a re-reduction of the Precision Measuring Machine (PMM) scans that were the basis for the USNO-A1.0 catalog. The major difference between A2.0 and A1.0 is that A1.0 used the Guide Star Catalog (Lasker et al. 1986, see Cat. <I/220>) as its reference frame whereas A2.0 uses the ICRF as realized by the USNO ACT catalog (Urban et al. 1997, see Cat. II/246>). A2.0 presents right ascension and declination (J2000, epoch of the mean of the blue and red plate) and the blue and red magnitude for each star. Usage of the ACT catalog as well as usage of new astrometric and photometric reduction algorithms should provide improved astrometry (mostly in the reduction of systematic errors) and improved photometry (because the brightest stars on each plate had B and V magnitudes measured by the Tycho experiment on the Hipparcos satellite). The basic format of the catalog and its compilation is the same as for A1.0, and most users should be able to migrate to this newer version with minimal effort.\n\nThis particular record describes access specifically to the \"out\" table within this catalog through the VO-standard ConeSearch service interface. It can be used automatically by compliant tools and applications. Consult the referenceURL for more information about this table.", + "duplicatesIgnored": 0, + "identifier": "ivo://CDS.VizieR/I/252#out", + "interfaceClass": "ParamHTTP", + "interfaceRole": "std?", + "interfaceVersion": "", + "maxRadius": 180.0, + "maxRecords": 9999, + "publisher": "CDS", + "publisherID": "ivo://CDS", + "referenceURL": "http://cdsarc.u-strasbg.fr/cgi-bin/Cat?I/252", + "regionOfRegard": NaN, + "resourceID": "ivo://CDS.VizieR/I/252", + "shortName": "I/252", + "subject": "#Positional_Data#", + "tags": "Catalog", + "title": "The USNO-A2.0 Catalogue (Monet+ 1998)", + "type": "#Catalog#", + "updated": "2011-09-14T20:20:21", + "url": "http://vizier.u-strasbg.fr/viz-bin/votable/-A?-source=I/252/out&", + "validate_expected": "good", + "validate_network_error": null, + "validate_nexceptions": 0, + "validate_nwarnings": 1, + "validate_out_db_name": "good", + "validate_version": "1.1", "validate_warning_types": [ "W22" - ], + ], "validate_warnings": [ "./results/f7/bb/d44fbd316338550aed4e1c1a8fc6/vo.xml:13:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring" - ], - "validate_xmllint": true, - "validate_xmllint_content": "./results/f7/bb/d44fbd316338550aed4e1c1a8fc6/vo.xml validates\n", - "version": "27-Oct-1998", + ], + "validate_xmllint": true, + "validate_xmllint_content": "./results/f7/bb/d44fbd316338550aed4e1c1a8fc6/vo.xml validates\n", + "version": "27-Oct-1998", "waveband": "#Optical#" } --- a/astropy/vo/validator/tests/test_validate.py +++ b/astropy/vo/validator/tests/test_validate.py @@ -121,8 +121,16 @@ func(fout=fout, *args, **kwargs) with open(dat_file) as f1: - with open(out_file) as f2: - assert f1.read() == f2.read() + contents_1 = f1.readlines() + with open(out_file) as f2: + contents_2 = f2.readlines() + + assert len(contents_1) == len(contents_2) + + # json.dumps() might or might not add trailing whitespace + # http://bugs.python.org/issue16333 + for line1, line2 in zip(contents_1, contents_2): + assert line1.rstrip() == line2.rstrip() def test_tally(self): self.gen_cmp(self.r.tally, 'tally.out') --- a/cextern/cfitsio/swapproc.c +++ b/cextern/cfitsio/swapproc.c @@ -75,14 +75,14 @@ swap the bytes in the input short integers: ( 0 1 -> 1 0 ) */ { + long ii; + size_t peel = get_peel((void*)&svalues[0], sizeof(svalues[0]), nvals, 16); + if ((long)svalues % 2 != 0) { /* should not happen */ ffswap2_slow(svalues, nvals); return; } - long ii; - size_t peel = get_peel((void*)&svalues[0], sizeof(svalues[0]), nvals, 16); - ffswap2_slow(svalues, peel); for (ii = peel; ii < (nvals - peel - (nvals - peel) % 8); ii+=8) { swap2_sse2((char*)&svalues[ii]); --- a/astropy/io/fits/util.py +++ b/astropy/io/fits/util.py @@ -24,22 +24,6 @@ Generator over all subclasses of a given class, in depth first order. - >>> class A(object): pass - >>> class B(A): pass - >>> class C(A): pass - >>> class D(B,C): pass - >>> class E(D): pass - >>> - >>> for cls in itersubclasses(A): - ... print(cls.__name__) - B - D - E - C - >>> # get ALL (new-style) classes currently defined - >>> [cls.__name__ for cls in itersubclasses(object)] - ['type', ...'tuple', ...] - From http://code.activestate.com/recipes/576949/ """ debian/patches/series0000664000000000000000000000012312270436044012032 0ustar mark_known_failures.patch parallel_fk4_no_fk4.pytch CUNITfix.patch python3.4.patch debian/compat0000664000000000000000000000000212270435753010376 0ustar 9