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 8, 2023
1 parent 6dceccc commit dcafc78
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 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
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 dcafc78

Please sign in to comment.