Skip to content

Commit e18face

Browse files
fixes (?) for ".. doctests..::"
1 parent 8488d14 commit e18face

13 files changed

Lines changed: 92 additions & 49 deletions

docs/eso/eso.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ and show how to download the corresponding data products.
2727
>>> from astroquery.eso import Eso
2828
>>> eso = Eso()
2929

30-
>>> from astropy.coordinates import SkyCoord
31-
>>> import astropy.units as u
32-
>>> coords = SkyCoord.from_name("HD 37903")
33-
>>> ra = coords.ra.value
34-
>>> dec = coords.dec.value
35-
>>> r = (1*u.arcsec).to(u.deg).value
36-
37-
>>> table_raw = eso.query_main("ESPRESSO", cone_ra=ra, cone_dec=dec, cone_radius=r)
38-
>>> table_reduced = eso.query_surveys("ESPRESSO", cone_ra=ra, cone_dec=dec, cone_radius=r)
30+
.. doctest-remote-data::
31+
32+
>>> from astropy.coordinates import SkyCoord # doctest: +SKIP
33+
>>> import astropy.units as u
34+
>>> coords = SkyCoord.from_name("HD 37903") # doctest: +SKIP
35+
>>> ra = coords.ra.value # doctest: +SKIP
36+
>>> dec = coords.dec.value # doctest: +SKIP
37+
>>> r = (1*u.arcsec).to(u.deg).value # doctest: +SKIP
38+
39+
>>> table_raw = eso.query_main("ESPRESSO", cone_ra=ra, cone_dec=dec, cone_radius=r) # doctest: +SKIP
40+
>>> table_reduced = eso.query_surveys("ESPRESSO", cone_ra=ra, cone_dec=dec, cone_radius=r) # doctest: +SKIP
3941

4042
>>> eso.retrieve_data(table_raw["dp_id"]) # doctest: +SKIP
4143
>>> eso.retrieve_data(table_reduced["dp_id"]) # doctest: +SKIP
@@ -56,7 +58,7 @@ By default, queries are limited to returning a maximum of 1000 rows. This limit
5658
can be modified by setting the ``ROW_LIMIT`` attribute. To disable truncation
5759
and return all matching results (up to TAP limit of 15,000,000), set:
5860

59-
.. doctest::
61+
.. doctest-remote-data::
6062

6163
>>> eso.ROW_LIMIT = -1 # 0 or None to return all results without truncation
6264

docs/eso/eso_cat_cone_search.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ For example:
3030

3131
>>> from astroquery.eso import Eso
3232
>>> eso = Eso()
33-
33+
34+
.. doctest-remote-data::
35+
3436
>>> eso.query_catalogue(catalogue='KiDS_DR4_1_ugriZYJHKs_cat_fits', help=True) # doctest: +IGNORE_OUTPUT
3537
...
3638
RAJ2000 DOUBLE deg pos.eq.ra;meta.main
@@ -87,8 +89,10 @@ Define target of interest and search radius:
8789
>>> from astropy.coordinates import SkyCoord
8890
>>> import astropy.units as u
8991

92+
.. doctest-remote-data::
93+
9094
>>> table_name = "KiDS_DR4_1_ugriZYJHKs_cat_fits"
91-
>>> coords = SkyCoord.from_name("NGC1097")
95+
>>> coords = SkyCoord.from_name("NGC1097") # doctest: +SKIP
9296
>>> radius = 3 * u.arcmin
9397

9498
Helper functions to identify the main ``id``, ``ra``, and ``dec`` columns
@@ -194,13 +198,15 @@ Run search with cone filter:
194198
... dec=coords.dec,
195199
... radius=radius,
196200
... table_name=table_name,
197-
... )
201+
... ) # doctest: +SKIP
202+
203+
.. doctest-remote-data::
198204

199205
>>> table = eso.query_catalogue(
200206
... catalogue=table_name,
201207
... column_filters=column_filters,
202-
... )
203-
>>> table # doctest: +IGNORE_OUTPUT
208+
... ) # doctest: +SKIP
209+
>>> table # doctest: +SKIP
204210
<Table length=55>
205211
Level ALPHA_J2000 A_IMAGE A_WORLD ... Z_B_MAX Z_B_MIN Z_ML
206212
count deg pixel deg ...
@@ -231,7 +237,7 @@ normal dictionary updates.
231237
>>> table = eso.query_catalogue(
232238
... catalogue="KiDS_DR4_1_ugriZYJHKs_cat_fits",
233239
... column_filters=column_filters,
234-
... ) # doctest: +IGNORE_OUTPUT
240+
... ) # doctest: +SKIP
235241
<Table length=6>
236242
Level ALPHA_J2000 A_IMAGE A_WORLD Agaper ... Ypos Z_B Z_B_MAX Z_B_MIN Z_ML
237243
count deg pixel deg arcsec ... pixel

docs/eso/eso_cat_query.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ catalogue.
1818
>>> from astroquery.eso import Eso
1919
>>> eso = Eso()
2020

21+
.. doctest-remote-data::
22+
2123
>>> eso.list_catalogues(all_versions=False) # doctest: +IGNORE_OUTPUT
2224
['AMBRE_V1',
2325
'ATLASGAL_V1',
@@ -31,7 +33,6 @@ catalogue.
3133
...
3234
'vmc_dr7_yjks_back_V1',
3335
'vmc_dr7_yjks_varCat_V3']
34-
3536
>>> print(len(eso.list_catalogues(all_versions=False))) # doctest: +IGNORE_OUTPUT
3637
86
3738

@@ -54,7 +55,6 @@ To include every available version of every catalogue, set
5455
...
5556
'vmc_dr7_yjks_back_V1',
5657
'vmc_dr7_yjks_varCat_V3']
57-
5858
>>> print(len(eso.list_catalogues(all_versions=True))) # doctest: +IGNORE_OUTPUT
5959
129
6060

@@ -110,8 +110,8 @@ table. To see more infomation on this specific version of the Kilo-Degree Survey
110110
... WHERE schema_name = 'safcat' AND cat_id IS NOT NULL
111111
... ORDER BY cat_id
112112
... """
113-
>>> tbl = eso.query_tap(query, which_tap="tap_cat")
114-
>>> print(tbl[:5]) # doctest: +IGNORE_OUTPUT
113+
>>> tbl = eso.query_tap(query, which_tap="tap_cat") # doctest: +SKIP
114+
>>> print(tbl[:5]) # doctest: +SKIP
115115
table_name cat_id release_documentation_url
116116
---------------- ------ -----------------------------------------------------------
117117
AMBRE_V1 13 https://www.eso.org/rm/api/v1/public/releaseDescriptions/7

docs/eso/eso_cat_tap.rst

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ free ADQL, using :meth:`~astroquery.eso.EsoClass.query_tap`. By default,
1111
Basic Usage
1212
===========
1313

14-
.. doctest-skip::
14+
.. doctest-remote-data::
1515

1616
>>> from astroquery.eso import Eso
1717
>>> eso = Eso()
18-
18+
19+
.. doctest-remote-data::
20+
1921
>>> query = "SELECT table_name FROM TAP_SCHEMA.tables"
2022
>>> table = eso.query_tap(query, which_tap="tap_cat")
2123

@@ -35,9 +37,6 @@ https://www.eso.org/rm/api/v1/public/releaseDescriptions/7
3537

3638
.. doctest-remote-data::
3739

38-
>>> from astroquery.eso import Eso
39-
>>> eso = Eso()
40-
4140
>>> query = """
4241
... SELECT table_name, cat_id, rel_descr_url
4342
... FROM TAP_SCHEMA.tables
@@ -161,12 +160,13 @@ the query, as e.g.:
161160

162161
>>> import astropy.units as u
163162
>>> from astropy.coordinates import SkyCoord
164-
165163
>>> target = SkyCoord.from_name("ESO 154-10")
166164
>>> ra_deg = target.icrs.ra.to_value(u.deg)
167165
>>> dec_deg = target.icrs.dec.to_value(u.deg)
168166
>>> radius_deg = (2.4 * u.arcmin).to_value(u.deg)
169167

168+
.. doctest-remote-data::
169+
170170
>>> query = f"""
171171
... SELECT host_id, transient_id, transient_classification,
172172
... transient_raj2000, transient_decj2000
@@ -285,10 +285,12 @@ This can also be done using a name resolver for the target coordinates, as previ
285285
>>> import astropy.units as u
286286
>>> from astropy.coordinates import SkyCoord
287287

288-
>>> target = SkyCoord.from_name("ESO 154-10")
289-
>>> ra_deg = target.icrs.ra.to_value(u.deg)
290-
>>> dec_deg = target.icrs.dec.to_value(u.deg)
291-
>>> radius_deg = (3 * u.arcmin).to_value(u.deg)
288+
>>> target = SkyCoord.from_name("ESO 154-10") # doctest: +SKIP
289+
>>> ra_deg = target.icrs.ra.to_value(u.deg) # doctest: +SKIP
290+
>>> dec_deg = target.icrs.dec.to_value(u.deg) # doctest: +SKIP
291+
>>> radius_deg = (3 * u.arcmin).to_value(u.deg) # doctest: +SKIP
292+
293+
.. doctest-remote-data::
292294

293295
>>> query = f"""
294296
... SELECT host_id, transient_id, transient_classification,
@@ -303,4 +305,4 @@ This can also be done using a name resolver for the target coordinates, as previ
303305
... ) = 1
304306
... ORDER BY transient_id
305307
... """
306-
>>> table = eso.query_tap(query, which_tap="tap_cat")
308+
>>> table = eso.query_tap(query, which_tap="tap_cat") # doctest: +SKIP

docs/eso/eso_login.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ The following examples show typical login and data retrieval workflows:
2424
>>> from astroquery.eso import Eso
2525
>>> eso = Eso()
2626

27+
.. doctest-remote-data::
28+
2729
>>> eso.login(username="TEST") # doctest: +SKIP
2830
WARNING: No password was found in the keychain for the provided username. [astroquery.query]
2931
TEST, enter your password:

docs/eso/eso_obs_apex.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,36 @@ the ESO proposal ID.
4040
>>> from astroquery.eso import Eso
4141
>>> eso = Eso()
4242

43+
.. doctest-remote-data::
44+
4345
>>> # query the ESO archive for the ALCOHOLS survey
4446
>>> table_reduced = eso.query_surveys("ALCOHOLS")
4547

48+
.. doctest-remote-data::
49+
4650
>>> # extract unique ESO run IDs from the query result
4751
>>> # (the survey table actually contains ESO run IDs)
4852
>>> run_ids = list(set(table_reduced["proposal_id"]))
49-
53+
54+
.. doctest-remote-data::
55+
5056
>>> # check if we have a single run ID or multiple
5157
>>> if len(run_ids) == 1:
5258
... run_id = run_ids[0]
5359
... else:
5460
... print("Warning: Multiple proposal IDs found...")
5561
... run_id = run_ids[0]
56-
62+
63+
.. doctest-remote-data::
64+
5765
>>> # Extract the proposal (aka programme) ID from the run ID
5866
>>> def proposal_remove_run(run_id):
5967
... proposal_id = ".".join(run_id.split(".", 2)[:2])
6068
... proposal_id = ".".join(proposal_id.split("(")[:1])
6169
... return proposal_id
6270

71+
.. doctest-remote-data::
72+
6373
>>> proposal_id = proposal_remove_run(run_id)
6474
>>> print(f"Proposal ID: {proposal_id}")
6575
Proposal ID: 094.C-0935
@@ -110,9 +120,13 @@ retrieved from the previous query.
110120
>>> # query the APEX instrument for data related to the ESO proposal ID
111121
>>> table_raw = eso.query_instrument("APEX", column_filters={"prog_id": f"like '{proposal_id}%'"})
112122

123+
.. doctest-remote-data::
124+
113125
>>> # extract unique APEX project IDs from the raw data query
114126
>>> project_id = list(set(table_raw["project_id"]))
115127

128+
.. doctest-remote-data::
129+
116130
>>> # assuming we only have one project ID
117131
>>> project_id = project_id[0]
118132
>>> print(f"Project ID: {project_id}")

docs/eso/eso_obs_cone_search.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ This example demonstrates how to perform a basic cone search for publicly availa
2020
.. doctest-remote-data::
2121

2222
>>> import astropy.units as u
23-
2423
>>> ra = 266.41683 *u.deg # degrees
2524
>>> dec = -29.00781 *u.deg # degrees
2625
>>> radius = 0.05 *u.deg # degrees
@@ -30,7 +29,6 @@ If coordinates are not known, you can use the :class:`~astropy.coordinates.SkyCo
3029
.. doctest-remote-data::
3130

3231
>>> from astropy.coordinates import SkyCoord
33-
3432
>>> coords = SkyCoord.from_name("Sgr A*")
3533
>>> ra = coords.ra
3634
>>> dec = coords.dec
@@ -43,6 +41,8 @@ With the defined coordinates and radius, we can now perform the cone search usin
4341
>>> from astroquery.eso import Eso
4442
>>> eso = Eso()
4543

44+
.. doctest-remote-data::
45+
4646
>>> table = eso.query_surveys(
4747
... cone_ra=ra.value,
4848
... cone_dec=dec.value,

docs/eso/eso_obs_download.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Assuming you have already performed a query (e.g., using :meth:`~astroquery.eso.
1010
>>> from astroquery.eso import Eso
1111
>>> eso = Eso()
1212

13+
.. doctest-remote-data::
14+
1315
>>> data_files = eso.retrieve_data(table['dp_id'][:2]) # doctest: +SKIP
1416
INFO: Downloading datasets ... [astroquery.eso.core]
1517
INFO: Downloading 2 files ... [astroquery.eso.core]

docs/eso/eso_obs_header_info.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ There is, however, a way to get the full primary header of the FITS data product
1212
>>> from astroquery.eso import Eso
1313
>>> eso = Eso()
1414

15+
.. doctest-remote-data::
16+
1517
>>> table = eso.query_instrument("midi",
1618
... column_filters={
1719
... "date_obs": "between '2008-01-01' and '2008-01-02'"

docs/eso/eso_obs_raw_general.rst

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ interpretation reflected in the ``xtype`` field.
3434
>>> from astroquery.eso import Eso
3535
>>> eso = Eso()
3636

37+
.. doctest-remote-data::
38+
3739
>>> eso.query_main(help=True) # doctest: +IGNORE_OUTPUT
3840
INFO:
3941
Columns present in the table dbo.raw:
@@ -64,11 +66,15 @@ time constraint specified down to the second.
6466
>>> from astropy.coordinates import SkyCoord
6567
>>> import astropy.units as u
6668

67-
>>> coords = SkyCoord.from_name("SN2013am") # The Prawn Nebula
69+
.. doctest-remote-data::
70+
71+
>>> coords = SkyCoord.from_name("SN2013am") # doctest: +SKIP
6872
>>> ra = coords.ra.value
6973
>>> dec = coords.dec.value
7074
>>> r = (30 * u.arcsec).to(u.deg).value
7175

76+
.. doctest-remote-data::
77+
7278
>>> table = eso.query_main(
7379
... cone_ra=ra,
7480
... cone_dec=dec,
@@ -77,8 +83,8 @@ time constraint specified down to the second.
7783
... "exp_start": "between '2013-04-12' and '2013-04-12T04:52:06'"
7884
... },
7985
... columns=["object", "ra", "dec", "date_obs", "instrument", "prog_id"],
80-
... )
81-
>>> table # doctest: +IGNORE_OUTPUT
86+
... ) # doctest: +SKIP
87+
>>> table # doctest: +SKIP
8288
<Table length=13>
8389
object ra dec date_obs prog_id instrument
8490
deg deg
@@ -177,22 +183,24 @@ from the interferometric instruments ``MIDI``, ``GRAVITY``, and ``PIONIER`` with
177183

178184
.. doctest-remote-data::
179185

180-
>>> coords = SkyCoord.from_name("ETA CAR") # Eta Carinae
186+
>>> coords = SkyCoord.from_name("ETA CAR") # doctest: +SKIP
181187
>>> ra = coords.ra.value
182188
>>> dec = coords.dec.value
183189
>>> r = (10 * u.arcsec).to(u.deg).value
184190

191+
.. doctest-remote-data::
192+
185193
>>> table = eso.query_main(
186194
... cone_ra=ra,
187195
... cone_dec=dec,
188196
... cone_radius=r,
189197
... instruments=["midi", "gravity", "pionier"],
190198
... column_filters={
191199
... columns=["instrument", "object", "ra", "dec", "date_obs", "prog_id"]
192-
... )
193-
>>> print(len(table)) # doctest: +IGNORE_OUTPUT
200+
... ) # doctest: +SKIP
201+
>>> print(len(table)) # doctest: +SKIP
194202
622
195-
>>> table[["object", "ra", "dec", "date_obs", "prog_id"]] # doctest: +IGNORE_OUTPUT
203+
>>> table[["object", "ra", "dec", "date_obs", "prog_id"]] # doctest: +SKIP
196204
<Table length=622>
197205
object ra dec date_obs prog_id instrument
198206
deg deg
@@ -224,9 +232,8 @@ from the interferometric instruments ``MIDI``, ``GRAVITY``, and ``PIONIER`` with
224232
... "ins_opt1_name": "HIGH_SENS", # High sensitivity mode
225233
... "night_flag": "night", # Nighttime observations only
226234
... "moon_illu": "< 0", # No moon (below horizon)
227-
... "lst": "between 0 and 6" # Local sidereal time early in the night
228-
... }
229-
>>> table = eso.query_instrument("midi", column_filters=column_filters)
235+
... "lst": "between 0 and 6"} # Local sidereal time early in the night
236+
>>> table = eso.query_instrument("midi", column_filters=column_filters) # doctest: +SKIP
230237

231238
Download Data
232239
=============

0 commit comments

Comments
 (0)