Skip to content

Commit 7383528

Browse files
committed
maint: UCD cleanup upstream in SIMBAD
1 parent 1d76138 commit 7383528

File tree

3 files changed

+54
-52
lines changed

3 files changed

+54
-52
lines changed

astroquery/simbad/core.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,18 @@ def list_votable_fields(self):
242242
>>> options = Simbad.list_votable_fields() # doctest: +REMOTE_DATA
243243
>>> # to print only the available bundles of columns
244244
>>> options[options["type"] == "bundle of basic columns"][["name", "description"]] # doctest: +REMOTE_DATA
245-
<Table length=9>
246-
name description
247-
object object
248-
------------- -------------------------------------------------------
249-
coordinates all fields related with coordinates
250-
dim major and minor axis, angle and inclination
251-
dimensions all fields related to object dimensions
252-
morphtype all fields related to the morphological type
253-
parallax all fields related to parallaxes
254-
propermotions all fields related with the proper motions
255-
sp all fields related with the spectral type
256-
velocity all fields related with radial velocity and redshift
245+
<Table length=8>
246+
name description
247+
object object
248+
------------- ----------------------------------------------------
249+
coordinates all fields related with coordinates
250+
dim major and minor axis, angle and inclination
251+
dimensions all fields related to object dimensions
252+
morphtype all fields related to the morphological type
253+
parallax all fields related to parallaxes
254+
propermotions all fields related with the proper motions
255+
sp all fields related with the spectral type
256+
velocity all fields related with radial velocity and redshift
257257
"""
258258
# get the tables with a simple link to basic
259259
query_tables = """SELECT DISTINCT table_name AS name, tables.description
@@ -1276,37 +1276,37 @@ def list_columns(self, *tables: str, keyword=None, get_query_payload=False):
12761276
>>> from astroquery.simbad import Simbad
12771277
>>> Simbad.list_columns("ids", "ident") # doctest: +REMOTE_DATA
12781278
<Table length=4>
1279-
table_name column_name datatype ... unit ucd
1280-
object object object ... object object
1281-
---------- ----------- -------- ... ------ -------
1282-
ident id VARCHAR ... meta.id
1283-
ident oidref BIGINT ...
1284-
ids ids VARCHAR ... meta.id
1285-
ids oidref BIGINT ...
1279+
table_name column_name datatype ... unit ucd
1280+
object object object ... object object
1281+
---------- ----------- -------- ... ------ -----------
1282+
ident id VARCHAR ... meta.id
1283+
ident oidref BIGINT ... meta.record
1284+
ids ids VARCHAR ... meta.id
1285+
ids oidref BIGINT ... meta.record
12861286
12871287
12881288
>>> from astroquery.simbad import Simbad
12891289
>>> Simbad.list_columns(keyword="filter") # doctest: +REMOTE_DATA
12901290
<Table length=5>
1291-
table_name column_name datatype ... unit ucd
1292-
object object object ... object object
1293-
----------- ----------- ----------- ... ------ ----------------------
1294-
filter description UNICODECHAR ... meta.note;instr.filter
1295-
filter filtername VARCHAR ... instr.filter
1296-
filter unit VARCHAR ... meta.unit
1297-
flux filter VARCHAR ... instr.filter
1298-
mesDiameter filter CHAR ... instr.filter
1291+
table_name column_name datatype ... unit ucd
1292+
object object object ... object object
1293+
----------- ----------- ----------- ... ------ ---------------------------
1294+
filter description UNICODECHAR ... meta.note;instr.filter
1295+
filter filtername VARCHAR ... instr.bandpass;instr.filter
1296+
filter unit VARCHAR ... meta.unit
1297+
flux filter VARCHAR ... instr.bandpass;instr.filter
1298+
mesDiameter filter CHAR ... instr.bandpass;instr.filter
12991299
13001300
>>> from astroquery.simbad import Simbad
13011301
>>> Simbad.list_columns("basic", keyword="object") # doctest: +REMOTE_DATA
13021302
<Table length=4>
1303-
table_name column_name datatype ... unit ucd
1304-
object object object ... object object
1305-
---------- ----------- -------- ... ------ -------------------
1306-
basic main_id VARCHAR ... meta.id;meta.main
1307-
basic otype_txt VARCHAR ... src.class
1308-
basic oid BIGINT ... meta.record;meta.id
1309-
basic otype VARCHAR ... src.class
1303+
table_name column_name datatype ... unit ucd
1304+
object object object ... object object
1305+
---------- ----------- -------- ... ------ -----------------
1306+
basic main_id VARCHAR ... meta.id;meta.main
1307+
basic otype_txt VARCHAR ... src.class
1308+
basic oid BIGINT ... meta.record
1309+
basic otype VARCHAR ... src.class
13101310
"""
13111311
query = ("SELECT table_name, column_name, datatype, description, unit, ucd"
13121312
" FROM TAP_SCHEMA.columns"

astroquery/simbad/tests/test_simbad.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,16 @@ def test_query_tap_errors():
563563
@pytest.mark.usefixtures("_mock_simbad_class")
564564
def test_query_tap_cache_call(monkeypatch):
565565
msg = "called_cached_query_tap"
566-
monkeypatch.setattr(simbad.core, "_cached_query_tap", lambda tap, query, maxrec: msg)
566+
monkeypatch.setattr(simbad.core, "_cached_query_tap",
567+
lambda tap, query, maxrec, async_job: msg)
567568
assert simbad.Simbad.query_tap("select top 1 * from basic") == msg
568569

569570

570571
@pytest.mark.usefixtures("_mock_simbad_class")
571572
def test_empty_response_warns(monkeypatch):
572573
# return something of length zero
573-
monkeypatch.setattr(simbad.core.Simbad, "query_tap", lambda _, get_query_payload, maxrec: [])
574+
monkeypatch.setattr(simbad.core.Simbad, "query_tap",
575+
lambda _, get_query_payload, maxrec, async_job: [])
574576
msg = ("The request executed correctly, but there was no data corresponding to these"
575577
" criteria in SIMBAD")
576578
with pytest.warns(NoResultsWarning, match=msg):

docs/simbad/query_tap.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,22 @@ some tables, add their name. To get the columns of the tables ``ref`` and ``bibl
139139
>>> from astroquery.simbad import Simbad
140140
>>> Simbad.list_columns("ref", "biblio")
141141
<Table length=13>
142-
table_name column_name datatype ... unit ucd
143-
object object object ... object object
144-
---------- ----------- ----------- ... ------ --------------------
145-
biblio biblio VARCHAR ... meta.record;meta.bib
146-
biblio oidref BIGINT ... meta.record;meta.id
147-
ref "year" SMALLINT ... meta.note;meta.bib
148-
ref abstract UNICODECHAR ... meta.record
149-
ref bibcode CHAR ... meta.bib.bibcode
150-
ref doi VARCHAR ... meta.code;meta.bib
151-
ref journal VARCHAR ... meta.bib.journal
152-
ref last_page INTEGER ... meta.bib.page
153-
ref nbobject INTEGER ... meta.number
154-
ref oidbib BIGINT ... meta.record;meta.bib
155-
ref page INTEGER ... meta.bib.page
156-
ref title UNICODECHAR ... meta.title
157-
ref volume INTEGER ... meta.bib.volume
142+
table_name column_name datatype ... unit ucd
143+
object object object ... object object
144+
---------- ----------- ----------- ... ------ -----------------
145+
biblio biblio VARCHAR ... meta.bib.bibcode
146+
biblio oidref BIGINT ... meta.record
147+
ref "year" SMALLINT ... time.publiYear
148+
ref abstract UNICODECHAR ... meta.record
149+
ref bibcode CHAR ... meta.bib.bibcode
150+
ref doi VARCHAR ... meta.ref.doi
151+
ref journal VARCHAR ... meta.bib.journal
152+
ref last_page INTEGER ... meta.bib.page
153+
ref nbobject INTEGER ... meta.id;arith.sum
154+
ref oidbib BIGINT ... meta.record
155+
ref page INTEGER ... meta.bib.page
156+
ref title UNICODECHAR ... meta.title
157+
ref volume INTEGER ... meta.bib.volume
158158

159159
`~astroquery.simbad.SimbadClass.list_columns` can also be called with a keyword argument.
160160
This returns columns from any table for witch the given keyword is either in the table name,

0 commit comments

Comments
 (0)