Skip to content

Commit

Permalink
TST: fixing failing doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Aug 9, 2023
1 parent 6dceccc commit 4b109a7
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion astroquery/lamda/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get_molecules(self, *, cache=True):
response = self._request('GET', main_url, cache=cache)
response.raise_for_status()

soup = BeautifulSoup(response.content)
soup = BeautifulSoup(response.content, features="html5lib")

links = soup.find_all('a', href=True)
datfile_urls = [url
Expand Down
4 changes: 2 additions & 2 deletions docs/casda/casda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For example:
>>> from astropy import units as u
>>> centre = SkyCoord.from_name('NGC 7232')
>>> result_table = Casda.query_region(centre, radius=30*u.arcmin)
>>> print(result_table['obs_publisher_did','s_ra', 's_dec', 'obs_release_date'][:5])
>>> print(result_table['obs_publisher_did','s_ra', 's_dec', 'obs_release_date'][:5]) # doctest: +IGNORE_OUTPUT
obs_publisher_did s_ra s_dec obs_release_date
deg deg
----------------- --------------- ---------------- ------------------------
Expand All @@ -45,7 +45,7 @@ For example to filter out the 30 non-public results from the above data set:
.. doctest-remote-data::

>>> public_results = Casda.filter_out_unreleased(result_table)
>>> print(public_results['obs_publisher_did','s_ra', 's_dec', 'obs_release_date'][:5])
>>> print(public_results['obs_publisher_did','s_ra', 's_dec', 'obs_release_date'][:5]) # doctest: +IGNORE_OUTPUT
obs_publisher_did s_ra s_dec obs_release_date
deg deg
----------------- --------------- ---------------- ------------------------
Expand Down
17 changes: 8 additions & 9 deletions docs/esa/jwst/jwst.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.. _astroquery.esa.jwst:

****************************************
Expand Down Expand Up @@ -379,14 +378,14 @@ Once a table is loaded, columns can be inspected
>>> from astroquery.esa.jwst import Jwst
>>> table = Jwst.load_table('jwst.main')
>>> print(*(column.name for column in table.columns), sep="\n")
"public"
algorithm_name
calibrationlevel
collection
creatorid
dataproducttype
energy_bandpassname
...
public
algorithm_name
calibrationlevel
collection
creatorid
dataproducttype
energy_bandpassname
...
1.6 Synchronous query
Expand Down
2 changes: 1 addition & 1 deletion docs/ipac/irsa/irsa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ entered as a string that is parsable by `~astropy.coordinates.Angle`.
>>> import astropy.units as u
>>> table = Irsa.query_region("m31", catalog="fp_psc", spatial="Cone",
... radius=2 * u.arcmin)
>>> print(table)
>>> print(table) # doctest: +IGNORE_OUTPUT
ra dec clon clat ... angle j_h h_k j_k
deg deg ... deg
---------- ---------- ------------ ------------ ... ---------- ----- ----- -----
Expand Down
16 changes: 8 additions & 8 deletions docs/ipac/irsa/most.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,16 @@ asteroid `Victoria <https://en.wikipedia.org/wiki/12_Victoria>`_ as:
ra_obj dec_obj sun_dist geo_dist ... moon_sep saa_sep qual_frame image_set
float64 float64 float64 float64 ... float64 float64 int64 int64
---------- --------- -------- -------- ... -------- ------- ---------- ---------
333.539704 -0.779309 1.8179 1.4638 ... 102.339 15.039 10 6
333.539704 -0.779309 1.8179 1.4638 ... 102.339 15.039 10 6
333.539704 -0.779308 1.8179 1.4638 ... 102.339 15.039 10 6
333.539704 -0.779308 1.8179 1.4638 ... 102.339 15.039 10 6
333.589056 -0.747249 1.8179 1.4626 ... 103.825 46.517 10 6
333.589056 -0.747249 1.8179 1.4626 ... 103.825 46.517 10 6
333.638286 -0.71525 1.8179 1.4614 ... 105.327 89.053 10 6
333.638286 -0.71525 1.8179 1.4614 ... 105.327 89.053 10 6
333.687495 -0.683205 1.8178 1.4603 ... 106.803 115.076 10 6
333.687495 -0.683205 1.8178 1.4603 ... 106.803 115.076 10 6
333.736581 -0.651221 1.8178 1.4591 ... 108.294 73.321 10 6
333.736581 -0.651221 1.8178 1.4591 ... 108.294 73.321 10 6
333.736581 -0.65122 1.8178 1.4591 ... 108.294 73.321 10 6
333.736581 -0.65122 1.8178 1.4591 ... 108.294 73.321 10 6

To return more than just a table of image identifiers, use one of the more
verbose output modes - ``Regular`` or ``Full``.
Expand All @@ -393,16 +393,16 @@ verbose output modes - ``Regular`` or ``Full``.
ra_obj dec_obj sun_dist geo_dist ... moon_sep saa_sep qual_frame image_set
float64 float64 float64 float64 ... float64 float64 int64 int64
---------- --------- -------- -------- ... -------- ------- ---------- ---------
333.539704 -0.779309 1.8179 1.4638 ... 102.339 15.039 10 6
333.539704 -0.779309 1.8179 1.4638 ... 102.339 15.039 10 6
333.539704 -0.779308 1.8179 1.4638 ... 102.339 15.039 10 6
333.539704 -0.779308 1.8179 1.4638 ... 102.339 15.039 10 6
333.589056 -0.747249 1.8179 1.4626 ... 103.825 46.517 10 6
333.589056 -0.747249 1.8179 1.4626 ... 103.825 46.517 10 6
333.638286 -0.71525 1.8179 1.4614 ... 105.327 89.053 10 6
333.638286 -0.71525 1.8179 1.4614 ... 105.327 89.053 10 6
333.687495 -0.683205 1.8178 1.4603 ... 106.803 115.076 10 6
333.687495 -0.683205 1.8178 1.4603 ... 106.803 115.076 10 6
333.736581 -0.651221 1.8178 1.4591 ... 108.294 73.321 10 6
333.736581 -0.651221 1.8178 1.4591 ... 108.294 73.321 10 6
333.736581 -0.65122 1.8178 1.4591 ... 108.294 73.321 10 6
333.736581 -0.65122 1.8178 1.4591 ... 108.294 73.321 10 6

As demonstrated, the returned values are stored in a dictionary and which
``metadata`` key table matches the ``Brief`` output mode table.
Expand Down
3 changes: 2 additions & 1 deletion docs/ipac/nexsci/nasa_exoplanet_archive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ A list of accessible tables can be found in the ``TAP_TABLES`` attribute:

>>> from astroquery.ipac.nexsci.nasa_exoplanet_archive import NasaExoplanetArchive
>>> NasaExoplanetArchive.TAP_TABLES
['superwasptimeseries',
['spectra',
'superwasptimeseries',
'kelttimeseries',
'DI_STARS_EXEP',
'transitspec',
Expand Down
4 changes: 2 additions & 2 deletions docs/jplsbdb/jplsbdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ item:
.. code-block:: python
>>> sbdb['orbit']['moid_jup'] # doctest: +REMOTE_DATA
<Quantity 0.431 AU>
<Quantity 0.43 AU>
Note that many of the items in the output dictionary are associated
with `~astropy.units` which can be readily used for
Expand All @@ -167,7 +167,7 @@ orbit intersection distance of the target with respect to Jupiter
.. code-block:: python
>>> print(sbdb['orbit']['moid_jup'].to('km')) # doctest: +REMOTE_DATA
64476682.271699995 km
64327084.40099999 km
The vast majority of parameter names are identical to those used in
the `SBDB API documentation
Expand Down
6 changes: 3 additions & 3 deletions docs/lamda/lamda.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ is called, then cached for future use. If there has been an update and you
want to reload the cache, you can find the cache file ``'molecules.json'`` and
remove it:

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

>>> import os
>>> Lamda.cache_location # doctest: +IGNORE_OUTPUT
>>> Lamda.cache_location
'/Users/your_username/.astropy/cache/astroquery/Lamda'
>>> Lamda.moldict_path # doctest: +IGNORE_OUTPUT
>>> Lamda.moldict_path
'/Users/your_username/.astropy/cache/astroquery/Lamda/molecules.json'
>>> os.remove(Lamda.moldict_path)

Expand Down
2 changes: 1 addition & 1 deletion docs/mpc/mpc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ degrees per hour:

>>> eph = MPC.get_ephemeris('C/1996 B2', start='1996-03-01', step='1h', number=30 * 24)
>>> print(eph['Proper motion'].quantity.to('deg/h').max())
0.7756944444444445 deg / h
0.17234444444444447 deg / h

Sky coordinates are returned as quantities carrying units of degrees.
If a sexagesimal representation is desired, they may be replaced with
Expand Down
3 changes: 2 additions & 1 deletion docs/svo_fps/svo_fps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ range) can be listed with
>>> from astroquery.svo_fps import SvoFps
>>> index = SvoFps.get_filter_index(12_000*u.angstrom, 12_100*u.angstrom)
>>> index.info
<Table length=14>
<Table length=15>
name dtype unit
-------------------- ------- ---------------
FilterProfileService object
Expand Down Expand Up @@ -62,6 +62,7 @@ range) can be listed with
AsinhSoft float64
TrasmissionCurve object


If the wavelength range contains too many entries then a ``TimeoutError`` will
occur. A smaller wavelength range might succeed, but if a large range really is
required then you can use the ``timeout`` argument to allow for a longer
Expand Down

0 comments on commit 4b109a7

Please sign in to comment.