Skip to content

Instantly share code, notes, and snippets.

@bsipocz
Created February 12, 2015 23:13
Show Gist options
  • Select an option

  • Save bsipocz/7880e511664a5c30abd1 to your computer and use it in GitHub Desktop.

Select an option

Save bsipocz/7880e511664a5c30abd1 to your computer and use it in GitHub Desktop.
v1.0.rc2 with remote_data option
>>> astropy.test(remote_data=True)
================================================================================== test session starts ===================================================================================
platform linux2 -- Python 2.7.8 -- pytest-2.5.1
Running tests with Astropy version 1.0rc2.
Running tests in /data/apm36_a/wts/pipeline64/bsipocz/lib/python2.7/site-packages/astropy.
Platform: Linux-2.6.18-400.1.1.el5-x86_64-with-redhat-5.11-Tikanga
Executable: /data/apm36_a/wts/pipeline64/bsipocz/bin/python
Full Python Version:
2.7.8 (default, Nov 18 2014, 11:18:05)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)]
encodings: sys: ascii, locale: UTF-8, filesystem: UTF-8, unicode bits: 15
byteorder: little
float info: dig: 15, mant_dig: 15
Numpy: 1.9.1
Scipy: 0.14.0
Matplotlib: 1.4.2
h5py: not available
Using Astropy options: remote_data.
collected 8276 items / 2 errors / 7 skipped
astropy/_erfa/tests/test_erfa.py .....
astropy/analytic_functions/tests/test_blackbody.py ....
astropy/config/tests/test_configs.py ...............
astropy/constants/tests/test_constant.py ..............
astropy/constants/tests/test_pickle.py xxxxxxxxx
astropy/convolution/tests/test_convolve.py ...............................................................................................................
astropy/convolution/tests/test_convolve_fft.py ...................................................................................................................................................................................................................................................................................................................................................
astropy/convolution/tests/test_convolve_kernels.py ..............................................................
astropy/convolution/tests/test_discretize.py ...s...........s...............
astropy/convolution/tests/test_kernel_class.py ............................................................................................................................................................................
astropy/convolution/tests/test_pickle.py .xx.xx.xx
astropy/coordinates/tests/test_angles.py ............................................................................
astropy/coordinates/tests/test_angular_separation.py ....
astropy/coordinates/tests/test_api_ape5.py .....
astropy/coordinates/tests/test_arrays.py ..........................
astropy/coordinates/tests/test_distance.py .F.......
astropy/coordinates/tests/test_earth.py ........................
astropy/coordinates/tests/test_formatting.py ....................
astropy/coordinates/tests/test_frames.py .......................
astropy/coordinates/tests/test_funcs.py ..
astropy/coordinates/tests/test_iau_fullstack.py ....................................................
astropy/coordinates/tests/test_matching.py ......
astropy/coordinates/tests/test_name_resolve.py ......
astropy/coordinates/tests/test_pickle.py ....xx.x...xx.x...xx.x.
astropy/coordinates/tests/test_representation.py .............................................................................
astropy/coordinates/tests/test_sky_coord.py .................................................................................................................................................................................................................................................................................sssss..x..............
astropy/coordinates/tests/test_transformations.py ......................
astropy/coordinates/tests/accuracy/test_altaz_icrs.py ...x
astropy/coordinates/tests/accuracy/test_fk4_no_e_fk4.py .
astropy/coordinates/tests/accuracy/test_fk4_no_e_fk5.py .
astropy/coordinates/tests/accuracy/test_galactic_fk4.py .
astropy/coordinates/tests/accuracy/test_icrs_fk5.py .
astropy/cosmology/tests/test_cosmology.py ...................................
astropy/cosmology/tests/test_pickle.py ...
astropy/io/ascii/tests/test_c_reader.py ...........................x................x.......x.x...............
astropy/io/ascii/tests/test_cds_header_from_readme.py ...
astropy/io/ascii/tests/test_compressed.py .....
astropy/io/ascii/tests/test_connect.py ........................
astropy/io/ascii/tests/test_ecsv.py sssssss
astropy/io/ascii/tests/test_fixedwidth.py ............................................................
astropy/io/ascii/tests/test_html.py ........s.......
astropy/io/ascii/tests/test_ipac_definitions.py ........................................
astropy/io/ascii/tests/test_read.py ..................................................................................................................................................................................................
astropy/io/ascii/tests/test_types.py ......
astropy/io/ascii/tests/test_write.py ..........................
astropy/io/fits/tests/test_checksum.py ....................
astropy/io/fits/tests/test_connect.py .........................
astropy/io/fits/tests/test_core.py ........................................................
astropy/io/fits/tests/test_diff.py ..................................
astropy/io/fits/tests/test_division.py .....
astropy/io/fits/tests/test_groups.py .......
astropy/io/fits/tests/test_hdulist.py .........................................
astropy/io/fits/tests/test_header.py ..............................................................................................................................................
astropy/io/fits/tests/test_image.py ....................................................
astropy/io/fits/tests/test_nonstandard.py ...
astropy/io/fits/tests/test_structured.py .
astropy/io/fits/tests/test_table.py ................................................................
astropy/io/fits/tests/test_uint.py ........
astropy/io/fits/tests/test_util.py .
astropy/io/misc/tests/test_hdf5.py sssssssssssssssssssssssssssssssssssssss
astropy/io/misc/tests/test_pickle_helpers.py ....
astropy/io/tests/test_registry.py ............................................................
astropy/io/votable/tests/converter_test.py ............................................
astropy/io/votable/tests/exception_test.py ..
astropy/io/votable/tests/table_test.py ..............
astropy/io/votable/tests/tree_test.py ...
astropy/io/votable/tests/ucd_test.py ..........
astropy/io/votable/tests/util_test.py ......................
astropy/io/votable/tests/vo_test.py ................................................................................................................................................................................................................................................................................................................................
astropy/modeling/tests/test_compound.py ..........................................
astropy/modeling/tests/test_constraints.py .....................
astropy/modeling/tests/test_core.py ........
astropy/modeling/tests/test_fitters.py ...................
astropy/modeling/tests/test_functional_models.py .........
astropy/modeling/tests/test_input.py ......................................................
astropy/modeling/tests/test_mappings.py ......
astropy/modeling/tests/test_models.py ...............
astropy/modeling/tests/test_parameters.py .....................................................
astropy/modeling/tests/test_polynomial.py .................
astropy/modeling/tests/test_projections.py ...................
astropy/modeling/tests/test_rotations.py .....
astropy/modeling/tests/test_utils.py ..
astropy/nddata/tests/test_decorators.py ..........
astropy/nddata/tests/test_flag_collection.py ....................
astropy/nddata/tests/test_nddata.py ....................................................................
astropy/nddata/tests/test_nddata_base.py .
astropy/nddata/tests/test_utils.py .........
astropy/stats/tests/test_funcs.py .............
astropy/stats/tests/test_sigma_clipping.py ...
astropy/table/tests/test_column.py ....................................................................................................................................................................
astropy/table/tests/test_groups.py ........................................
astropy/table/tests/test_init_table.py ......................................................................................................................................................................................................................................................................................................
astropy/table/tests/test_item_access.py ............................................................
astropy/table/tests/test_jsviewer.py .
astropy/table/tests/test_masked.py ..................................................................
astropy/table/tests/test_mixin.py ................................................x.
astropy/table/tests/test_np_utils.py .
astropy/table/tests/test_operations.py ..........................................................................
astropy/table/tests/test_pickle.py ............
astropy/table/tests/test_pprint.py ........................................................................................................
astropy/table/tests/test_row.py ....................................................................
astropy/table/tests/test_subclass.py ....
astropy/table/tests/test_table.py ..........................................................................................................................................................................................................................................................................................x..................................................................................................................................................................................................................................................................................................................x........................
astropy/tests/test_logger.py ............................
astropy/tests/tests/test_imports.py ..
astropy/tests/tests/test_open_file_detection.py .
astropy/tests/tests/test_quantity_helpers.py .
astropy/tests/tests/test_run_tests.py ........
astropy/tests/tests/test_skip_remote_data.py .
astropy/tests/tests/test_socketblocker.py ...
astropy/time/tests/test_basic.py ..............................................................................
astropy/time/tests/test_comparisons.py ...
astropy/time/tests/test_delta.py ................................................................................
astropy/time/tests/test_guess.py ....
astropy/time/tests/test_pickle.py .
astropy/time/tests/test_precision.py .......x..
astropy/time/tests/test_quantity_interaction.py ............
astropy/time/tests/test_sidereal.py ...................
astropy/time/tests/test_ut1.py ...s
astropy/units/tests/test_equivalencies.py ..................................................
astropy/units/tests/test_format.py ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
astropy/units/tests/test_physical.py ......................
astropy/units/tests/test_quantity.py ....................................................................
astropy/units/tests/test_quantity_array_methods.py .............................x............x.x.............
astropy/units/tests/test_quantity_decorator.py sssssssssssss...............
astropy/units/tests/test_quantity_non_ufuncs.py xx
astropy/units/tests/test_quantity_ufuncs.py ........................................ss.................................................................................................................
astropy/units/tests/test_units.py ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
astropy/utils/compat/numpy/tests/test_broadcast_arrays.py ...
astropy/utils/iers/tests/test_iers.py .s
astropy/utils/tests/test_codegen.py .
astropy/utils/tests/test_collections.py .....
astropy/utils/tests/test_compat.py .
astropy/utils/tests/test_console.py ..................................................
astropy/utils/tests/test_data.py ........................................
astropy/utils/tests/test_decorators.py .......
astropy/utils/tests/test_gzip.py ss
astropy/utils/tests/test_introspection.py ....
astropy/utils/tests/test_metadata.py ...............
astropy/utils/tests/test_misc.py .....
astropy/utils/tests/test_odict.py sssssssssssssssssssssssssssssssssssssssssss
astropy/utils/tests/test_state.py F.
astropy/utils/tests/test_timer.py .
astropy/utils/tests/test_xml.py ........
astropy/visualization/scripts/tests/test_fits2bitmap.py ..
astropy/visualization/tests/test_interval.py .................
astropy/visualization/tests/test_norm.py s.....
astropy/visualization/tests/test_stretch.py ...................................................................................................
astropy/visualization/tests/test_ui.py ......
astropy/vo/client/tests/test_conesearch.py .................x.
astropy/vo/client/tests/test_vos_catalog.py ...............
astropy/vo/samp/tests/test_client.py ....
astropy/vo/samp/tests/test_errors.py ...
astropy/vo/samp/tests/test_hub.py ..
astropy/vo/samp/tests/test_hub_proxy.py .....
astropy/vo/samp/tests/test_hub_script.py .
astropy/vo/samp/tests/test_standard_profile.py Xxx
astropy/vo/samp/tests/test_web_profile.py X.
astropy/vo/validator/tests/test_inpect.py ....
astropy/vo/validator/tests/test_validate.py ...
astropy/wcs/tests/test_pickle.py ......
astropy/wcs/tests/test_profiling.py ..................................
astropy/wcs/tests/test_utils.py .........................................
astropy/wcs/tests/test_wcs.py ......................................................................................................................................
astropy/wcs/tests/test_wcsprm.py ...........................................................................................x.....XX
astropy/wcs/tests/extension/test_extension.py .
========================================================================================= ERRORS =========================================================================================
_________________________________________________________________ ERROR collecting astropy/modeling/tests/test_models.py _________________________________________________________________
_pytest.runner:137: in __init__
> ???
_pytest.main:418: in _memocollect
> ???
_pytest.main:295: in _memoizedcall
> ???
_pytest.main:418: in <lambda>
> ???
_pytest.python:527: in collect
> ???
_pytest.python:321: in collect
> ???
_pytest.python:333: in makeitem
> ???
_pytest.main:161: in call_matching_hooks
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:227: in pytest_pycollect_makeitem
> ???
_pytest.python:349: in _genfunctions
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:145: in pytest_generate_tests
> ???
_pytest.python:817: in parametrize
> ???
_pytest.python:698: in setmulti
> ???
_pytest.python:681: in _checkargnotcontained
> ???
E ValueError: duplicate u'model_class'
_________________________________________________________________ ERROR collecting astropy/modeling/tests/test_models.py _________________________________________________________________
_pytest.runner:137: in __init__
> ???
_pytest.main:418: in _memocollect
> ???
_pytest.main:295: in _memoizedcall
> ???
_pytest.main:418: in <lambda>
> ???
_pytest.python:527: in collect
> ???
_pytest.python:321: in collect
> ???
_pytest.python:333: in makeitem
> ???
_pytest.main:161: in call_matching_hooks
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:227: in pytest_pycollect_makeitem
> ???
_pytest.python:349: in _genfunctions
> ???
_pytest.core:380: in pcall
> ???
_pytest.core:387: in _docall
> ???
_pytest.core:288: in execute
> ???
_pytest.python:145: in pytest_generate_tests
> ???
_pytest.python:817: in parametrize
> ???
_pytest.python:698: in setmulti
> ???
_pytest.python:681: in _checkargnotcontained
> ???
E ValueError: duplicate u'model_class'
======================================================================================== FAILURES ========================================================================================
__________________________________________________________________________________ test_distances_scipy __________________________________________________________________________________
@pytest.mark.skipif(str('not HAS_SCIPY'))
def test_distances_scipy():
"""
The distance-related tests that require scipy due to the cosmology
module needing scipy integration routines
"""
from ...cosmology import WMAP5
#try different ways to initialize a Distance
d4 = Distance(z=0.23) # uses default cosmology - as of writing, WMAP7
> npt.assert_allclose(d4.z, 0.23, rtol=1e-8)
astropy/coordinates/tests/test_distance.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = array(0.23000000254781977), desired = array(0.23), rtol = 1e-08, atol = 0, err_msg = '', verbose = True
def assert_allclose(actual, desired, rtol=1e-7, atol=0,
err_msg='', verbose=True):
"""
Raises an AssertionError if two objects are not equal up to desired
tolerance.
The test is equivalent to ``allclose(actual, desired, rtol, atol)``.
It compares the difference between `actual` and `desired` to
``atol + rtol * abs(desired)``.
.. versionadded:: 1.5.0
Parameters
----------
actual : array_like
Array obtained.
desired : array_like
Array desired.
rtol : float, optional
Relative tolerance.
atol : float, optional
Absolute tolerance.
err_msg : str, optional
The error message to be printed in case of failure.
verbose : bool, optional
If True, the conflicting values are appended to the error message.
Raises
------
AssertionError
If actual and desired are not equal up to specified precision.
See Also
--------
assert_array_almost_equal_nulp, assert_array_max_ulp
Examples
--------
>>> x = [1e-5, 1e-3, 1e-1]
>>> y = np.arccos(np.cos(x))
>>> assert_allclose(x, y, rtol=1e-5, atol=0)
"""
import numpy as np
def compare(x, y):
return np.allclose(x, y, rtol=rtol, atol=atol)
actual, desired = np.asanyarray(actual), np.asanyarray(desired)
header = 'Not equal to tolerance rtol=%g, atol=%g' % (rtol, atol)
assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
> verbose=verbose, header=header)
numpy/testing/utils.py:1297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
comparison = <function compare at 0x2b78ecbf58c0>, x = array(0.23000000254781977), y = array(0.23), err_msg = '', verbose = True, header = 'Not equal to tolerance rtol=1e-08, atol=0'
precision = 6
def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
header='', precision=6):
from numpy.core import array, isnan, isinf, any, all, inf
x = array(x, copy=False, subok=True)
y = array(y, copy=False, subok=True)
def isnumber(x):
return x.dtype.char in '?bhilqpBHILQPefdgFDG'
def chk_same_position(x_id, y_id, hasval='nan'):
"""Handling nan/inf: check that x and y have the nan/inf at the same
locations."""
try:
assert_array_equal(x_id, y_id)
except AssertionError:
msg = build_err_msg([x, y],
err_msg + '\nx and y %s location mismatch:' \
% (hasval), verbose=verbose, header=header,
names=('x', 'y'), precision=precision)
raise AssertionError(msg)
try:
cond = (x.shape==() or y.shape==()) or x.shape == y.shape
if not cond:
msg = build_err_msg([x, y],
err_msg
+ '\n(shapes %s, %s mismatch)' % (x.shape,
y.shape),
verbose=verbose, header=header,
names=('x', 'y'), precision=precision)
if not cond :
raise AssertionError(msg)
if isnumber(x) and isnumber(y):
x_isnan, y_isnan = isnan(x), isnan(y)
x_isinf, y_isinf = isinf(x), isinf(y)
# Validate that the special values are in the same place
if any(x_isnan) or any(y_isnan):
chk_same_position(x_isnan, y_isnan, hasval='nan')
if any(x_isinf) or any(y_isinf):
# Check +inf and -inf separately, since they are different
chk_same_position(x == +inf, y == +inf, hasval='+inf')
chk_same_position(x == -inf, y == -inf, hasval='-inf')
# Combine all the special values
x_id, y_id = x_isnan, y_isnan
x_id |= x_isinf
y_id |= y_isinf
# Only do the comparison if actual values are left
if all(x_id):
return
if any(x_id):
val = comparison(x[~x_id], y[~y_id])
else:
val = comparison(x, y)
else:
val = comparison(x, y)
if isinstance(val, bool):
cond = val
reduced = [0]
else:
reduced = val.ravel()
cond = reduced.all()
reduced = reduced.tolist()
if not cond:
match = 100-100.0*reduced.count(1)/len(reduced)
msg = build_err_msg([x, y],
err_msg
+ '\n(mismatch %s%%)' % (match,),
verbose=verbose, header=header,
names=('x', 'y'), precision=precision)
if not cond :
> raise AssertionError(msg)
E AssertionError:
E Not equal to tolerance rtol=1e-08, atol=0
E
E (mismatch 100.0%)
E x: array(0.23000000254781977)
E y: array(0.23)
numpy/testing/utils.py:665: AssertionError
_______________________________________________________________________________________ test_alias _______________________________________________________________________________________
def test_alias():
from ...cosmology import core, WMAP9, WMAP7
# REMOVE in astropy 0.5
with catch_warnings() as w:
x = core.DEFAULT_COSMOLOGY()
> assert x == WMAP9
E assert FlatLambdaCDM(name="WMAP7", H0=70.4 km / (Mpc s), Om0=0.272, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV, Ob0=0.0455) == FlatLambdaCDM(name="WMAP9", H0=69.3 km / (Mpc s), Om0=0.286, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV, Ob0=0.0463)
astropy/utils/tests/test_state.py:16: AssertionError
================================================== 2 failed, 8110 passed, 124 skipped, 43 xfailed, 4 xpassed, 2 error in 479.44 seconds ==================================================
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment