Skip to content

Commit

Permalink
handle doc tests, pubdata_bucket typo
Browse files Browse the repository at this point in the history
  • Loading branch information
snbianco authored and bsipocz committed Jul 16, 2024
1 parent e35d8b4 commit a1349a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion astroquery/mast/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_cloud_uri_list(self, data_products, include_bucket=True, full_url=False)
s3_path = "s3://{}/{}".format(self.pubdata_bucket, path)
uri_list.append(s3_path)
elif full_url:
path = "http://s3.amazonaws.com/{}/{}".format(self._pubdata_bucket, path)
path = "http://s3.amazonaws.com/{}/{}".format(self.pubdata_bucket, path)
uri_list.append(path)
except self.botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] != "404":
Expand Down
5 changes: 3 additions & 2 deletions docs/mast/mast_catalog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ The returned fields vary by catalog, find the field documentation for specific c
`here <https://mast.stsci.edu/api/v0/pages.html>`__.
If no catalog is specified, the Hubble Source Catalog will be queried.

.. doctest-skip::

.. doctest-remote-data::

>>> from astroquery.mast import Catalogs
...
>>> catalog_data = Catalogs.query_object("158.47924 -7.30962", catalog="Galex")
>>> print(catalog_data[:10])
>>> print(catalog_data[:10]) # doctest: +IGNORE_OUTPUT
distance_arcmin objID survey ... fuv_flux_aper_7 fuv_artifact
------------------ ------------------- ------ ... --------------- ------------
0.3493802506329695 6382034098673685038 AIS ... 0.047751952 0
Expand Down
21 changes: 10 additions & 11 deletions docs/mast/mast_obsquery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ with `~astroquery.mast.ObservationsClass.get_product_list`
(see `here <https://mast.stsci.edu/api/v0/_c_a_o_mfields.html>`__ for more details).
Using "obs_id" instead of "obsid" from the previous example will result in the following error:

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

.. doctest-skip::
.. doctest-remote-data::

>>> import os
>>> from astroquery.mast import Observations
...
>>> Observations.enable_cloud_dataset(provider='AWS')
INFO: Using the S3 STScI public dataset [astroquery.mast.core]
...
INFO: Using the S3 STScI public dataset [astroquery.mast.cloud]
>>> # Getting the cloud URIs
>>> s3_uris = Observations.get_cloud_uris(obs_collection='HST',
filters='F606W',
instrument_name='ACS/WFC',
proposal_id=['12062'],
dataRights='PUBLIC',
filter_products={'productSubGroupDescription': 'DRZ'})
... filters='F606W',
... instrument_name='ACS/WFC',
... proposal_id=['12062'],
... dataRights='PUBLIC',
... filter_products={'productSubGroupDescription': 'DRZ'})
INFO: 2 of 4 products were duplicates. Only downloading 2 unique product(s). [astroquery.mast.observations]
>>> print(s3_uris)
['s3://stpubdata/hst/public/jbev/jbeveo010/jbeveo010_drz.fits', 's3://stpubdata/hst/public/jbev/jbevet010/jbevet010_drz.fits']
...
>>> Observations.disable_cloud_dataset()

Downloading data products from S3:
Expand Down

0 comments on commit a1349a1

Please sign in to comment.