Skip to content

Commit a1349a1

Browse files
snbiancobsipocz
authored andcommitted
handle doc tests, pubdata_bucket typo
1 parent e35d8b4 commit a1349a1

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

astroquery/mast/cloud.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def get_cloud_uri_list(self, data_products, include_bucket=True, full_url=False)
158158
s3_path = "s3://{}/{}".format(self.pubdata_bucket, path)
159159
uri_list.append(s3_path)
160160
elif full_url:
161-
path = "http://s3.amazonaws.com/{}/{}".format(self._pubdata_bucket, path)
161+
path = "http://s3.amazonaws.com/{}/{}".format(self.pubdata_bucket, path)
162162
uri_list.append(path)
163163
except self.botocore.exceptions.ClientError as e:
164164
if e.response['Error']['Code'] != "404":

docs/mast/mast_catalog.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ The returned fields vary by catalog, find the field documentation for specific c
2424
`here <https://mast.stsci.edu/api/v0/pages.html>`__.
2525
If no catalog is specified, the Hubble Source Catalog will be queried.
2626

27-
.. doctest-skip::
27+
28+
.. doctest-remote-data::
2829

2930
>>> from astroquery.mast import Catalogs
3031
...
3132
>>> catalog_data = Catalogs.query_object("158.47924 -7.30962", catalog="Galex")
32-
>>> print(catalog_data[:10])
33+
>>> print(catalog_data[:10]) # doctest: +IGNORE_OUTPUT
3334
distance_arcmin objID survey ... fuv_flux_aper_7 fuv_artifact
3435
------------------ ------------------- ------ ... --------------- ------------
3536
0.3493802506329695 6382034098673685038 AIS ... 0.047751952 0

docs/mast/mast_obsquery.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ with `~astroquery.mast.ObservationsClass.get_product_list`
284284
(see `here <https://mast.stsci.edu/api/v0/_c_a_o_mfields.html>`__ for more details).
285285
Using "obs_id" instead of "obsid" from the previous example will result in the following error:
286286

287-
.. doctest-skip::
287+
.. doctest-remote-data::
288288
>>> obs_ids = obs_table[0:2]['obs_id']
289-
>>> data_products_by_id = Observations.get_product_list(obs_ids)
289+
>>> data_products_by_id = Observations.get_product_list(obs_ids) # doctest: +IGNORE_OUTPUT
290290
Traceback (most recent call last):
291291
...
292292
RemoteServiceError: Error converting data type varchar to bigint.
@@ -467,24 +467,23 @@ Alternatively, this workflow can be streamlined by providing the query criteria
467467
This approach is recommended for code brevity. Query criteria are supplied as keyword arguments, and filters are supplied through the
468468
``filter_products`` parameter. If both ``data_products`` and query criteria are provided, ``data_products`` takes precedence.
469469

470-
.. doctest-skip::
470+
.. doctest-remote-data::
471471

472472
>>> import os
473473
>>> from astroquery.mast import Observations
474474
...
475475
>>> Observations.enable_cloud_dataset(provider='AWS')
476-
INFO: Using the S3 STScI public dataset [astroquery.mast.core]
477-
...
476+
INFO: Using the S3 STScI public dataset [astroquery.mast.cloud]
478477
>>> # Getting the cloud URIs
479478
>>> s3_uris = Observations.get_cloud_uris(obs_collection='HST',
480-
filters='F606W',
481-
instrument_name='ACS/WFC',
482-
proposal_id=['12062'],
483-
dataRights='PUBLIC',
484-
filter_products={'productSubGroupDescription': 'DRZ'})
479+
... filters='F606W',
480+
... instrument_name='ACS/WFC',
481+
... proposal_id=['12062'],
482+
... dataRights='PUBLIC',
483+
... filter_products={'productSubGroupDescription': 'DRZ'})
484+
INFO: 2 of 4 products were duplicates. Only downloading 2 unique product(s). [astroquery.mast.observations]
485485
>>> print(s3_uris)
486486
['s3://stpubdata/hst/public/jbev/jbeveo010/jbeveo010_drz.fits', 's3://stpubdata/hst/public/jbev/jbevet010/jbevet010_drz.fits']
487-
...
488487
>>> Observations.disable_cloud_dataset()
489488

490489
Downloading data products from S3:

0 commit comments

Comments
 (0)