Created
September 29, 2021 18:22
-
-
Save bsipocz/9e38731afb2da1d8233a737976037418 to your computer and use it in GitHub Desktop.
vo_conesearch remote test failures 2021-09-29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pt -P vo_conesearch -R | |
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first. | |
warnings.warn( | |
Freezing version number to ./astroquery/version.py | |
running test | |
INFO: installing to temporary directory: /private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroquery-test-1n7kjymp [astropy.tests.command] | |
no previously-included directories found matching 'build' | |
no previously-included directories found matching 'docs/_build' | |
no previously-included directories found matching 'docs/api' | |
no previously-included directories found matching 'astropy_helpers/build' | |
warning: no previously-included files matching '*.o' found anywhere in distribution | |
WARNING: AstropyDeprecationWarning: The remote_data option should be one of none/astropy/any (found =any). For backward-compatibility, assuming 'any', but you should change the option to be one of the supported ones to avoid issues in future. [astropy.tests.runner] | |
================================================= test session starts ================================================== | |
platform darwin -- Python 3.9.1, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 | |
Running tests with astroquery version 0.4.4.dev7012_testrun. | |
Running tests in astroquery/vo_conesearch docs/vo_conesearch. | |
Date: 2021-09-29T11:19:32 | |
Platform: macOS-10.13.6-x86_64-i386-64bit | |
Executable: /Users/bsipocz/.pyenv/versions/3.9.1/bin/python | |
Full Python Version: | |
3.9.1 (default, Jan 11 2021, 15:50:22) | |
[Clang 10.0.0 (clang-1000.11.45.5)] | |
encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8 | |
byteorder: little | |
float info: dig: 15, mant_dig: 15 | |
Package versions: | |
Numpy: 1.19.5 | |
Matplotlib: 3.3.3 | |
Astropy: 5.0.dev703+ge31867e12 | |
APLpy: not available | |
pyregion: not available | |
regions: 0.4 | |
pyVO: 1.1 | |
mocpy: 0.8.5 | |
astropy-healpix: 0.6 | |
vamdclib: not available | |
astropy-helpers: 4.0.1 | |
Using Astropy options: remote_data: any. | |
rootdir: /private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroquery-test-1n7kjymp/lib/python3.9/site-packages, configfile: setup.cfg | |
plugins: doctestplus-0.11.0, cov-2.12.1, arraydiff-0.3, remotedata-0.3.2, hypothesis-6.3.1, filter-subpackage-0.1.1, openfiles-0.5.0, astropy-header-0.1.2 | |
collected 51 items | |
astroquery/vo_conesearch/tests/test_conesearch.py ...FF..FFFFFF......x.... [ 47%] | |
astroquery/vo_conesearch/tests/test_vos_catalog.py ..............F [ 76%] | |
astroquery/vo_conesearch/validator/tests/test_inpect.py .... [ 84%] | |
astroquery/vo_conesearch/validator/tests/test_validate.py .F.F. [ 94%] | |
docs/vo_conesearch/client.rst s [ 96%] | |
docs/vo_conesearch/validator.rst s [ 98%] | |
docs/vo_conesearch/vo_conesearch.rst s [100%] | |
======================================================= FAILURES ======================================================= | |
_________________________________ TestConeSearch.test_one_search_classic[center0-0.1] __________________________________ | |
center = (0, 0), radius = 0.1 | |
def conesearch(center, radius, *, verb=1, catalog_db=None, | |
verbose=True, cache=True, query_all=False, | |
return_astropy_table=True, use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.pedantic`` to control | |
pedantry. When `True`, will raise an error when the result | |
violates the spec, otherwise issue a warning. Warnings may | |
be controlled using :py:mod:`warnings` module. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.timeout`` to control | |
timeout limit in seconds for each service being queried. | |
Parameters | |
---------- | |
center : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If astropy quantity is given, it is internally converted | |
to degrees. | |
verb : {1, 2, 3} | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. If the | |
service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
catalog_db | |
May be one of the following, in order from easiest to | |
use to most control: | |
- `None`: A database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs is | |
downloaded from ``astroquery.vo_conesearch.conf.vos_baseurl``. | |
The first catalog in the database to successfully return a | |
result is used. | |
- *catalog name*: A name in the database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs at | |
``astroquery.vo_conesearch.conf.vos_baseurl`` is used. | |
For a list of acceptable names, use | |
:func:`astroquery.vo_conesearch.vos_catalog.list_catalogs`. | |
- *url*: The prefix of a URL to a IVOA Service for | |
``astroquery.vo_conesearch.conf.conesearch_dbname``. | |
Must end in either '?' or '&'. | |
- `~astroquery.vo_conesearch.vos_catalog.VOSCatalog` object: A | |
specific catalog manually downloaded and selected from the | |
database (see :ref:`vo-sec-client-vos`). | |
- Any of the above 3 options combined in a list, in which case | |
they are tried in order. | |
verbose : bool | |
Verbose output. | |
cache : bool | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
query_all : bool | |
This is used by :func:`search_all`. | |
return_astropy_table : bool | |
Returned ``obj`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
obj : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
First table from first successful VO service request. | |
See ``return_astropy_table`` parameter for the kind of table returned. | |
Raises | |
------ | |
ConeSearchError | |
When invalid inputs are passed into Cone Search. | |
""" | |
n_timed_out = 0 | |
service_type = conf.conesearch_dbname | |
catalogs = vos_catalog._get_catalogs( | |
service_type, catalog_db, cache=cache, verbose=verbose) | |
if query_all: | |
result = {} | |
else: | |
result = None | |
for name, catalog in catalogs: | |
if isinstance(catalog, str): | |
if catalog.startswith('http'): | |
url = catalog | |
else: | |
remote_db = vos_catalog.get_remote_catalog_db( | |
service_type, cache=cache, verbose=verbose) | |
catalog = remote_db.get_catalog(catalog) | |
url = catalog['url'] | |
else: | |
url = catalog['url'] | |
if verbose: # pragma: no cover | |
color_print('Trying {0}'.format(url), 'green') | |
try: | |
> r = ConeSearch.query_region( | |
center, radius, verb=verb, cache=cache, verbose=verbose, | |
service_url=url, return_astropy_table=return_astropy_table, | |
use_names_over_ids=use_names_over_ids) | |
astroquery/vo_conesearch/conesearch.py:224: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <astroquery.vo_conesearch.core.ConeSearchClass object at 0x14c893850>, coordinates = (0, 0), radius = 0.1 | |
def query_region(self, coordinates, radius, *, verb=1, | |
get_query_payload=False, cache=True, verbose=False, | |
service_url=None, return_astropy_table=True, | |
use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
Parameters | |
---------- | |
coordinates : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If `~astropy.units.quantity.Quantity` is given, | |
it is internally converted to degrees. | |
verb : {1, 2, 3}, optional | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. | |
If the service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
get_query_payload : bool, optional | |
Just return the dict of HTTP request parameters. | |
cache : bool, optional | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
verbose : bool, optional | |
Verbose output, including VO table warnings. | |
service_url : str or `None` | |
URL for the Cone Search service. If not given, will use | |
``fallback_url`` from ``vo_conesearch`` configuration. | |
return_astropy_table : bool | |
Returned ``result`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
result : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
Table from successful VO service request. | |
See ``return_astropy_table`` option for the kind of table returned. | |
""" | |
request_payload = self._args_to_payload(coordinates, radius, verb) | |
if get_query_payload: | |
return request_payload | |
> url = _validate_url(service_url) | |
astroquery/vo_conesearch/core.py:145: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
url = 'https://astroconda.org/notreal' | |
def _validate_url(url): | |
"""Validate Cone Search service URL.""" | |
if url is None: | |
url = conf.fallback_url | |
# This is the standard expectation of a service URL | |
if not url.endswith(('?', '&')): | |
> raise InvalidAccessURL("URL should end with '?' or '&'") | |
E astroquery.vo_conesearch.exceptions.InvalidAccessURL: URL should end with '?' or '&' | |
astroquery/vo_conesearch/core.py:200: InvalidAccessURL | |
During handling of the above exception, another exception occurred: | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14cf07940>, center = (0, 0) | |
radius = 0.1 | |
@pytest.mark.parametrize(('center', 'radius'), | |
[((SCS_RA, SCS_DEC), SCS_SR), | |
(SCS_CENTER, SCS_RADIUS)]) | |
def test_one_search_classic(self, center, radius): | |
""" | |
This does not necessarily uses ``self.url`` because of | |
unordered dict in JSON tree. | |
""" | |
> tab_1 = conesearch.conesearch( | |
center, radius, verbose=self.verbose, return_astropy_table=False) | |
astroquery/vo_conesearch/tests/test_conesearch.py:92: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/vo_conesearch/conesearch.py:230: in conesearch | |
vo_warn(W25, (url, err_msg)) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W25("?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&'") | |
config = {'_warning_counts': {<class 'astropy.io.votable.exceptions.W25'>: 1}}, stacklevel = 2 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W25: ?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&' | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W25 | |
_______________________________ TestConeSearch.test_one_search_classic[center1-radius1] ________________________________ | |
center = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def conesearch(center, radius, *, verb=1, catalog_db=None, | |
verbose=True, cache=True, query_all=False, | |
return_astropy_table=True, use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.pedantic`` to control | |
pedantry. When `True`, will raise an error when the result | |
violates the spec, otherwise issue a warning. Warnings may | |
be controlled using :py:mod:`warnings` module. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.timeout`` to control | |
timeout limit in seconds for each service being queried. | |
Parameters | |
---------- | |
center : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If astropy quantity is given, it is internally converted | |
to degrees. | |
verb : {1, 2, 3} | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. If the | |
service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
catalog_db | |
May be one of the following, in order from easiest to | |
use to most control: | |
- `None`: A database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs is | |
downloaded from ``astroquery.vo_conesearch.conf.vos_baseurl``. | |
The first catalog in the database to successfully return a | |
result is used. | |
- *catalog name*: A name in the database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs at | |
``astroquery.vo_conesearch.conf.vos_baseurl`` is used. | |
For a list of acceptable names, use | |
:func:`astroquery.vo_conesearch.vos_catalog.list_catalogs`. | |
- *url*: The prefix of a URL to a IVOA Service for | |
``astroquery.vo_conesearch.conf.conesearch_dbname``. | |
Must end in either '?' or '&'. | |
- `~astroquery.vo_conesearch.vos_catalog.VOSCatalog` object: A | |
specific catalog manually downloaded and selected from the | |
database (see :ref:`vo-sec-client-vos`). | |
- Any of the above 3 options combined in a list, in which case | |
they are tried in order. | |
verbose : bool | |
Verbose output. | |
cache : bool | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
query_all : bool | |
This is used by :func:`search_all`. | |
return_astropy_table : bool | |
Returned ``obj`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
obj : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
First table from first successful VO service request. | |
See ``return_astropy_table`` parameter for the kind of table returned. | |
Raises | |
------ | |
ConeSearchError | |
When invalid inputs are passed into Cone Search. | |
""" | |
n_timed_out = 0 | |
service_type = conf.conesearch_dbname | |
catalogs = vos_catalog._get_catalogs( | |
service_type, catalog_db, cache=cache, verbose=verbose) | |
if query_all: | |
result = {} | |
else: | |
result = None | |
for name, catalog in catalogs: | |
if isinstance(catalog, str): | |
if catalog.startswith('http'): | |
url = catalog | |
else: | |
remote_db = vos_catalog.get_remote_catalog_db( | |
service_type, cache=cache, verbose=verbose) | |
catalog = remote_db.get_catalog(catalog) | |
url = catalog['url'] | |
else: | |
url = catalog['url'] | |
if verbose: # pragma: no cover | |
color_print('Trying {0}'.format(url), 'green') | |
try: | |
> r = ConeSearch.query_region( | |
center, radius, verb=verb, cache=cache, verbose=verbose, | |
service_url=url, return_astropy_table=return_astropy_table, | |
use_names_over_ids=use_names_over_ids) | |
astroquery/vo_conesearch/conesearch.py:224: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <astroquery.vo_conesearch.core.ConeSearchClass object at 0x14c893850> | |
coordinates = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def query_region(self, coordinates, radius, *, verb=1, | |
get_query_payload=False, cache=True, verbose=False, | |
service_url=None, return_astropy_table=True, | |
use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
Parameters | |
---------- | |
coordinates : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If `~astropy.units.quantity.Quantity` is given, | |
it is internally converted to degrees. | |
verb : {1, 2, 3}, optional | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. | |
If the service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
get_query_payload : bool, optional | |
Just return the dict of HTTP request parameters. | |
cache : bool, optional | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
verbose : bool, optional | |
Verbose output, including VO table warnings. | |
service_url : str or `None` | |
URL for the Cone Search service. If not given, will use | |
``fallback_url`` from ``vo_conesearch`` configuration. | |
return_astropy_table : bool | |
Returned ``result`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
result : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
Table from successful VO service request. | |
See ``return_astropy_table`` option for the kind of table returned. | |
""" | |
request_payload = self._args_to_payload(coordinates, radius, verb) | |
if get_query_payload: | |
return request_payload | |
> url = _validate_url(service_url) | |
astroquery/vo_conesearch/core.py:145: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
url = 'https://astroconda.org/notreal' | |
def _validate_url(url): | |
"""Validate Cone Search service URL.""" | |
if url is None: | |
url = conf.fallback_url | |
# This is the standard expectation of a service URL | |
if not url.endswith(('?', '&')): | |
> raise InvalidAccessURL("URL should end with '?' or '&'") | |
E astroquery.vo_conesearch.exceptions.InvalidAccessURL: URL should end with '?' or '&' | |
astroquery/vo_conesearch/core.py:200: InvalidAccessURL | |
During handling of the above exception, another exception occurred: | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14d32aee0> | |
center = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
@pytest.mark.parametrize(('center', 'radius'), | |
[((SCS_RA, SCS_DEC), SCS_SR), | |
(SCS_CENTER, SCS_RADIUS)]) | |
def test_one_search_classic(self, center, radius): | |
""" | |
This does not necessarily uses ``self.url`` because of | |
unordered dict in JSON tree. | |
""" | |
> tab_1 = conesearch.conesearch( | |
center, radius, verbose=self.verbose, return_astropy_table=False) | |
astroquery/vo_conesearch/tests/test_conesearch.py:92: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/vo_conesearch/conesearch.py:230: in conesearch | |
vo_warn(W25, (url, err_msg)) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W25("?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&'") | |
config = {'_warning_counts': {<class 'astropy.io.votable.exceptions.W25'>: 1}}, stacklevel = 2 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W25: ?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&' | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W25 | |
_________________________________________ TestConeSearch.test_timeout_classic __________________________________________ | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14d3b02b0> | |
def test_timeout_classic(self): | |
"""Test timed out query.""" | |
with pytest.warns(NoResultsWarning, match='timed out'): | |
with conf.set_temp('timeout', 1e-6): | |
> result = conesearch.conesearch( | |
SCS_CENTER, SCS_RADIUS, cache=False, | |
verbose=self.verbose, catalog_db=self.url) | |
E Failed: DID NOT WARN. No warnings of type (<class 'astroquery.exceptions.NoResultsWarning'>,) was emitted. The list of emitted warnings is: [W25("?:?:?: W25: 'http://vizier.unistra.fr/viz-bin/votable/-A?-out.all&-source=I/252/out&' failed with: HTTPConnectionPool(host='vizier.unistra.fr', port=80): Read timed out. (read timeout=1e-06)")]. | |
astroquery/vo_conesearch/tests/test_conesearch.py:118: Failed | |
_________________________________________ TestConeSearch.test_searches_classic _________________________________________ | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14d22dcd0> | |
def test_searches_classic(self): | |
tab_2 = conesearch.conesearch( | |
SCS_CENTER, SCS_RADIUS, catalog_db=self.url, verbose=self.verbose, | |
return_astropy_table=False) | |
tab_3 = conesearch.conesearch( | |
SCS_CENTER, SCS_RADIUS, | |
catalog_db=[self.catname, self.url], verbose=self.verbose, | |
return_astropy_table=False) | |
tab_4 = conesearch.conesearch( | |
SCS_CENTER, SCS_RADIUS, | |
catalog_db=vos_catalog.get_remote_catalog_db( | |
conf.conesearch_dbname), verbose=self.verbose, | |
return_astropy_table=False) | |
> assert tab_2.url == tab_3.url | |
E AssertionError: assert 'http://vizie...rce=I/252/out' == 'http://vizie...rce=I/252/out' | |
E - http://vizier.u-strasbg.fr/viz-bin/votable/-A?-out.all&-source=I/252/out | |
E ? ^ --- | |
E + http://vizier.unistra.fr/viz-bin/votable/-A?-out.all&-source=I/252/out | |
E ? ^^ | |
astroquery/vo_conesearch/tests/test_conesearch.py:139: AssertionError | |
_____________________________________ TestConeSearch.test_search_all[center0-0.1] ______________________________________ | |
center = (0, 0), radius = 0.1 | |
def conesearch(center, radius, *, verb=1, catalog_db=None, | |
verbose=True, cache=True, query_all=False, | |
return_astropy_table=True, use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.pedantic`` to control | |
pedantry. When `True`, will raise an error when the result | |
violates the spec, otherwise issue a warning. Warnings may | |
be controlled using :py:mod:`warnings` module. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.timeout`` to control | |
timeout limit in seconds for each service being queried. | |
Parameters | |
---------- | |
center : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If astropy quantity is given, it is internally converted | |
to degrees. | |
verb : {1, 2, 3} | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. If the | |
service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
catalog_db | |
May be one of the following, in order from easiest to | |
use to most control: | |
- `None`: A database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs is | |
downloaded from ``astroquery.vo_conesearch.conf.vos_baseurl``. | |
The first catalog in the database to successfully return a | |
result is used. | |
- *catalog name*: A name in the database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs at | |
``astroquery.vo_conesearch.conf.vos_baseurl`` is used. | |
For a list of acceptable names, use | |
:func:`astroquery.vo_conesearch.vos_catalog.list_catalogs`. | |
- *url*: The prefix of a URL to a IVOA Service for | |
``astroquery.vo_conesearch.conf.conesearch_dbname``. | |
Must end in either '?' or '&'. | |
- `~astroquery.vo_conesearch.vos_catalog.VOSCatalog` object: A | |
specific catalog manually downloaded and selected from the | |
database (see :ref:`vo-sec-client-vos`). | |
- Any of the above 3 options combined in a list, in which case | |
they are tried in order. | |
verbose : bool | |
Verbose output. | |
cache : bool | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
query_all : bool | |
This is used by :func:`search_all`. | |
return_astropy_table : bool | |
Returned ``obj`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
obj : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
First table from first successful VO service request. | |
See ``return_astropy_table`` parameter for the kind of table returned. | |
Raises | |
------ | |
ConeSearchError | |
When invalid inputs are passed into Cone Search. | |
""" | |
n_timed_out = 0 | |
service_type = conf.conesearch_dbname | |
catalogs = vos_catalog._get_catalogs( | |
service_type, catalog_db, cache=cache, verbose=verbose) | |
if query_all: | |
result = {} | |
else: | |
result = None | |
for name, catalog in catalogs: | |
if isinstance(catalog, str): | |
if catalog.startswith('http'): | |
url = catalog | |
else: | |
remote_db = vos_catalog.get_remote_catalog_db( | |
service_type, cache=cache, verbose=verbose) | |
catalog = remote_db.get_catalog(catalog) | |
url = catalog['url'] | |
else: | |
url = catalog['url'] | |
if verbose: # pragma: no cover | |
color_print('Trying {0}'.format(url), 'green') | |
try: | |
> r = ConeSearch.query_region( | |
center, radius, verb=verb, cache=cache, verbose=verbose, | |
service_url=url, return_astropy_table=return_astropy_table, | |
use_names_over_ids=use_names_over_ids) | |
astroquery/vo_conesearch/conesearch.py:224: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <astroquery.vo_conesearch.core.ConeSearchClass object at 0x14c893850>, coordinates = (0, 0), radius = 0.1 | |
def query_region(self, coordinates, radius, *, verb=1, | |
get_query_payload=False, cache=True, verbose=False, | |
service_url=None, return_astropy_table=True, | |
use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
Parameters | |
---------- | |
coordinates : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If `~astropy.units.quantity.Quantity` is given, | |
it is internally converted to degrees. | |
verb : {1, 2, 3}, optional | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. | |
If the service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
get_query_payload : bool, optional | |
Just return the dict of HTTP request parameters. | |
cache : bool, optional | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
verbose : bool, optional | |
Verbose output, including VO table warnings. | |
service_url : str or `None` | |
URL for the Cone Search service. If not given, will use | |
``fallback_url`` from ``vo_conesearch`` configuration. | |
return_astropy_table : bool | |
Returned ``result`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
result : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
Table from successful VO service request. | |
See ``return_astropy_table`` option for the kind of table returned. | |
""" | |
request_payload = self._args_to_payload(coordinates, radius, verb) | |
if get_query_payload: | |
return request_payload | |
> url = _validate_url(service_url) | |
astroquery/vo_conesearch/core.py:145: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
url = 'https://astroconda.org/notreal' | |
def _validate_url(url): | |
"""Validate Cone Search service URL.""" | |
if url is None: | |
url = conf.fallback_url | |
# This is the standard expectation of a service URL | |
if not url.endswith(('?', '&')): | |
> raise InvalidAccessURL("URL should end with '?' or '&'") | |
E astroquery.vo_conesearch.exceptions.InvalidAccessURL: URL should end with '?' or '&' | |
astroquery/vo_conesearch/core.py:200: InvalidAccessURL | |
During handling of the above exception, another exception occurred: | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14d33a2b0>, center = (0, 0) | |
radius = 0.1 | |
@pytest.mark.parametrize(('center', 'radius'), | |
[((SCS_RA, SCS_DEC), SCS_SR), | |
(SCS_CENTER, SCS_RADIUS)]) | |
def test_search_all(self, center, radius): | |
> all_results = conesearch.search_all( | |
center, radius, catalog_db=['BROKEN', self.url], | |
verbose=self.verbose, return_astropy_table=False) | |
astroquery/vo_conesearch/tests/test_conesearch.py:149: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/vo_conesearch/conesearch.py:327: in search_all | |
return conesearch(*args, **kwargs) | |
astroquery/vo_conesearch/conesearch.py:230: in conesearch | |
vo_warn(W25, (url, err_msg)) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W25("?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&'") | |
config = {'_warning_counts': {<class 'astropy.io.votable.exceptions.W25'>: 1}}, stacklevel = 2 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W25: ?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&' | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W25 | |
___________________________________ TestConeSearch.test_search_all[center1-radius1] ____________________________________ | |
center = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def conesearch(center, radius, *, verb=1, catalog_db=None, | |
verbose=True, cache=True, query_all=False, | |
return_astropy_table=True, use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.pedantic`` to control | |
pedantry. When `True`, will raise an error when the result | |
violates the spec, otherwise issue a warning. Warnings may | |
be controlled using :py:mod:`warnings` module. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.timeout`` to control | |
timeout limit in seconds for each service being queried. | |
Parameters | |
---------- | |
center : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If astropy quantity is given, it is internally converted | |
to degrees. | |
verb : {1, 2, 3} | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. If the | |
service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
catalog_db | |
May be one of the following, in order from easiest to | |
use to most control: | |
- `None`: A database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs is | |
downloaded from ``astroquery.vo_conesearch.conf.vos_baseurl``. | |
The first catalog in the database to successfully return a | |
result is used. | |
- *catalog name*: A name in the database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs at | |
``astroquery.vo_conesearch.conf.vos_baseurl`` is used. | |
For a list of acceptable names, use | |
:func:`astroquery.vo_conesearch.vos_catalog.list_catalogs`. | |
- *url*: The prefix of a URL to a IVOA Service for | |
``astroquery.vo_conesearch.conf.conesearch_dbname``. | |
Must end in either '?' or '&'. | |
- `~astroquery.vo_conesearch.vos_catalog.VOSCatalog` object: A | |
specific catalog manually downloaded and selected from the | |
database (see :ref:`vo-sec-client-vos`). | |
- Any of the above 3 options combined in a list, in which case | |
they are tried in order. | |
verbose : bool | |
Verbose output. | |
cache : bool | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
query_all : bool | |
This is used by :func:`search_all`. | |
return_astropy_table : bool | |
Returned ``obj`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
obj : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
First table from first successful VO service request. | |
See ``return_astropy_table`` parameter for the kind of table returned. | |
Raises | |
------ | |
ConeSearchError | |
When invalid inputs are passed into Cone Search. | |
""" | |
n_timed_out = 0 | |
service_type = conf.conesearch_dbname | |
catalogs = vos_catalog._get_catalogs( | |
service_type, catalog_db, cache=cache, verbose=verbose) | |
if query_all: | |
result = {} | |
else: | |
result = None | |
for name, catalog in catalogs: | |
if isinstance(catalog, str): | |
if catalog.startswith('http'): | |
url = catalog | |
else: | |
remote_db = vos_catalog.get_remote_catalog_db( | |
service_type, cache=cache, verbose=verbose) | |
catalog = remote_db.get_catalog(catalog) | |
url = catalog['url'] | |
else: | |
url = catalog['url'] | |
if verbose: # pragma: no cover | |
color_print('Trying {0}'.format(url), 'green') | |
try: | |
> r = ConeSearch.query_region( | |
center, radius, verb=verb, cache=cache, verbose=verbose, | |
service_url=url, return_astropy_table=return_astropy_table, | |
use_names_over_ids=use_names_over_ids) | |
astroquery/vo_conesearch/conesearch.py:224: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <astroquery.vo_conesearch.core.ConeSearchClass object at 0x14c893850> | |
coordinates = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def query_region(self, coordinates, radius, *, verb=1, | |
get_query_payload=False, cache=True, verbose=False, | |
service_url=None, return_astropy_table=True, | |
use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
Parameters | |
---------- | |
coordinates : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If `~astropy.units.quantity.Quantity` is given, | |
it is internally converted to degrees. | |
verb : {1, 2, 3}, optional | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. | |
If the service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
get_query_payload : bool, optional | |
Just return the dict of HTTP request parameters. | |
cache : bool, optional | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
verbose : bool, optional | |
Verbose output, including VO table warnings. | |
service_url : str or `None` | |
URL for the Cone Search service. If not given, will use | |
``fallback_url`` from ``vo_conesearch`` configuration. | |
return_astropy_table : bool | |
Returned ``result`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
result : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
Table from successful VO service request. | |
See ``return_astropy_table`` option for the kind of table returned. | |
""" | |
request_payload = self._args_to_payload(coordinates, radius, verb) | |
if get_query_payload: | |
return request_payload | |
> url = _validate_url(service_url) | |
astroquery/vo_conesearch/core.py:145: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
url = 'https://astroconda.org/notreal' | |
def _validate_url(url): | |
"""Validate Cone Search service URL.""" | |
if url is None: | |
url = conf.fallback_url | |
# This is the standard expectation of a service URL | |
if not url.endswith(('?', '&')): | |
> raise InvalidAccessURL("URL should end with '?' or '&'") | |
E astroquery.vo_conesearch.exceptions.InvalidAccessURL: URL should end with '?' or '&' | |
astroquery/vo_conesearch/core.py:200: InvalidAccessURL | |
During handling of the above exception, another exception occurred: | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14d346a30> | |
center = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
@pytest.mark.parametrize(('center', 'radius'), | |
[((SCS_RA, SCS_DEC), SCS_SR), | |
(SCS_CENTER, SCS_RADIUS)]) | |
def test_search_all(self, center, radius): | |
> all_results = conesearch.search_all( | |
center, radius, catalog_db=['BROKEN', self.url], | |
verbose=self.verbose, return_astropy_table=False) | |
astroquery/vo_conesearch/tests/test_conesearch.py:149: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/vo_conesearch/conesearch.py:327: in search_all | |
return conesearch(*args, **kwargs) | |
astroquery/vo_conesearch/conesearch.py:230: in conesearch | |
vo_warn(W25, (url, err_msg)) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W25("?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&'") | |
config = {'_warning_counts': {<class 'astropy.io.votable.exceptions.W25'>: 1}}, stacklevel = 2 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W25: ?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&' | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W25 | |
______________________________________________ TestConeSearch.test_async _______________________________________________ | |
center = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def conesearch(center, radius, *, verb=1, catalog_db=None, | |
verbose=True, cache=True, query_all=False, | |
return_astropy_table=True, use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.pedantic`` to control | |
pedantry. When `True`, will raise an error when the result | |
violates the spec, otherwise issue a warning. Warnings may | |
be controlled using :py:mod:`warnings` module. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.timeout`` to control | |
timeout limit in seconds for each service being queried. | |
Parameters | |
---------- | |
center : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If astropy quantity is given, it is internally converted | |
to degrees. | |
verb : {1, 2, 3} | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. If the | |
service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
catalog_db | |
May be one of the following, in order from easiest to | |
use to most control: | |
- `None`: A database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs is | |
downloaded from ``astroquery.vo_conesearch.conf.vos_baseurl``. | |
The first catalog in the database to successfully return a | |
result is used. | |
- *catalog name*: A name in the database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs at | |
``astroquery.vo_conesearch.conf.vos_baseurl`` is used. | |
For a list of acceptable names, use | |
:func:`astroquery.vo_conesearch.vos_catalog.list_catalogs`. | |
- *url*: The prefix of a URL to a IVOA Service for | |
``astroquery.vo_conesearch.conf.conesearch_dbname``. | |
Must end in either '?' or '&'. | |
- `~astroquery.vo_conesearch.vos_catalog.VOSCatalog` object: A | |
specific catalog manually downloaded and selected from the | |
database (see :ref:`vo-sec-client-vos`). | |
- Any of the above 3 options combined in a list, in which case | |
they are tried in order. | |
verbose : bool | |
Verbose output. | |
cache : bool | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
query_all : bool | |
This is used by :func:`search_all`. | |
return_astropy_table : bool | |
Returned ``obj`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
obj : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
First table from first successful VO service request. | |
See ``return_astropy_table`` parameter for the kind of table returned. | |
Raises | |
------ | |
ConeSearchError | |
When invalid inputs are passed into Cone Search. | |
""" | |
n_timed_out = 0 | |
service_type = conf.conesearch_dbname | |
catalogs = vos_catalog._get_catalogs( | |
service_type, catalog_db, cache=cache, verbose=verbose) | |
if query_all: | |
result = {} | |
else: | |
result = None | |
for name, catalog in catalogs: | |
if isinstance(catalog, str): | |
if catalog.startswith('http'): | |
url = catalog | |
else: | |
remote_db = vos_catalog.get_remote_catalog_db( | |
service_type, cache=cache, verbose=verbose) | |
catalog = remote_db.get_catalog(catalog) | |
url = catalog['url'] | |
else: | |
url = catalog['url'] | |
if verbose: # pragma: no cover | |
color_print('Trying {0}'.format(url), 'green') | |
try: | |
> r = ConeSearch.query_region( | |
center, radius, verb=verb, cache=cache, verbose=verbose, | |
service_url=url, return_astropy_table=return_astropy_table, | |
use_names_over_ids=use_names_over_ids) | |
astroquery/vo_conesearch/conesearch.py:224: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <astroquery.vo_conesearch.core.ConeSearchClass object at 0x14c893850> | |
coordinates = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def query_region(self, coordinates, radius, *, verb=1, | |
get_query_payload=False, cache=True, verbose=False, | |
service_url=None, return_astropy_table=True, | |
use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
Parameters | |
---------- | |
coordinates : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If `~astropy.units.quantity.Quantity` is given, | |
it is internally converted to degrees. | |
verb : {1, 2, 3}, optional | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. | |
If the service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
get_query_payload : bool, optional | |
Just return the dict of HTTP request parameters. | |
cache : bool, optional | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
verbose : bool, optional | |
Verbose output, including VO table warnings. | |
service_url : str or `None` | |
URL for the Cone Search service. If not given, will use | |
``fallback_url`` from ``vo_conesearch`` configuration. | |
return_astropy_table : bool | |
Returned ``result`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
result : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
Table from successful VO service request. | |
See ``return_astropy_table`` option for the kind of table returned. | |
""" | |
request_payload = self._args_to_payload(coordinates, radius, verb) | |
if get_query_payload: | |
return request_payload | |
> url = _validate_url(service_url) | |
astroquery/vo_conesearch/core.py:145: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
url = 'https://astroconda.org/notreal' | |
def _validate_url(url): | |
"""Validate Cone Search service URL.""" | |
if url is None: | |
url = conf.fallback_url | |
# This is the standard expectation of a service URL | |
if not url.endswith(('?', '&')): | |
> raise InvalidAccessURL("URL should end with '?' or '&'") | |
E astroquery.vo_conesearch.exceptions.InvalidAccessURL: URL should end with '?' or '&' | |
astroquery/vo_conesearch/core.py:200: InvalidAccessURL | |
During handling of the above exception, another exception occurred: | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14cf4aaf0> | |
def test_async(self): | |
async_search = conesearch.AsyncConeSearch( | |
SCS_CENTER, SCS_RADIUS, return_astropy_table=False) | |
# Wait a little for the instance to set up properly | |
time.sleep(1) | |
> tab = async_search.get(timeout=data.conf.remote_timeout) | |
astroquery/vo_conesearch/tests/test_conesearch.py:166: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/vo_conesearch/vo_async.py:74: in get | |
result = self.future.result(timeout=timeout) | |
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/concurrent/futures/_base.py:433: in result | |
return self.__get_result() | |
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/concurrent/futures/_base.py:389: in __get_result | |
raise self._exception | |
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/concurrent/futures/thread.py:52: in run | |
result = self.fn(*self.args, **self.kwargs) | |
astroquery/vo_conesearch/conesearch.py:230: in conesearch | |
vo_warn(W25, (url, err_msg)) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W25("?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&'") | |
config = {'_warning_counts': {<class 'astropy.io.votable.exceptions.W25'>: 1}}, stacklevel = 2 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W25: ?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&' | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W25 | |
____________________________________________ TestConeSearch.test_async_all _____________________________________________ | |
center = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def conesearch(center, radius, *, verb=1, catalog_db=None, | |
verbose=True, cache=True, query_all=False, | |
return_astropy_table=True, use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.pedantic`` to control | |
pedantry. When `True`, will raise an error when the result | |
violates the spec, otherwise issue a warning. Warnings may | |
be controlled using :py:mod:`warnings` module. | |
.. note:: | |
Use ``astroquery.vo_conesearch.conf.timeout`` to control | |
timeout limit in seconds for each service being queried. | |
Parameters | |
---------- | |
center : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If astropy quantity is given, it is internally converted | |
to degrees. | |
verb : {1, 2, 3} | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. If the | |
service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
catalog_db | |
May be one of the following, in order from easiest to | |
use to most control: | |
- `None`: A database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs is | |
downloaded from ``astroquery.vo_conesearch.conf.vos_baseurl``. | |
The first catalog in the database to successfully return a | |
result is used. | |
- *catalog name*: A name in the database of | |
``astroquery.vo_conesearch.conf.conesearch_dbname`` catalogs at | |
``astroquery.vo_conesearch.conf.vos_baseurl`` is used. | |
For a list of acceptable names, use | |
:func:`astroquery.vo_conesearch.vos_catalog.list_catalogs`. | |
- *url*: The prefix of a URL to a IVOA Service for | |
``astroquery.vo_conesearch.conf.conesearch_dbname``. | |
Must end in either '?' or '&'. | |
- `~astroquery.vo_conesearch.vos_catalog.VOSCatalog` object: A | |
specific catalog manually downloaded and selected from the | |
database (see :ref:`vo-sec-client-vos`). | |
- Any of the above 3 options combined in a list, in which case | |
they are tried in order. | |
verbose : bool | |
Verbose output. | |
cache : bool | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
query_all : bool | |
This is used by :func:`search_all`. | |
return_astropy_table : bool | |
Returned ``obj`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
obj : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
First table from first successful VO service request. | |
See ``return_astropy_table`` parameter for the kind of table returned. | |
Raises | |
------ | |
ConeSearchError | |
When invalid inputs are passed into Cone Search. | |
""" | |
n_timed_out = 0 | |
service_type = conf.conesearch_dbname | |
catalogs = vos_catalog._get_catalogs( | |
service_type, catalog_db, cache=cache, verbose=verbose) | |
if query_all: | |
result = {} | |
else: | |
result = None | |
for name, catalog in catalogs: | |
if isinstance(catalog, str): | |
if catalog.startswith('http'): | |
url = catalog | |
else: | |
remote_db = vos_catalog.get_remote_catalog_db( | |
service_type, cache=cache, verbose=verbose) | |
catalog = remote_db.get_catalog(catalog) | |
url = catalog['url'] | |
else: | |
url = catalog['url'] | |
if verbose: # pragma: no cover | |
color_print('Trying {0}'.format(url), 'green') | |
try: | |
> r = ConeSearch.query_region( | |
center, radius, verb=verb, cache=cache, verbose=verbose, | |
service_url=url, return_astropy_table=return_astropy_table, | |
use_names_over_ids=use_names_over_ids) | |
astroquery/vo_conesearch/conesearch.py:224: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <astroquery.vo_conesearch.core.ConeSearchClass object at 0x14c893850> | |
coordinates = <ICRS Coordinate: (ra, dec) in deg | |
(0., 0.)>, radius = <Quantity 0.1 deg> | |
def query_region(self, coordinates, radius, *, verb=1, | |
get_query_payload=False, cache=True, verbose=False, | |
service_url=None, return_astropy_table=True, | |
use_names_over_ids=False): | |
""" | |
Perform Cone Search and returns the result of the | |
first successful query. | |
Parameters | |
---------- | |
coordinates : str, `astropy.coordinates` object, list, or tuple | |
Position of the center of the cone to search. | |
It may be specified as an object from the | |
:ref:`astropy:astropy-coordinates` package, | |
string as accepted by | |
:func:`~astroquery.utils.parse_coordinates`, or tuple/list. | |
If given as tuple or list, it is assumed to be ``(RA, DEC)`` | |
in the ICRS coordinate frame, given in decimal degrees. | |
radius : float or `~astropy.units.quantity.Quantity` | |
Radius of the cone to search: | |
- If float is given, it is assumed to be in decimal degrees. | |
- If `~astropy.units.quantity.Quantity` is given, | |
it is internally converted to degrees. | |
verb : {1, 2, 3}, optional | |
Verbosity indicating how many columns are to be returned | |
in the resulting table. Support for this parameter by | |
a Cone Search service implementation is optional. | |
If the service supports the parameter: | |
1. Return the bare minimum number of columns that | |
the provider considers useful in describing the | |
returned objects. | |
2. Return a medium number of columns between the | |
minimum and maximum (inclusive) that are | |
considered by the provider to most typically | |
useful to the user. | |
3. Return all of the columns that are available for | |
describing the objects. | |
If not supported, the service should ignore the parameter | |
and always return the same columns for every request. | |
get_query_payload : bool, optional | |
Just return the dict of HTTP request parameters. | |
cache : bool, optional | |
Use caching for VO Service database. Access to actual VO | |
websites referenced by the database still needs internet | |
connection. | |
verbose : bool, optional | |
Verbose output, including VO table warnings. | |
service_url : str or `None` | |
URL for the Cone Search service. If not given, will use | |
``fallback_url`` from ``vo_conesearch`` configuration. | |
return_astropy_table : bool | |
Returned ``result`` will be `astropy.table.Table` rather | |
than `astropy.io.votable.tree.Table`. | |
use_names_over_ids : bool | |
When `True` use the ``name`` attributes of columns as the names | |
of columns in the `~astropy.table.Table` instance. Since names | |
are not guaranteed to be unique, this may cause some columns | |
to be renamed by appending numbers to the end. Otherwise | |
(default), use the ID attributes as the column names. | |
Returns | |
------- | |
result : `astropy.table.Table` or `astropy.io.votable.tree.Table` | |
Table from successful VO service request. | |
See ``return_astropy_table`` option for the kind of table returned. | |
""" | |
request_payload = self._args_to_payload(coordinates, radius, verb) | |
if get_query_payload: | |
return request_payload | |
> url = _validate_url(service_url) | |
astroquery/vo_conesearch/core.py:145: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
url = 'https://astroconda.org/notreal' | |
def _validate_url(url): | |
"""Validate Cone Search service URL.""" | |
if url is None: | |
url = conf.fallback_url | |
# This is the standard expectation of a service URL | |
if not url.endswith(('?', '&')): | |
> raise InvalidAccessURL("URL should end with '?' or '&'") | |
E astroquery.vo_conesearch.exceptions.InvalidAccessURL: URL should end with '?' or '&' | |
astroquery/vo_conesearch/core.py:200: InvalidAccessURL | |
During handling of the above exception, another exception occurred: | |
self = <astroquery.vo_conesearch.tests.test_conesearch.TestConeSearch object at 0x14d350d00> | |
def test_async_all(self): | |
async_search_all = conesearch.AsyncSearchAll( | |
SCS_CENTER, SCS_RADIUS, return_astropy_table=False) | |
# Wait a little for the instance to set up properly | |
time.sleep(1) | |
> all_results = async_search_all.get( | |
timeout=data.conf.remote_timeout * 3) | |
astroquery/vo_conesearch/tests/test_conesearch.py:182: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/vo_conesearch/vo_async.py:74: in get | |
result = self.future.result(timeout=timeout) | |
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/concurrent/futures/_base.py:433: in result | |
return self.__get_result() | |
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/concurrent/futures/_base.py:389: in __get_result | |
raise self._exception | |
/Users/bsipocz/.pyenv/versions/3.9.1/lib/python3.9/concurrent/futures/thread.py:52: in run | |
result = self.fn(*self.args, **self.kwargs) | |
astroquery/vo_conesearch/conesearch.py:327: in search_all | |
return conesearch(*args, **kwargs) | |
astroquery/vo_conesearch/conesearch.py:230: in conesearch | |
vo_warn(W25, (url, err_msg)) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W25("?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&'") | |
config = {'_warning_counts': {<class 'astropy.io.votable.exceptions.W25'>: 1}}, stacklevel = 2 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W25: ?:?:?: W25: 'https://astroconda.org/notreal' failed with: URL should end with '?' or '&' | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W25 | |
________________________________________________ test_db_from_registry _________________________________________________ | |
self = <astropy.io.votable.converters.Char object at 0x14d3e3310> | |
value = 'Band merged JHKs catalogue for first epoch data from CASU v1.3. VVV DR1, corrected for header errors (Mike Irwin, Pri... of the Milky Way bulge and southern plane from the near-infrared ESO public survey VISTA variables in the Vía Láctea.' | |
config = {'_current_table_number': 1, '_warning_counts': {<class 'astropy.io.votable.exceptions.W55'>: 1}, 'chunk_size': 256, 'columns': None, ...} | |
pos = (1, 5174) | |
def parse(self, value, config=None, pos=None): | |
if self.arraysize != '*' and len(value) > self.arraysize: | |
vo_warn(W46, ('char', self.arraysize), config, pos) | |
# Warn about non-ascii characters if warnings are enabled. | |
try: | |
> value.encode('ascii') | |
E UnicodeEncodeError: 'ascii' codec can't encode character '\xed' in position 253: ordinal not in range(128) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/converters.py:336: UnicodeEncodeError | |
During handling of the above exception, another exception occurred: | |
@pytest.mark.remote_data | |
def test_db_from_registry(): | |
"""Test database created from VO registry. | |
.. note:: | |
We have no control of the remote registry. | |
This test just makes sure it does not crash, | |
but does not check for quality of data. | |
""" | |
> db = VOSDatabase.from_registry(validator_conf.conesearch_master_list, | |
encoding='binary', show_progress=False) | |
astroquery/vo_conesearch/tests/test_vos_catalog.py:201: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/vo_conesearch/vos_catalog.py:569: in from_registry | |
tab_all = parse_single_table(fd, pedantic=False) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/table.py:185: in parse_single_table | |
votable = parse(source, **kwargs) | |
/Users/bsipocz/munka/devel/astropy/astropy/utils/decorators.py:536: in wrapper | |
return function(*args, **kwargs) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/table.py:166: in parse | |
return tree.VOTableFile( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:3616: in parse | |
tag_mapping.get(tag, self._add_unknown_tag)( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:3495: in _add_resource | |
resource.parse(self, iterator, config) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:3293: in parse | |
tag_mapping.get(tag, self._add_unknown_tag)( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:3239: in _add_table | |
table.parse(iterator, config) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:2514: in parse | |
self.array = self._parse_tabledata( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:2630: in _parse_tabledata | |
vo_reraise(e, config, pos) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:130: in vo_reraise | |
raise exc | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:2623: in _parse_tabledata | |
vo_reraise( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:130: in vo_reraise | |
raise exc | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:2620: in _parse_tabledata | |
value, mask_value = parsers[i]( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/converters.py:338: in parse | |
vo_warn(W55, (self.field_name, value), config, pos) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W55('None:1:5174: W55: FIELD (res_description) has datatype="char" but contains non-ASCII value (Band merged JHKs cata...f the Milky Way bulge and southern plane from the near-infrared ESO public survey VISTA variables in the Vía Láctea.)') | |
config = {'_current_table_number': 1, '_warning_counts': {<class 'astropy.io.votable.exceptions.W55'>: 1}, 'chunk_size': 256, 'columns': None, ...} | |
stacklevel = 2 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W55: None:1:5174: W55: FIELD (res_description) has datatype="char" but contains non-ASCII value (Band merged JHKs catalogue for first epoch data from CASU v1.3. VVV DR1, corrected for header errors (Mike Irwin, Private Communication). Release of the Milky Way bulge and southern plane from the near-infrared ESO public survey VISTA variables in the Vía Láctea.) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W55 | |
___________________________________ TestConeSearchValidation.test_validation[False] ____________________________________ | |
self = <astroquery.vo_conesearch.validator.tests.test_validate.TestConeSearchValidation object at 0x14d229d60> | |
parallel = False | |
@pytest.mark.parametrize(('parallel'), [True, False]) | |
def test_validation(self, parallel): | |
if os.path.exists(self.out_dir): | |
shutil.rmtree(self.out_dir) | |
> validate.check_conesearch_sites( | |
destdir=self.out_dir, parallel=parallel, url_list=None) | |
astroquery/vo_conesearch/validator/tests/test_validate.py:59: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/utils/timer.py:71: in wrapper | |
result = function(*args, **kwargs) | |
astroquery/vo_conesearch/validator/validate.py:235: in check_conesearch_sites | |
for r in mp_list: | |
astroquery/vo_conesearch/validator/validate.py:280: in _do_validation | |
r.validate_vo() | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/validator/result.py:166: in validate_vo | |
t = table.parse(input, verify='warn', filename=path) | |
/Users/bsipocz/munka/devel/astropy/astropy/utils/decorators.py:536: in wrapper | |
return function(*args, **kwargs) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/table.py:166: in parse | |
return tree.VOTableFile( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:3616: in parse | |
tag_mapping.get(tag, self._add_unknown_tag)( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:426: in _add_definitions | |
warn_or_raise(W22, W22, (), config, pos) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:103: in warn_or_raise | |
vo_warn(warning_class, args, config, pos, stacklevel=stacklevel+1) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W22('/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/pytest-of-bsipocz/pytest-1/test_validation_False_0/data/.../00/fe/8587b192a40a2bd42cbe133ae687/vo.xml:15:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring') | |
config = {'_current_table_number': 0, '_warning_counts': {<class 'astropy.io.votable.exceptions.W22'>: 1}, 'chunk_size': 256, 'columns': None, ...} | |
stacklevel = 3 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W22: /private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/pytest-of-bsipocz/pytest-1/test_validation_False_0/data/results/00/fe/8587b192a40a2bd42cbe133ae687/vo.xml:15:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W22 | |
____________________________________ TestConeSearchValidation.test_url_list[False] _____________________________________ | |
self = <astroquery.vo_conesearch.validator.tests.test_validate.TestConeSearchValidation object at 0x14d3e3d00> | |
parallel = False | |
@pytest.mark.parametrize(('parallel'), [True, False]) | |
def test_url_list(self, parallel): | |
local_outdir = os.path.join(self.out_dir, 'subtmp1') | |
local_list = [ | |
'http://www.google.com/foo&', | |
'http://vizier.unistra.fr/viz-bin/conesearch/I/252/out?'] | |
> validate.check_conesearch_sites(destdir=local_outdir, | |
parallel=parallel, | |
url_list=local_list) | |
astroquery/vo_conesearch/validator/tests/test_validate.py:73: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
astroquery/utils/timer.py:71: in wrapper | |
result = function(*args, **kwargs) | |
astroquery/vo_conesearch/validator/validate.py:235: in check_conesearch_sites | |
for r in mp_list: | |
astroquery/vo_conesearch/validator/validate.py:280: in _do_validation | |
r.validate_vo() | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/validator/result.py:166: in validate_vo | |
t = table.parse(input, verify='warn', filename=path) | |
/Users/bsipocz/munka/devel/astropy/astropy/utils/decorators.py:536: in wrapper | |
return function(*args, **kwargs) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/table.py:166: in parse | |
return tree.VOTableFile( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:3616: in parse | |
tag_mapping.get(tag, self._add_unknown_tag)( | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/tree.py:426: in _add_definitions | |
warn_or_raise(W22, W22, (), config, pos) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:103: in warn_or_raise | |
vo_warn(warning_class, args, config, pos, stacklevel=stacklevel+1) | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:144: in vo_warn | |
_suppressed_warning(warning, config, stacklevel=stacklevel+1) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
warning = W22('/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/pytest-of-bsipocz/pytest-1/test_url_list_False_0/data/su.../00/fe/8587b192a40a2bd42cbe133ae687/vo.xml:15:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring') | |
config = {'_current_table_number': 0, '_warning_counts': {<class 'astropy.io.votable.exceptions.W22'>: 1}, 'chunk_size': 256, 'columns': None, ...} | |
stacklevel = 3 | |
def _suppressed_warning(warning, config, stacklevel=2): | |
warning_class = type(warning) | |
config.setdefault('_warning_counts', dict()).setdefault(warning_class, 0) | |
config['_warning_counts'][warning_class] += 1 | |
message_count = config['_warning_counts'][warning_class] | |
if message_count <= conf.max_warnings: | |
if message_count == conf.max_warnings: | |
warning.formatted_message += \ | |
' (suppressing further warnings of this type...)' | |
> warn(warning, stacklevel=stacklevel+1) | |
E astropy.io.votable.exceptions.W22: /private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/pytest-of-bsipocz/pytest-1/test_url_list_False_0/data/subtmp1/results/00/fe/8587b192a40a2bd42cbe133ae687/vo.xml:15:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring | |
/Users/bsipocz/munka/devel/astropy/astropy/io/votable/exceptions.py:84: W22 | |
------------------------------------------------- Captured stdout call ------------------------------------------------- | |
INFO: Only 2/1 site(s) are validated [astroquery.vo_conesearch.validator.validate] | |
-------------------------------------------------- Captured log call --------------------------------------------------- | |
INFO astroquery:validate.py:144 Only 2/1 site(s) are validated | |
=============================================== short test summary info ================================================ | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_one_search_classic[center0-0.1] - astr... | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_one_search_classic[center1-radius1] - ... | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_timeout_classic - Failed: DID NOT WARN... | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_searches_classic - AssertionError: ass... | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_search_all[center0-0.1] - astropy.io.v... | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_search_all[center1-radius1] - astropy.... | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_async - astropy.io.votable.exceptions.... | |
FAILED astroquery/vo_conesearch/tests/test_conesearch.py::TestConeSearch::test_async_all - astropy.io.votable.excepti... | |
FAILED astroquery/vo_conesearch/tests/test_vos_catalog.py::test_db_from_registry - astropy.io.votable.exceptions.W55:... | |
FAILED astroquery/vo_conesearch/validator/tests/test_validate.py::TestConeSearchValidation::test_validation[False] - ... | |
FAILED astroquery/vo_conesearch/validator/tests/test_validate.py::TestConeSearchValidation::test_url_list[False] - as... | |
============================ 11 failed, 36 passed, 3 skipped, 1 xfailed in 96.33s (0:01:36) ============================ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment