Skip to content

Commit

Permalink
Merge pull request #2800 from bsipocz/tst_fixes_for_23Aug
Browse files Browse the repository at this point in the history
TST: fixes for 2023 aug
  • Loading branch information
bsipocz authored Aug 9, 2023
2 parents 3f16e62 + 4b109a7 commit b448335
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 35 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ sdss
- Switching to https to avoid issues originating in relying on server side
redirects. [#2654]

- Fix bug to have object IDs as integers on windows. [#2800]


simbad
^^^^^^

Expand Down
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
2 changes: 1 addition & 1 deletion astroquery/sdss/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def _parse_result(self, response, verbose=False):
warnings.filterwarnings("ignore", category=AstropyWarning,
message=r'OverflowError converting to IntType in column.*')
arr = Table.read(response.text, format='ascii.csv', comment="#")
for id_column in ('objid', 'specobjid'):
for id_column in ('objid', 'specobjid', 'objID', 'specobjID'):
if id_column in arr.columns:
arr[id_column] = arr[id_column].astype(np.int64)

Expand Down
7 changes: 2 additions & 5 deletions astroquery/simbad/tests/test_simbad.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,17 +347,14 @@ def test_votable_fields():
sb.add_votable_fields('rot', 'z_value', 'velocity')
assert (set(sb.get_votable_fields())
== set(['main_id', 'coordinates', 'rot', 'z_value', 'velocity']))
try:
sb.add_votable_fields('velocity')
except KeyError:
pass # this is the expected response

assert (set(sb.get_votable_fields())
== set(['main_id', 'coordinates', 'rot', 'z_value', 'velocity']))
sb.remove_votable_fields('rot', 'main_id', 'coordinates')
assert set(sb.get_votable_fields()) == set(['z_value', 'velocity'])
# Warning is expected as we removed the 'coordinates' field above:
with pytest.warns(UserWarning, match="coordinates: this field is not set"):
sb.remove_votable_fields('rot', 'main_id', 'coordinates')
sb.remove_votable_fields('coordinates')
assert set(sb.get_votable_fields()) == set(['z_value', 'velocity'])
with pytest.warns(UserWarning, match="All fields have been removed. Resetting"):
sb.remove_votable_fields('z_value', 'velocity')
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 b448335

Please sign in to comment.