Skip to content

Commit 1c03261

Browse files
committed
test: fix non-deterministic order in tests
1 parent 187c39f commit 1c03261

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

docs/vizier/vizier.rst

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ Table Discover
2020
If you want to search for a set of tables, e.g. based on author name or other keywords,
2121
the :meth:`~astroquery.vizier.VizierClass.find_catalogs` tool can be used:
2222

23+
.. order is not deterministic
2324
.. doctest-remote-data::
2425

2526
>>> from astroquery.vizier import Vizier
26-
>>> catalog_list = Vizier.find_catalogs('hot jupiter exoplanet transit')
27-
>>> for k, v in catalog_list.items():
27+
>>> catalog_list = Vizier().find_catalogs('hot jupiter exoplanet transit')
28+
>>> for k, v in catalog_list.items(): # doctest: +IGNORE_OUTPUT
2829
... print(k, ":", v.description)
2930
J/A+A/635/A205 : Ultra-hot Jupiter WASP-121b transits (Bourrier+, 2020)
3031
J/ApJ/788/39 : Hot Jupiter exoplanets host stars EW and abundances (Teske+, 2014)
@@ -45,7 +46,7 @@ the complete contents of those catalogs:
4546
.. doctest-remote-data::
4647

4748
>>> catalogs = Vizier.get_catalogs(catalog_list.keys())
48-
>>> print(catalogs)
49+
>>> print(catalogs) # doctest: +IGNORE_OUTPUT
4950
TableList with 10 tables:
5051
'0:J/A+A/635/A205/20140119' with 7 column(s) and 50 row(s)
5152
'1:J/A+A/635/A205/20140123' with 7 column(s) and 50 row(s)
@@ -65,7 +66,7 @@ way:
6566
.. doctest-remote-data::
6667

6768
>>> catalogs = Vizier.get_catalogs(catalog_list.values())
68-
>>> print(catalogs)
69+
>>> print(catalogs) # doctest: +IGNORE_OUTPUT
6970
TableList with 10 tables:
7071
'0:J/A+A/635/A205/20140119' with 7 column(s) and 50 row(s)
7172
'1:J/A+A/635/A205/20140123' with 7 column(s) and 50 row(s)
@@ -81,7 +82,7 @@ way:
8182
.. doctest-remote-data::
8283

8384
>>> catalogs = Vizier.get_catalogs(catalog_list.keys())
84-
>>> print(catalogs)
85+
>>> print(catalogs) # doctest: +IGNORE_OUTPUT
8586
TableList with 10 tables:
8687
'0:J/A+A/635/A205/20140119' with 7 column(s) and 50 row(s)
8788
'1:J/A+A/635/A205/20140123' with 7 column(s) and 50 row(s)
@@ -101,7 +102,7 @@ complete catalog, you need to change that:
101102

102103
>>> Vizier.ROW_LIMIT = -1
103104
>>> catalogs = Vizier.get_catalogs(catalog_list.keys())
104-
>>> print(catalogs)
105+
>>> print(catalogs) # doctest: +IGNORE_OUTPUT
105106
TableList with 10 tables:
106107
'0:J/A+A/635/A205/20140119' with 7 column(s) and 235 row(s)
107108
'1:J/A+A/635/A205/20140123' with 7 column(s) and 195 row(s)
@@ -160,11 +161,11 @@ For instance to query Sirius across all catalogs:
160161
.. doctest-remote-data::
161162

162163
>>> from astroquery.vizier import Vizier
163-
>>> vizier = Vizier()
164+
>>> vizier = Vizier(row_limit=10)
164165
>>> result = vizier.query_object("sirius")
165166
>>> print(result)
166-
TableList with 416 tables:
167-
'0:METAobj' with 5 column(s) and 7 row(s)
167+
TableList with ... tables:
168+
'0:METAobj' with 5 column(s) and 7 row(s)
168169
'1:ReadMeObj' with 5 column(s) and 7 row(s)
169170
'2:I/34/greenw2a' with 16 column(s) and 1 row(s)
170171
...
@@ -298,23 +299,24 @@ on the Vizier class.
298299
>>> v = Vizier(columns=['_RAJ2000', '_DEJ2000','B-V', 'Vmag', 'Plx'],
299300
... column_filters={"Vmag":">10"}, keywords=["optical", "xry"]) # doctest: +IGNORE_WARNINGS
300301

301-
Note that whenever an unknown keyword is specified, a warning is emitted and
302+
Note that whenever an unknown keyword is specified (here ``xry``) a warning is emitted and
302303
that keyword is discarded from further consideration. The behavior for
303304
searching with these keywords is the same as defined for the web
304305
interface (`for details see here`_). Now we call the different query methods on
305306
this Vizier instance:
306307

308+
.. output can be in any order here
307309
.. doctest-remote-data::
308310

309311
>>> v = Vizier(columns=['_RAJ2000', '_DEJ2000','B-V', 'Vmag', 'Plx'],
310-
... column_filters={"Vmag":">10"}, keywords=["optical", "xry"]) # doctest: +IGNORE_WARNINGS
312+
... column_filters={"Vmag":">10"}, keywords=["optical"])
311313
>>> result = v.query_object("HD 226868", catalog=["NOMAD", "UCAC"])
312314
>>> print(result)
313315
TableList with 3 tables:
314316
'0:I/297/out' with 3 column(s) and 50 row(s)
315317
'1:I/322A/out' with 3 column(s) and 10 row(s)
316318
'2:I/340/ucac5' with 2 column(s) and 26 row(s)
317-
>>> print(result['I/322A/out'])
319+
>>> print(result['I/322A/out']) # doctest: +IGNORE_OUTPUT
318320
_RAJ2000 _DEJ2000 Vmag
319321
deg deg mag
320322
------------- ------------- ------

0 commit comments

Comments
 (0)