Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: fixing various minor issues picked up in the remote tests #3051

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions astroquery/vo_conesearch/tests/test_conesearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from astropy import units as u
from astropy.coordinates import ICRS, SkyCoord
from astropy.io.votable.exceptions import W25
from astropy.io.votable.tree import Table as VOTable
from astropy.table import Table
from astropy.utils.data import get_pkg_data_filename
from astropy.utils import data
Expand All @@ -24,6 +23,14 @@
from ..exceptions import VOSError, ConeSearchError
from ...exceptions import NoResultsWarning


try:
# Workaround astropy deprecation, remove try/except once >=6.0 is required
from astropy.io.votable.tree import TableElement as VOTable
except ImportError:
from astropy.io.votable.tree import Table as VOTable


__doctest_skip__ = ['*']


Expand Down Expand Up @@ -117,10 +124,11 @@ def test_sky_coord_classic(self):
def test_timeout_classic(self):
"""Test timed out query."""
with pytest.warns(W25, 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)
with pytest.warns(NoResultsWarning):
with conf.set_temp('timeout', 1e-6):
result = conesearch.conesearch(
SCS_CENTER, SCS_RADIUS, cache=False,
verbose=self.verbose, catalog_db=self.url)
assert result is None

def test_searches_classic(self):
Expand Down
4 changes: 1 addition & 3 deletions docs/cadc/cadc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ these collections:
>>> from astroquery.cadc import Cadc
>>> cadc = Cadc()
>>> for collection, details in sorted(cadc.get_collections().items()):
... print(f'{collection} : {details}')
... print(f'{collection} : {details}') # doctest: +IGNORE_OUTPUT
...
APASS : {'Description': 'The APASS collection at the CADC', 'Bands': ['Optical', 'Infrared|Optical', '']}
BLAST : {'Description': 'The BLAST collection at the CADC', 'Bands': ['', 'Millimeter']}
Expand Down Expand Up @@ -313,8 +313,6 @@ To get a list of table objects:
caom2.HarvestState
caom2.SIAv1
ivoa.ObsCore
ivoa.ObsFile
ivoa.ObsPart
tap_schema.schemas
tap_schema.tables
tap_schema.columns
Expand Down
6 changes: 3 additions & 3 deletions docs/esa/iso/iso.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ provided by this service, see section 'Getting Tables Details'.
>>> from astroquery.esa.iso import ISO
>>> import tarfile
>>>
>>> ISO.download_data('80000203', retrieval_type="OBSERVATION",
>>> ISO.download_data("80000203", retrieval_type="OBSERVATION",
... product_level="DEFAULT_DATA_SET",
... filename="80000203", verbose=True)
INFO: https://nida.esac.esa.int/nida-sl-tap/data?retrieval_type=OBSERVATION&DATA_RETRIEVAL_ORIGIN=astroquery&tdt=80000203&product_level=DEFAULT_DATA_SET [astroquery.esa.iso.core]
Expand All @@ -102,7 +102,7 @@ provided by this service, see section 'Getting Tables Details'.
-rw-r--r-- idaops/0 14400 2005-12-23 11:02:55 ././ISO1659972236/EXTRAKON//psph80000203.fits
-rw-r--r-- idaops/0 5599 2005-12-23 11:02:55 ././ISO1659972236/EXTRAKON//ppch80000203.gif
-rw-r--r-- idaops/0 266240 2005-12-23 11:02:54 ././ISO1659972236/EXTRAKON//C10180000203.tar
>>> tar.extractall()
>>> tar.extractall(filter="fully_trusted")
>>> tar.close()

'download_data' method invokes the data download of files from the ISO Data Archive, using the
Expand Down Expand Up @@ -409,7 +409,7 @@ If you are repeatedly getting failed queries, or bad/out-of-date results, try cl
>>> from astroquery.esa.iso import ISO
>>> ISO.clear_cache()

If this function is unavailable, upgrade your version of astroquery.
If this function is unavailable, upgrade your version of astroquery.
The ``clear_cache`` function was introduced in version 0.4.7.dev8479.


Expand Down
6 changes: 3 additions & 3 deletions docs/esa/xmm_newton/xmm_newton.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ stored in the file 'results10.csv'. The result of this query can be printed by d
INFO: Retrieving tables... [astroquery.utils.tap.core]
INFO: Parsing tables... [astroquery.utils.tap.core]
INFO: Done. [astroquery.utils.tap.core]
['tap_config.coord_sys', 'tap_config.properties', 'tap_schema.columns',
['public.dual', 'tap_config.coord_sys', 'tap_config.properties', 'tap_schema.columns',
'tap_schema.key_columns', 'tap_schema.keys', 'tap_schema.schemas',
'tap_schema.tables', 'xsa.dual', 'xsa.v_all_observations', 'xsa.v_epic_source',
'tap_schema.tables', 'xsa.v_all_observations', 'xsa.v_epic_source',
'xsa.v_epic_source_cat', 'xsa.v_epic_xmm_stack_cat', 'xsa.v_exposure',
'xsa.v_instrument_mode', 'xsa.v_om_source', 'xsa.v_om_source_cat',
'xsa.v_proposal', 'xsa.v_proposal_observation_info', 'xsa.v_publication',
Expand Down Expand Up @@ -205,7 +205,7 @@ If you are repeatedly getting failed queries, or bad/out-of-date results, try cl
>>> from astroquery.esa.xmm_newton import XMMNewton
>>> XMMNewton.clear_cache()

If this function is unavailable, upgrade your version of astroquery.
If this function is unavailable, upgrade your version of astroquery.
The ``clear_cache`` function was introduced in version 0.4.7.dev8479.


Expand Down
48 changes: 25 additions & 23 deletions docs/gaia/gaia.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ degrees around an specific point in RA/Dec coordinates. The results are sorted b
>>> r = Gaia.query_object_async(coordinate=coord, width=width, height=height)
INFO: Query finished. [astroquery.utils.tap.core]
>>> r.pprint(max_lines=12, max_width=130)
dist solution_id DESIGNATION ... ebpminrp_gspphot_upper libname_gspphot
dist solution_id designation ... ebpminrp_gspphot_upper libname_gspphot
... mag
--------------------- ------------------- ---------------------------- ... ---------------------- ---------------
0.0026043272506261527 1636148068921376768 Gaia DR3 6636090334814214528 ... --
Expand All @@ -126,7 +126,7 @@ Queries return a limited number of rows controlled by ``Gaia.ROW_LIMIT``. To cha
>>> r = Gaia.query_object_async(coordinate=coord, width=width, height=height)
INFO: Query finished. [astroquery.utils.tap.core]
>>> r.pprint(max_width=140)
dist solution_id DESIGNATION ... ebpminrp_gspphot_lower ebpminrp_gspphot_upper libname_gspphot
dist solution_id designation ... ebpminrp_gspphot_lower ebpminrp_gspphot_upper libname_gspphot
... mag mag
--------------------- ------------------- ---------------------------- ... ---------------------- ---------------------- ---------------
0.0026043272506261527 1636148068921376768 Gaia DR3 6636090334814214528 ... -- --
Expand All @@ -146,7 +146,7 @@ To return an unlimited number of rows set ``Gaia.ROW_LIMIT`` to -1.
>>> r = Gaia.query_object_async(coordinate=coord, width=width, height=height)
INFO: Query finished. [astroquery.utils.tap.core]
>>> r.pprint(max_lines=12, max_width=140)
dist solution_id DESIGNATION ... ebpminrp_gspphot_lower ebpminrp_gspphot_upper libname_gspphot
dist solution_id designation ... ebpminrp_gspphot_lower ebpminrp_gspphot_upper libname_gspphot
... mag mag
--------------------- ------------------- ---------------------------- ... ---------------------- ---------------------- ---------------
0.0026043272506261527 1636148068921376768 Gaia DR3 6636090334814214528 ... -- --
Expand Down Expand Up @@ -176,7 +176,7 @@ radius argument.
INFO: Query finished. [astroquery.utils.tap.core]
>>> r = j.get_results()
>>> r.pprint()
solution_id DESIGNATION ... dist
solution_id designation ... dist
...
------------------- ---------------------------- ... ---------------------
1636148068921376768 Gaia DR3 6636090334814214528 ... 0.0026043272506261527
Expand Down Expand Up @@ -207,15 +207,15 @@ To load only table names metadata (TAP+ capability):
INFO: Done. [astroquery.utils.tap.core]
>>> for table in tables:
... print(table.get_qualified_name())
external.external.apassdr9
external.external.catwise2020
external.external.gaiadr2_astrophysical_parameters
external.external.gaiadr2_geometric_distance
external.external.gaiaedr3_distance
external.apassdr9
external.catwise2020
external.gaiadr2_astrophysical_parameters
external.gaiadr2_geometric_distance
external.gaiaedr3_distance
...
tap_schema.tap_schema.keys
tap_schema.tap_schema.schemas
tap_schema.tap_schema.tables
tap_schema.keys
tap_schema.schemas
tap_schema.tables

To load all tables metadata (TAP compatible):

Expand All @@ -227,11 +227,12 @@ To load all tables metadata (TAP compatible):
INFO: Parsing tables... [astroquery.utils.tap.core]
INFO: Done. [astroquery.utils.tap.core]
>>> print(tables[0])
TAP Table name: external.external.apassdr9
TAP Table name: external.apassdr9
Description: The AAVSO Photometric All-Sky Survey - Data Release 9
This publication makes use of data products from the AAVSO
Photometric All Sky Survey (APASS). Funded by the Robert Martin Ayers
Sciences Fund and the National Science Foundation. Original catalogue released by Henden et al. 2015 AAS Meeting #225, id.336.16. Data retrieved using the VizieR catalogue access tool, CDS, Strasbourg, France. The original description of the VizieR service was published in A&AS 143, 23. VizieR catalogue II/336.
Size (bytes): 22474547200
Num. columns: 25


Expand All @@ -242,8 +243,9 @@ To load only a table (TAP+ capability):
>>> from astroquery.gaia import Gaia
>>> gaiadr3_table = Gaia.load_table('gaiadr3.gaia_source')
>>> print(gaiadr3_table)
TAP Table name: gaiadr3.gaiadr3.gaia_source
TAP Table name: gaiadr3.gaia_source
Description: This table has an entry for every Gaia observed source as published with this data release. It contains the basic source parameters, in their final state as processed by the Gaia Data Processing and Analysis Consortium from the raw data coming from the spacecraft. The table is complemented with others containing information specific to certain kinds of objects (e.g.~Solar--system objects, non--single stars, variables etc.) and value--added processing (e.g.~astrophysical parameters etc.). Further array data types (spectra, epoch measurements) are presented separately via Datalink resources.
Size (bytes): 3646930329600
Num. columns: 152


Expand Down Expand Up @@ -411,7 +413,7 @@ Query without saving results in a file:
INFO: Query finished. [astroquery.utils.tap.core]
>>> r = job.get_results()
>>> print(r)
DESIGNATION ra dec
designation ra dec
deg deg
---------------------- ------------------ --------------------
Gaia DR3 4295806720 44.99615537864534 0.005615226341865997
Expand Down Expand Up @@ -524,15 +526,15 @@ To obtain a list of the tables shared to a user type the following::
INFO: Done. [astroquery.utils.tap.core]
>>> for table in (tables):
... print(table.get_qualified_name())
external.external.apassdr9
external.external.gaiadr2_astrophysical_parameters
external.external.gaiadr2_geometric_distance
external.external.gaiaedr3_distance
external.apassdr9
external.gaiadr2_astrophysical_parameters
external.gaiadr2_geometric_distance
external.gaiaedr3_distance
... ... ...
tap_schema.tap_schema.key_columns
tap_schema.tap_schema.keys
tap_schema.tap_schema.schemas
tap_schema.tap_schema.tables
tap_schema.key_columns
tap_schema.keys
tap_schema.schemas
tap_schema.tables

2.3. Uploading table to user space
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Loading