Skip to content

Commit

Permalink
Now accepting sia1 as an alias for sia in registry.Servicetype.
Browse files Browse the repository at this point in the history
That's so there is a symmetry to sia2.  When further version 2-standards
appear, I'd suggest we continue that pattern: The official IVOA short name
(without numbers in version 1) remains, but a preferred alias with a 1 is
added in pyVO.

Note that access_modes and friends do not follow this logic; for SIA1, they
still do the regular thing and use the IVOA short name.

Would it make sense to convince the IVOA to add the 1 to their short names?
Well, it would have all these years ago.  Now... I think it would just
increase the confusion.
  • Loading branch information
msdemlei committed Aug 8, 2024
1 parent 3bb54e5 commit 9c50df4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/registry/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keyword arguments. The following constraints are available:
freetext words, mached in the title, description or subject of the
resource.
* :py:class:`~pyvo.registry.Servicetype` (``servicetype``): constrain to
one of tap, ssa, sia, conesearch (or full ivoids for other service
one of tap, ssa, sia1, sia2, conesearch (or full ivoids for other service
types). This is the constraint you want
to use for service discovery.
* :py:class:`~pyvo.registry.UCD` (``ucd``): constrain by one or more UCD
Expand Down Expand Up @@ -358,7 +358,7 @@ it returns 33 matching services.
>>> import warnings
>>> warnings.filterwarnings('ignore', module="astropy.io.votable.*")
>>>
>>> archives = vo.regsearch(servicetype='sia', waveband='x-ray')
>>> archives = vo.regsearch(servicetype='sia1', waveband='x-ray')
>>> pos = SkyCoord.from_name('Cas A')
>>> len(archives) # doctest: +IGNORE_OUTPUT
33
Expand Down Expand Up @@ -404,7 +404,7 @@ NRAO VLA Sky Survey (NVSS):

.. doctest-remote-data::

>>> colls = vo.regsearch(keywords=['NVSS'], servicetype='sia')
>>> colls = vo.regsearch(keywords=['NVSS'], servicetype='sia1')
>>> for coll in colls:
... print(coll.res_title, coll.access_url)
NRA) VLA Sky Survey https://skyview.gsfc.nasa.gov/cgi-bin/vo/sia.pl?survey=nvss&
Expand All @@ -428,7 +428,7 @@ documentation). Some attributes deserve a second look.
.. doctest-remote-data::

>>> import pyvo as vo
>>> colls = vo.regsearch(keywords=["NVSS"], servicetype='sia')
>>> colls = vo.regsearch(keywords=["NVSS"], servicetype='sia1')
>>> nvss = colls["NVSS"]
>>> nvss.res_title
'NRA) VLA Sky Survey'
Expand Down Expand Up @@ -492,7 +492,7 @@ that takes the form of a

.. doctest-remote-data::

>>> colls = vo.regsearch(keywords=["NVSS"], servicetype='sia')
>>> colls = vo.regsearch(keywords=["NVSS"], servicetype='sia1')
>>> for coll in colls:
... print(coll.ivoid)
ivo://nasa.heasarc/skyview/nvss
Expand All @@ -503,7 +503,7 @@ registry.

.. doctest-remote-data::

>>> nvss = vo.registry.search(ivoid='ivo://nasa.heasarc/skyview/nvss')[0].get_service(service_type='sia')
>>> nvss = vo.registry.search(ivoid='ivo://nasa.heasarc/skyview/nvss')[0].get_service(service_type='sia1')
>>> nvss.search(pos=(350.85, 58.815),size=0.25,format="image/fits")
<DALResultsTable length=1>
Survey Ra ... LogicalName
Expand Down
6 changes: 4 additions & 2 deletions pyvo/registry/rtcons.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
for k, v in [
("image", "sia"),
("sia", "sia"),
("sia1", "sia"),
# SIA2 is irregular
# funky scheme used by SIA2 without breaking everything else
("spectrum", "ssa"),
Expand Down Expand Up @@ -358,14 +359,15 @@ class Servicetype(Constraint):
The constraint normally is a custom keyword, one of:
* ``sia`` (SIAP version 1 services)
* ``sia``, ``sia1`` (SIAP version 1 services; prefer ``sia1`` for symmetry,
although ``sia`` will be kept as the official IVOA short name for SIA1)
* ``sia2`` (SIAP version 2 services)
* ``ssa``, ``ssap`` (synonymous for SSAP services)
* ``scs``, ``conesearch`` (synonymous for cone search services, prefer
``scs``)
* ``line`` (for SLAP services)
* ``tap``, ``table`` (synonymous for TAP services, prefer ``tap``)
* ``image`` (a deprecated alias for sia)
* ``image`` (a deprecated alias for sia1)
* ``spectrum`` (a deprecated alias for ssap)
You can also pass in the standards' ivoid (which
Expand Down
4 changes: 2 additions & 2 deletions pyvo/registry/tests/test_rtcons.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_multi(self):
" 'ivo://ivoa.net/std/sia')")

def test_includeaux(self):
assert (rtcons.Servicetype("http://extstandards/invention", "sia"
assert (rtcons.Servicetype("http://extstandards/invention", "sia1"
).include_auxiliary_services().get_search_condition(FAKE_GAVO)
== "standard_id IN ('http://extstandards/invention',"
" 'http://extstandards/invention#aux',"
Expand All @@ -161,7 +161,7 @@ def test_junk_rejected(self):
rtcons.Servicetype("junk")
assert str(excinfo.value) == ("Service type junk is neither"
" a full standard URI nor one of the bespoke identifiers"
" image, sia, spectrum, ssap, ssa, scs, conesearch, line, slap,"
" image, sia, sia1, spectrum, ssap, ssa, scs, conesearch, line, slap,"
" table, tap, sia2")

def test_legacy_term(self):
Expand Down

0 comments on commit 9c50df4

Please sign in to comment.