Skip to content

Instantly share code, notes, and snippets.

@bsipocz
Last active November 24, 2015 23:07
Show Gist options
  • Save bsipocz/0b1469523378eb9fe6d7 to your computer and use it in GitHub Desktop.
Save bsipocz/0b1469523378eb9fe6d7 to your computer and use it in GitHub Desktop.
1.1rc1 python2.7 numpy 1.9.2 Ubuntu remote_data
>>> astropy.test(remote_data=True)
======================================================================================================= test session starts =======================================================================================================
platform linux2 -- Python 2.7.6 -- py-1.4.30 -- pytest-2.7.3
rootdir: /home/gkovacs/.local/lib/python2.7/site-packages/astropy, inifile:
Running tests with Astropy version 1.1rc1.
Running tests in /home/gkovacs/.local/lib/python2.7/site-packages/astropy.
Date: 2015-11-24T21:57:12
Platform: Linux-3.16.0-53-generic-x86_64-with-Ubuntu-14.04-trusty
Executable: /usr/bin/python
Full Python Version:
2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2]
encodings: sys: ascii, locale: UTF-8, filesystem: UTF-8, unicode bits: 20
byteorder: little
float info: dig: 15, mant_dig: 15
Numpy: 1.9.2
Scipy: 0.16.0
Matplotlib: not available
h5py: not available
Using Astropy options: remote_data.
collected 9859 items / 2 errors
.local/lib/python2.7/site-packages/astropy/_erfa/tests/test_erfa.py .....
.local/lib/python2.7/site-packages/astropy/analytic_functions/tests/test_blackbody.py .....
.local/lib/python2.7/site-packages/astropy/config/tests/test_configs.py .................
.local/lib/python2.7/site-packages/astropy/constants/tests/test_constant.py ................
.local/lib/python2.7/site-packages/astropy/constants/tests/test_pickle.py xxxxxxxxx
.local/lib/python2.7/site-packages/astropy/convolution/tests/test_convolve.py ...............................................................................................................
.local/lib/python2.7/site-packages/astropy/convolution/tests/test_convolve_fft.py ...................................................................................................................................................................................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/convolution/tests/test_convolve_kernels.py ..............................................................................
.local/lib/python2.7/site-packages/astropy/convolution/tests/test_discretize.py ...s...........s...............
.local/lib/python2.7/site-packages/astropy/convolution/tests/test_kernel_class.py ........................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/convolution/tests/test_pickle.py .xx.xx.xx
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_angles.py ................................................................................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_angular_separation.py ....
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_api_ape5.py .....
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_arrays.py ..........................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_celestial_transformations.py ..........
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_distance.py .F.......
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_earth.py ..........................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_formatting.py ....................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_frames.py ......................F.
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_funcs.py ...
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_iau_fullstack.py ....................................................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_intermediate_transformations.py ...................................................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_matching.py ......
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_name_resolve.py F..F..
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_pickle.py ....xx.x...xx.x...xx.x.
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_regression.py .......
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_representation.py .............................................................................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_sites.py .......
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_sky_coord.py ........................................................................................................................................................................................................................................................................................................................................................................................x.................
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_transformations.py ......
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_unit_representation.py .
.local/lib/python2.7/site-packages/astropy/coordinates/tests/accuracy/test_altaz_icrs.py ...x
.local/lib/python2.7/site-packages/astropy/coordinates/tests/accuracy/test_ecliptic.py ...
.local/lib/python2.7/site-packages/astropy/coordinates/tests/accuracy/test_fk4_no_e_fk4.py .
.local/lib/python2.7/site-packages/astropy/coordinates/tests/accuracy/test_fk4_no_e_fk5.py .
.local/lib/python2.7/site-packages/astropy/coordinates/tests/accuracy/test_galactic_fk4.py .
.local/lib/python2.7/site-packages/astropy/coordinates/tests/accuracy/test_icrs_fk5.py .
.local/lib/python2.7/site-packages/astropy/cosmology/tests/test_cosmology.py .....................................
.local/lib/python2.7/site-packages/astropy/cosmology/tests/test_pickle.py ...
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_c_reader.py ...........................x..................x.......x.x.................
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_cds_header_from_readme.py ...
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_compressed.py .....xx
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_connect.py .............ss........
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_ecsv.py sssssss
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_fixedwidth.py ..............................................................
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_html.py s.ssssss.ssss..s
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_ipac_definitions.py ........................................
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_read.py ..................................................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_types.py ......
.local/lib/python2.7/site-packages/astropy/io/ascii/tests/test_write.py ..............................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_checksum.py .....................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_connect.py ..........................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_core.py .............................................................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_diff.py ...................................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_division.py .....
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_groups.py ........
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_hdulist.py .........................................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_header.py ................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_image.py ......................................................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_nonstandard.py ...
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_structured.py .
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_table.py .......................................................................
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_uint.py ........
.local/lib/python2.7/site-packages/astropy/io/fits/tests/test_util.py .
.local/lib/python2.7/site-packages/astropy/io/misc/tests/test_hdf5.py sssssssssssssssssssssssssssssssssssssssss
.local/lib/python2.7/site-packages/astropy/io/misc/tests/test_pickle_helpers.py ....
.local/lib/python2.7/site-packages/astropy/io/tests/test_registry.py ............................................................
.local/lib/python2.7/site-packages/astropy/io/votable/tests/converter_test.py ............................................
.local/lib/python2.7/site-packages/astropy/io/votable/tests/exception_test.py ..
.local/lib/python2.7/site-packages/astropy/io/votable/tests/table_test.py ................
.local/lib/python2.7/site-packages/astropy/io/votable/tests/tree_test.py ...
.local/lib/python2.7/site-packages/astropy/io/votable/tests/ucd_test.py ..........
.local/lib/python2.7/site-packages/astropy/io/votable/tests/util_test.py ......................
.local/lib/python2.7/site-packages/astropy/io/votable/tests/vo_test.py ..................................................................................................................................................................................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_compound.py ..........................................FF........s
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_constraints.py .....................
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_core.py .............
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_fitters.py ...................
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_functional_models.py ...........
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_input.py ......................................................
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_mappings.py ......
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_models.py .................
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_parameters.py ....................................................
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_polynomial.py ............................s.........
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_projections.py .......................................................................................
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_rotations.py .............
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_utils.py ...
.local/lib/python2.7/site-packages/astropy/nddata/mixins/tests/test_ndarithmetic.py ................................................................................................................
.local/lib/python2.7/site-packages/astropy/nddata/mixins/tests/test_ndio.py .
.local/lib/python2.7/site-packages/astropy/nddata/tests/test_compat.py ................
.local/lib/python2.7/site-packages/astropy/nddata/tests/test_decorators.py ..........
.local/lib/python2.7/site-packages/astropy/nddata/tests/test_flag_collection.py ....................
.local/lib/python2.7/site-packages/astropy/nddata/tests/test_nddata.py ....................................................................
.local/lib/python2.7/site-packages/astropy/nddata/tests/test_nddata_base.py .
.local/lib/python2.7/site-packages/astropy/nddata/tests/test_utils.py ..........................sssssssssssss..............
.local/lib/python2.7/site-packages/astropy/stats/tests/test_bayesian_blocks.py .......
.local/lib/python2.7/site-packages/astropy/stats/tests/test_funcs.py .................................
.local/lib/python2.7/site-packages/astropy/stats/tests/test_histogram.py .........
.local/lib/python2.7/site-packages/astropy/stats/tests/test_sigma_clipping.py .....
.local/lib/python2.7/site-packages/astropy/table/tests/test_array.py ...
.local/lib/python2.7/site-packages/astropy/table/tests/test_bst.py .......
.local/lib/python2.7/site-packages/astropy/table/tests/test_column.py ......................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_groups.py ............................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_index.py ................................................................................................................................................................................................................................................................................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_info.py ........................
.local/lib/python2.7/site-packages/astropy/table/tests/test_init_table.py ......................................................................................................................................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_item_access.py ............................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_jsviewer.py ...
.local/lib/python2.7/site-packages/astropy/table/tests/test_masked.py ....................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_mixin.py ..............................................................x....
.local/lib/python2.7/site-packages/astropy/table/tests/test_np_utils.py .
.local/lib/python2.7/site-packages/astropy/table/tests/test_operations.py ............................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_pickle.py ...............
.local/lib/python2.7/site-packages/astropy/table/tests/test_pprint.py ................................................................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_row.py ....................................................................
.local/lib/python2.7/site-packages/astropy/table/tests/test_subclass.py ....
.local/lib/python2.7/site-packages/astropy/table/tests/test_table.py ................................................................................................................................................................................................................................................................................................x...........................ssss.........................................................................................................................................................................................................................................................................................................x...........................ssss.........
.local/lib/python2.7/site-packages/astropy/tests/test_logger.py .............................
.local/lib/python2.7/site-packages/astropy/tests/tests/test_imports.py ..
.local/lib/python2.7/site-packages/astropy/tests/tests/test_open_file_detection.py .
.local/lib/python2.7/site-packages/astropy/tests/tests/test_quantity_helpers.py .
.local/lib/python2.7/site-packages/astropy/tests/tests/test_run_tests.py ........
.local/lib/python2.7/site-packages/astropy/tests/tests/test_skip_remote_data.py .
.local/lib/python2.7/site-packages/astropy/tests/tests/test_socketblocker.py ...s
.local/lib/python2.7/site-packages/astropy/time/tests/test_basic.py ......................................................s......................................................s
.local/lib/python2.7/site-packages/astropy/time/tests/test_comparisons.py ...
.local/lib/python2.7/site-packages/astropy/time/tests/test_delta.py .................................................................................
.local/lib/python2.7/site-packages/astropy/time/tests/test_guess.py ....
.local/lib/python2.7/site-packages/astropy/time/tests/test_methods.py ..............................................................................................
.local/lib/python2.7/site-packages/astropy/time/tests/test_pickle.py .
.local/lib/python2.7/site-packages/astropy/time/tests/test_precision.py .......x..
.local/lib/python2.7/site-packages/astropy/time/tests/test_quantity_interaction.py ...............
.local/lib/python2.7/site-packages/astropy/time/tests/test_sidereal.py ...................
.local/lib/python2.7/site-packages/astropy/time/tests/test_ut1.py ...s
.local/lib/python2.7/site-packages/astropy/units/tests/test_equivalencies.py .....................................................
.local/lib/python2.7/site-packages/astropy/units/tests/test_format.py ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/units/tests/test_logarithmic.py .......ss.s...s...................s.............................................................
.local/lib/python2.7/site-packages/astropy/units/tests/test_physical.py ......................
.local/lib/python2.7/site-packages/astropy/units/tests/test_quantity.py ......................................................................
.local/lib/python2.7/site-packages/astropy/units/tests/test_quantity_array_methods.py .............................x............x.x.............
.local/lib/python2.7/site-packages/astropy/units/tests/test_quantity_decorator.py sssssssssssss...............
.local/lib/python2.7/site-packages/astropy/units/tests/test_quantity_non_ufuncs.py xx
.local/lib/python2.7/site-packages/astropy/units/tests/test_quantity_ufuncs.py ......................................ss..................................................................................................................
.local/lib/python2.7/site-packages/astropy/units/tests/test_units.py ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/utils/compat/numpy/tests/test_broadcast_arrays.py ....
.local/lib/python2.7/site-packages/astropy/utils/iers/tests/test_iers.py ....s
.local/lib/python2.7/site-packages/astropy/utils/tests/test_codegen.py .
.local/lib/python2.7/site-packages/astropy/utils/tests/test_collections.py .....
.local/lib/python2.7/site-packages/astropy/utils/tests/test_compat.py .
.local/lib/python2.7/site-packages/astropy/utils/tests/test_console.py ..................................................
.local/lib/python2.7/site-packages/astropy/utils/tests/test_data.py ....................x.........................x.....
.local/lib/python2.7/site-packages/astropy/utils/tests/test_data_info.py ..........................
.local/lib/python2.7/site-packages/astropy/utils/tests/test_decorators.py ...........
.local/lib/python2.7/site-packages/astropy/utils/tests/test_gzip.py ss
.local/lib/python2.7/site-packages/astropy/utils/tests/test_introspection.py ....
.local/lib/python2.7/site-packages/astropy/utils/tests/test_metadata.py ...............
.local/lib/python2.7/site-packages/astropy/utils/tests/test_misc.py .....
.local/lib/python2.7/site-packages/astropy/utils/tests/test_odict.py sssssssssssssssssssssssssssssssssssssssssss
.local/lib/python2.7/site-packages/astropy/utils/tests/test_state.py F.
.local/lib/python2.7/site-packages/astropy/utils/tests/test_timer.py .
.local/lib/python2.7/site-packages/astropy/utils/tests/test_xml.py ........
.local/lib/python2.7/site-packages/astropy/visualization/scripts/tests/test_fits2bitmap.py ss
.local/lib/python2.7/site-packages/astropy/visualization/tests/test_histogram.py sss
.local/lib/python2.7/site-packages/astropy/visualization/tests/test_interval.py .................
.local/lib/python2.7/site-packages/astropy/visualization/tests/test_norm.py .ssssss
.local/lib/python2.7/site-packages/astropy/visualization/tests/test_stretch.py ...................................................................................................
.local/lib/python2.7/site-packages/astropy/visualization/tests/test_ui.py ......
.local/lib/python2.7/site-packages/astropy/visualization/tests/test_units.py ss
.local/lib/python2.7/site-packages/astropy/vo/client/tests/test_conesearch.py .................x.
.local/lib/python2.7/site-packages/astropy/vo/client/tests/test_vos_catalog.py ...............
.local/lib/python2.7/site-packages/astropy/vo/samp/tests/test_client.py ....
.local/lib/python2.7/site-packages/astropy/vo/samp/tests/test_errors.py ...
.local/lib/python2.7/site-packages/astropy/vo/samp/tests/test_hub.py ..
.local/lib/python2.7/site-packages/astropy/vo/samp/tests/test_hub_proxy.py .....
.local/lib/python2.7/site-packages/astropy/vo/samp/tests/test_hub_script.py .
.local/lib/python2.7/site-packages/astropy/vo/samp/tests/test_standard_profile.py ...
.local/lib/python2.7/site-packages/astropy/vo/samp/tests/test_web_profile.py ..
.local/lib/python2.7/site-packages/astropy/vo/validator/tests/test_inpect.py ....
.local/lib/python2.7/site-packages/astropy/vo/validator/tests/test_validate.py ....
.local/lib/python2.7/site-packages/astropy/wcs/tests/test_pickle.py ......
.local/lib/python2.7/site-packages/astropy/wcs/tests/test_profiling.py ..................................
.local/lib/python2.7/site-packages/astropy/wcs/tests/test_utils.py .........................................
.local/lib/python2.7/site-packages/astropy/wcs/tests/test_wcs.py ....................................................................................................................................................
.local/lib/python2.7/site-packages/astropy/wcs/tests/test_wcsprm.py .....................................................................................................x.....XX..
.local/lib/python2.7/site-packages/astropy/wcs/tests/extension/test_extension.py .
============================================================================================================= ERRORS ==============================================================================================================
_________________________________________________________________________________________ ERROR collecting modeling/tests/test_models.py __________________________________________________________________________________________
_pytest.runner:149: in __init__
???
_pytest.main:437: in _memocollect
???
_pytest.main:314: in _memoizedcall
???
_pytest.main:437: in <lambda>
???
_pytest.python:573: in collect
???
_pytest.python:365: in collect
???
_pytest.python:377: in makeitem
???
_pytest.core:521: in __call__
???
_pytest.core:528: in _docall
???
_pytest.core:393: in execute
???
_pytest.core:109: in wrapped_call
???
_pytest.python:255: in pytest_pycollect_makeitem
???
_pytest.python:394: in _genfunctions
???
_pytest.core:524: in callextra
???
_pytest.core:528: in _docall
???
_pytest.core:394: in execute
???
_pytest.python:164: in pytest_generate_tests
???
_pytest.python:879: in parametrize
???
_pytest.python:752: in setmulti
???
_pytest.python:735: in _checkargnotcontained
???
E ValueError: duplicate u'model_class'
_________________________________________________________________________________________ ERROR collecting modeling/tests/test_models.py __________________________________________________________________________________________
_pytest.runner:149: in __init__
???
_pytest.main:437: in _memocollect
???
_pytest.main:314: in _memoizedcall
???
_pytest.main:437: in <lambda>
???
_pytest.python:573: in collect
???
_pytest.python:365: in collect
???
_pytest.python:377: in makeitem
???
_pytest.core:521: in __call__
???
_pytest.core:528: in _docall
???
_pytest.core:393: in execute
???
_pytest.core:109: in wrapped_call
???
_pytest.python:255: in pytest_pycollect_makeitem
???
_pytest.python:394: in _genfunctions
???
_pytest.core:524: in callextra
???
_pytest.core:528: in _docall
???
_pytest.core:394: in execute
???
_pytest.python:164: in pytest_generate_tests
???
_pytest.python:879: in parametrize
???
_pytest.python:752: in setmulti
???
_pytest.python:735: 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)
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_distance.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.local/lib/python2.7/site-packages/numpy/testing/utils.py:1297: in assert_allclose
verbose=verbose, header=header)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
comparison = <function compare at 0x7f34848ecaa0>, x = array(0.2300000025478198), 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.2300000025478198)
E y: array(0.23)
.local/lib/python2.7/site-packages/numpy/testing/utils.py:665: AssertionError
__________________________________________________________________________________________________ test_representation_subclass ___________________________________________________________________________________________________
def test_representation_subclass():
# Regression test for #3354
from ..builtin_frames import FK5
# Normally when instantiating a frame without a distance the frame will try
# and use UnitSphericalRepresentation internally instead of
# SphericalRepresentation.
frame = FK5(representation=representation.SphericalRepresentation, ra=32 * u.deg, dec=20 * u.deg)
assert type(frame._data) == representation.UnitSphericalRepresentation
assert frame.representation == representation.SphericalRepresentation
# If using a SphericalRepresentation class this used to not work, so we
# test here that this is now fixed.
> class NewSphericalRepresentation(representation.SphericalRepresentation):
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_frames.py:630:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'astropy.coordinates.tests.test_frames.NewSphericalRepresentation'>, name = 'NewSphericalRepresentation', bases = (<class 'astropy.coordinates.representation.SphericalRepresentation'>,)
dct = {'__module__': 'astropy.coordinates.tests.test_frames', 'attr_classes': OrderedDict([(u'lon', <class 'astropy.coordinates.angles.Longitude'>), (u'lat'....angles.Latitude'>), (u'distance', <class 'astropy.units.quantity.Quantity'>)])}
def __init__(cls, name, bases, dct):
super(MetaBaseRepresentation, cls).__init__(name, bases, dct)
if name != 'BaseRepresentation' and 'attr_classes' not in dct:
raise NotImplementedError('Representations must have an '
'"attr_classes" class attribute.')
# Register representation name (except for BaseRepresentation)
if cls.__name__ == 'BaseRepresentation':
return
repr_name = cls.get_name()
if repr_name in REPRESENTATION_CLASSES:
> raise ValueError("Representation class {0} already defined".format(repr_name))
E ValueError: Representation class newspherical already defined
.local/lib/python2.7/site-packages/astropy/coordinates/representation.py:48: ValueError
___________________________________________________________________________________________________________ test_names ____________________________________________________________________________________________________________
@remote_data
def test_names():
# First check that sesame is up
if urllib.request.urlopen("http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame").getcode() != 200:
pytest.skip("SESAME appears to be down, skipping test_name_resolve.py:test_names()...")
with pytest.raises(NameResolveError):
get_icrs_coordinates("m87h34hhh")
try:
icrs = get_icrs_coordinates("ngc 3642")
except NameResolveError:
ra, dec = _parse_response(_cached_ngc3642["all"])
icrs = SkyCoord(ra=float(ra)*u.degree, dec=float(dec)*u.degree)
icrs_true = SkyCoord(ra="11h 22m 18.014s", dec="59d 04m 27.27s")
np.testing.assert_almost_equal(icrs.ra.degree, icrs_true.ra.degree, 3)
np.testing.assert_almost_equal(icrs.dec.degree, icrs_true.dec.degree, 3)
try:
icrs = get_icrs_coordinates("castor")
except NameResolveError:
ra,dec = _parse_response(_cached_castor["all"])
icrs = SkyCoord(ra=float(ra)*u.degree, dec=float(dec)*u.degree)
icrs_true = SkyCoord(ra="07h 34m 35.87s", dec="+31d 53m 17.8s")
> np.testing.assert_almost_equal(icrs.ra.degree, icrs_true.ra.degree, 3)
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_name_resolve.py:136:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = 113.6566, desired = 113.64945833333331, decimal = 3, err_msg = '', verbose = True
def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
"""
Raises an AssertionError if two items are not equal up to desired
precision.
.. note:: It is recommended to use one of `assert_allclose`,
`assert_array_almost_equal_nulp` or `assert_array_max_ulp`
instead of this function for more consistent floating point
comparisons.
The test is equivalent to ``abs(desired-actual) < 0.5 * 10**(-decimal)``.
Given two objects (numbers or ndarrays), check that all elements of these
objects are almost equal. An exception is raised at conflicting values.
For ndarrays this delegates to assert_array_almost_equal
Parameters
----------
actual : array_like
The object to check.
desired : array_like
The expected object.
decimal : int, optional
Desired precision, default is 7.
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_allclose: Compare two array_like objects for equality with desired
relative and/or absolute precision.
assert_array_almost_equal_nulp, assert_array_max_ulp, assert_equal
Examples
--------
>>> import numpy.testing as npt
>>> npt.assert_almost_equal(2.3333333333333, 2.33333334)
>>> npt.assert_almost_equal(2.3333333333333, 2.33333334, decimal=10)
...
<type 'exceptions.AssertionError'>:
Items are not equal:
ACTUAL: 2.3333333333333002
DESIRED: 2.3333333399999998
>>> npt.assert_almost_equal(np.array([1.0,2.3333333333333]),
... np.array([1.0,2.33333334]), decimal=9)
...
<type 'exceptions.AssertionError'>:
Arrays are not almost equal
<BLANKLINE>
(mismatch 50.0%)
x: array([ 1. , 2.33333333])
y: array([ 1. , 2.33333334])
"""
from numpy.core import ndarray
from numpy.lib import iscomplexobj, real, imag
# Handle complex numbers: separate into real/imag to handle
# nan/inf/negative zero correctly
# XXX: catch ValueError for subclasses of ndarray where iscomplex fail
try:
usecomplex = iscomplexobj(actual) or iscomplexobj(desired)
except ValueError:
usecomplex = False
def _build_err_msg():
header = ('Arrays are not almost equal to %d decimals' % decimal)
return build_err_msg([actual, desired], err_msg, verbose=verbose,
header=header)
if usecomplex:
if iscomplexobj(actual):
actualr = real(actual)
actuali = imag(actual)
else:
actualr = actual
actuali = 0
if iscomplexobj(desired):
desiredr = real(desired)
desiredi = imag(desired)
else:
desiredr = desired
desiredi = 0
try:
assert_almost_equal(actualr, desiredr, decimal=decimal)
assert_almost_equal(actuali, desiredi, decimal=decimal)
except AssertionError:
raise AssertionError(_build_err_msg())
if isinstance(actual, (ndarray, tuple, list)) \
or isinstance(desired, (ndarray, tuple, list)):
return assert_array_almost_equal(actual, desired, decimal, err_msg)
try:
# If one of desired/actual is not finite, handle it specially here:
# check that both are nan if any is a nan, and test for equality
# otherwise
if not (gisfinite(desired) and gisfinite(actual)):
if gisnan(desired) or gisnan(actual):
if not (gisnan(desired) and gisnan(actual)):
raise AssertionError(_build_err_msg())
else:
if not desired == actual:
raise AssertionError(_build_err_msg())
return
except (NotImplementedError, TypeError):
pass
if round(abs(desired - actual), decimal) != 0 :
> raise AssertionError(_build_err_msg())
E AssertionError:
E Arrays are not almost equal to 3 decimals
E ACTUAL: 113.6566
E DESIRED: 113.64945833333331
.local/lib/python2.7/site-packages/numpy/testing/utils.py:490: AssertionError
___________________________________________________________________________________________________________ test_names ____________________________________________________________________________________________________________
@remote_data
def test_names():
# First check that sesame is up
if urllib.request.urlopen("http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame").getcode() != 200:
pytest.skip("SESAME appears to be down, skipping test_name_resolve.py:test_names()...")
with pytest.raises(NameResolveError):
get_icrs_coordinates("m87h34hhh")
try:
icrs = get_icrs_coordinates("ngc 3642")
except NameResolveError:
ra, dec = _parse_response(_cached_ngc3642["all"])
icrs = SkyCoord(ra=float(ra)*u.degree, dec=float(dec)*u.degree)
icrs_true = SkyCoord(ra="11h 22m 18.014s", dec="59d 04m 27.27s")
np.testing.assert_almost_equal(icrs.ra.degree, icrs_true.ra.degree, 3)
np.testing.assert_almost_equal(icrs.dec.degree, icrs_true.dec.degree, 3)
try:
icrs = get_icrs_coordinates("castor")
except NameResolveError:
ra,dec = _parse_response(_cached_castor["all"])
icrs = SkyCoord(ra=float(ra)*u.degree, dec=float(dec)*u.degree)
icrs_true = SkyCoord(ra="07h 34m 35.87s", dec="+31d 53m 17.8s")
> np.testing.assert_almost_equal(icrs.ra.degree, icrs_true.ra.degree, 3)
.local/lib/python2.7/site-packages/astropy/coordinates/tests/test_name_resolve.py:136:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = 113.6566, desired = 113.64945833333331, decimal = 3, err_msg = '', verbose = True
def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
"""
Raises an AssertionError if two items are not equal up to desired
precision.
.. note:: It is recommended to use one of `assert_allclose`,
`assert_array_almost_equal_nulp` or `assert_array_max_ulp`
instead of this function for more consistent floating point
comparisons.
The test is equivalent to ``abs(desired-actual) < 0.5 * 10**(-decimal)``.
Given two objects (numbers or ndarrays), check that all elements of these
objects are almost equal. An exception is raised at conflicting values.
For ndarrays this delegates to assert_array_almost_equal
Parameters
----------
actual : array_like
The object to check.
desired : array_like
The expected object.
decimal : int, optional
Desired precision, default is 7.
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_allclose: Compare two array_like objects for equality with desired
relative and/or absolute precision.
assert_array_almost_equal_nulp, assert_array_max_ulp, assert_equal
Examples
--------
>>> import numpy.testing as npt
>>> npt.assert_almost_equal(2.3333333333333, 2.33333334)
>>> npt.assert_almost_equal(2.3333333333333, 2.33333334, decimal=10)
...
<type 'exceptions.AssertionError'>:
Items are not equal:
ACTUAL: 2.3333333333333002
DESIRED: 2.3333333399999998
>>> npt.assert_almost_equal(np.array([1.0,2.3333333333333]),
... np.array([1.0,2.33333334]), decimal=9)
...
<type 'exceptions.AssertionError'>:
Arrays are not almost equal
<BLANKLINE>
(mismatch 50.0%)
x: array([ 1. , 2.33333333])
y: array([ 1. , 2.33333334])
"""
from numpy.core import ndarray
from numpy.lib import iscomplexobj, real, imag
# Handle complex numbers: separate into real/imag to handle
# nan/inf/negative zero correctly
# XXX: catch ValueError for subclasses of ndarray where iscomplex fail
try:
usecomplex = iscomplexobj(actual) or iscomplexobj(desired)
except ValueError:
usecomplex = False
def _build_err_msg():
header = ('Arrays are not almost equal to %d decimals' % decimal)
return build_err_msg([actual, desired], err_msg, verbose=verbose,
header=header)
if usecomplex:
if iscomplexobj(actual):
actualr = real(actual)
actuali = imag(actual)
else:
actualr = actual
actuali = 0
if iscomplexobj(desired):
desiredr = real(desired)
desiredi = imag(desired)
else:
desiredr = desired
desiredi = 0
try:
assert_almost_equal(actualr, desiredr, decimal=decimal)
assert_almost_equal(actuali, desiredi, decimal=decimal)
except AssertionError:
raise AssertionError(_build_err_msg())
if isinstance(actual, (ndarray, tuple, list)) \
or isinstance(desired, (ndarray, tuple, list)):
return assert_array_almost_equal(actual, desired, decimal, err_msg)
try:
# If one of desired/actual is not finite, handle it specially here:
# check that both are nan if any is a nan, and test for equality
# otherwise
if not (gisfinite(desired) and gisfinite(actual)):
if gisnan(desired) or gisnan(actual):
if not (gisnan(desired) and gisnan(actual)):
raise AssertionError(_build_err_msg())
else:
if not desired == actual:
raise AssertionError(_build_err_msg())
return
except (NotImplementedError, TypeError):
pass
if round(abs(desired - actual), decimal) != 0 :
> raise AssertionError(_build_err_msg())
E AssertionError:
E Arrays are not almost equal to 3 decimals
E ACTUAL: 113.6566
E DESIRED: 113.64945833333331
.local/lib/python2.7/site-packages/numpy/testing/utils.py:490: AssertionError
________________________________________________________________________________________________ test_inherit_constraints[model0] _________________________________________________________________________________________________
model = <CompoundModel11(amplitude_0=1.0, mean_0=0.0, stddev_0=1.0, amplitude_1=1.0, mean_1=0.0, stddev_1=1.0)>
@pytest.mark.parametrize('model',
[Gaussian1D(bounds={'stddev': (0, 0.3)}, fixed={'mean': True}) +
Gaussian1D(fixed={'mean': True}),
(_ConstraintsTestA + _ConstraintsTestB)()])
def test_inherit_constraints(model):
"""
Various tests for copying of constraint values between compound models and
their members.
There are two versions of this test: One where a compound model is created
from two model instances, and another where a compound model is created
from two model classes that have default constraints set on some of their
parameters.
Regression test for https://github.com/astropy/astropy/issues/3481
"""
# Lots of assertions in this test as there are multiple interfaces to
# parameter constraints
assert 'stddev_0' in model.bounds
> assert model.bounds['stddev_0'] == (0, 0.3)
E assert (0.1, 0.5) == (0, 0.3)
E At index 0 diff: 0.1 != 0
E Use -v to get the full diff
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_compound.py:759: AssertionError
________________________________________________________________________________________________ test_inherit_constraints[model1] _________________________________________________________________________________________________
model = <CompoundModel12(stddev_0=0.0, mean_0=0.0, mean_1=0.0)>
@pytest.mark.parametrize('model',
[Gaussian1D(bounds={'stddev': (0, 0.3)}, fixed={'mean': True}) +
Gaussian1D(fixed={'mean': True}),
(_ConstraintsTestA + _ConstraintsTestB)()])
def test_inherit_constraints(model):
"""
Various tests for copying of constraint values between compound models and
their members.
There are two versions of this test: One where a compound model is created
from two model instances, and another where a compound model is created
from two model classes that have default constraints set on some of their
parameters.
Regression test for https://github.com/astropy/astropy/issues/3481
"""
# Lots of assertions in this test as there are multiple interfaces to
# parameter constraints
assert 'stddev_0' in model.bounds
> assert model.bounds['stddev_0'] == (0, 0.3)
E assert (0.1, 0.5) == (0, 0.3)
E At index 0 diff: 0.1 != 0
E Use -v to get the full diff
.local/lib/python2.7/site-packages/astropy/modeling/tests/test_compound.py:759: 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)
.local/lib/python2.7/site-packages/astropy/utils/tests/test_state.py:16: AssertionError
====================================================================== 7 failed, 9635 passed, 170 skipped, 45 xfailed, 2 xpassed, 2 error in 291.48 seconds =======================================================================
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment