Skip to content

Commit

Permalink
Merge pull request #422 from bsipocz/ENH_sia2_to_registry
Browse files Browse the repository at this point in the history
ENH: registry to find SIA v2 services
bsipocz authored Feb 21, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 03d5541 + 4f9dfce commit f10aff5
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -18,6 +18,8 @@
``SIA2_PARAMETERS_DESC``. The old names now issue an
``AstropyDeprecationWarning``. [#419]

- Registry search now finds SIA v2 services. [#422]


1.4 (2022-09-26)
================
5 changes: 3 additions & 2 deletions pyvo/registry/regtap.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
from astropy.utils.exceptions import AstropyDeprecationWarning

from . import rtcons
from ..dal import scs, sia, ssa, sla, tap, query as dalq
from ..dal import scs, sia, sia2, ssa, sla, tap, query as dalq
from ..io.vosi import vodataservice
from ..utils.formatting import para_format_desc

@@ -284,6 +284,7 @@ class Interface:
service_for_standardid = {
"ivo://ivoa.net/std/conesearch": scs.SCSService,
"ivo://ivoa.net/std/sia": sia.SIAService,
"ivo://ivoa.net/std/sia#query-2.0": sia2.SIA2Service,
"ivo://ivoa.net/std/ssa": ssa.SSAService,
"ivo://ivoa.net/std/sla": sla.SLAService,
"ivo://ivoa.net/std/tap": tap.TAPService}
@@ -874,7 +875,7 @@ def ivoid2service(ivoid, servicetype=None):
return service(s) for a given IVOID.
The servicetype option specifies the kind of service requested
(conesearch, sia, ssa, slap, or tap). By default, if none is
(conesearch, sia, sia2, ssa, slap, or tap). By default, if none is
given, a list of all matching services is returned.
"""
2 changes: 2 additions & 0 deletions pyvo/registry/rtcons.py
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@
for k, v in [
("image", "sia"),
("sia", "sia"),
("sia2", "sia#query-2.0"),
("spectrum", "ssa"),
("ssap", "ssa"),
("ssa", "ssa"),
@@ -257,6 +258,7 @@ class Servicetype(Constraint):
* ``image`` (image services; at this point equivalent to sia, but
scheduled to include sia2, too)
* ``sia`` (SIAP version 1 services)
* ``sia2`` (SIAP version 2 services)
* ``spectrum``, ``ssa``, ``ssap`` (all synonymous for spectral
services, prefer ``spectrum``)
* ``scs``, ``conesearch`` (synonymous for cone search services, prefer
12 changes: 12 additions & 0 deletions pyvo/registry/tests/test_regtap.py
Original file line number Diff line number Diff line change
@@ -776,3 +776,15 @@ def getflashcol(name):

assert (getflashcol("ssa_fluxcalib").description
== "Type of flux calibration")


@pytest.mark.remote_data
def test_sia_registry_searches():
# SIA2 services, e.g. Spitzer SEIP were originally not found by the registry search
image_services_v1 = regsearch(servicetype='sia')
image_services_v2 = regsearch(servicetype='sia2')

assert image_services_v1 != image_services_v2

assert len([s.ivoid for s in image_services_v2 if 'spitzer/images/seip' in s.ivoid]) > 0
assert len([s.ivoid for s in image_services_v1 if 'spitzer/images/seip' in s.ivoid]) == 0
2 changes: 1 addition & 1 deletion pyvo/registry/tests/test_rtcons.py
Original file line number Diff line number Diff line change
@@ -114,7 +114,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, sia2, spectrum, ssap, ssa, scs, conesearch, line, slap,"
" table, tap")

def test_legacy_term(self):

0 comments on commit f10aff5

Please sign in to comment.