From 0e8a6124a4f1fda2a71a23aee5e704d7ac38c89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sipo=CC=8Bcz?= Date: Wed, 15 Feb 2023 16:50:33 -0800 Subject: [PATCH 1/2] ENH: Adding SIA2 services to the registry --- pyvo/registry/regtap.py | 5 +++-- pyvo/registry/rtcons.py | 2 ++ pyvo/registry/tests/test_rtcons.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyvo/registry/regtap.py b/pyvo/registry/regtap.py index 7e5f00f4a..a074f1f4c 100644 --- a/pyvo/registry/regtap.py +++ b/pyvo/registry/regtap.py @@ -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. """ diff --git a/pyvo/registry/rtcons.py b/pyvo/registry/rtcons.py index 9db547db8..a0681c63b 100644 --- a/pyvo/registry/rtcons.py +++ b/pyvo/registry/rtcons.py @@ -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 diff --git a/pyvo/registry/tests/test_rtcons.py b/pyvo/registry/tests/test_rtcons.py index 54eb5043e..1841cd230 100644 --- a/pyvo/registry/tests/test_rtcons.py +++ b/pyvo/registry/tests/test_rtcons.py @@ -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): From 4f9dfce5a74394a372d7a226e13dd9f3653888e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brigitta=20Sip=C5=91cz?= Date: Wed, 15 Feb 2023 17:24:22 -0800 Subject: [PATCH 2/2] MAINT: adding test and changelog for sia2 registry search --- CHANGES.rst | 2 ++ pyvo/registry/tests/test_regtap.py | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 87851bda8..32058bcf6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) ================ diff --git a/pyvo/registry/tests/test_regtap.py b/pyvo/registry/tests/test_regtap.py index f9e2344a0..3bcb0d4ba 100644 --- a/pyvo/registry/tests/test_regtap.py +++ b/pyvo/registry/tests/test_regtap.py @@ -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