Skip to content

Commit

Permalink
Updating global discovery test cases.
Browse files Browse the repository at this point in the history
This is mainly about using 1=contains rather than distance in the obscore
queries; we also had to update the RegTAP capability.xml in the registry
test to bring it in line with what the discover tests do.  A better
isolation of these test suites would be desirable; but then we don't want
forsake capabilities caching altogether either...

Also, sneaking in a few formatting problems.
  • Loading branch information
msdemlei committed Feb 26, 2024
1 parent bb42fea commit e6ca7bc
Show file tree
Hide file tree
Showing 41 changed files with 282 additions and 209 deletions.
2 changes: 1 addition & 1 deletion pyvo/dal/sia.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def bandpass_refvalue(self):
"""
value = self.getbyucd("VOX:BandPass_RefValue")
if value is not None and self.bandpass_unit:
return Quantity(val, self.bandpass_unit)
return Quantity(value, self.bandpass_unit)

@property
def bandpass_hilimit(self):
Expand Down
3 changes: 1 addition & 2 deletions pyvo/discover/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

# imports for type hints
from typing import Callable, Generator, List, Optional, Set, Tuple
from astropy import time
from astropy.units import quantity


Expand Down Expand Up @@ -291,7 +290,7 @@ def _discover_obscore_services(self, *constraints):
new_style_access_urls = set()
for rec in obscore_services:
new_style_access_urls |= set(
i.baseurl for i in rec.list_services("tap"))
i.access_url for i in rec.list_interfaces("tap"))

for tap_rec in tap_services_with_obscore:
access_urls = set(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<VOTABLE version="1.4" xmlns="http://www.ivoa.net/xml/VOTable/v1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://vo.ari.uni-heidelberg.de/docs/schemata/VOTable-1.4.xsd"><DESCRIPTION>Definition and support code for the ObsCore data model and table.</DESCRIPTION><RESOURCE type="results"><INFO name="queryPars" value="(%(BAND0)s &gt;= em_min AND em_max &gt;= %(BAND0)s) AND (%(TIME0)s &gt;= t_min AND t_max &gt;= %(TIME0)s) AND (dataproduct_type in ('image', 'cube'))">{'BAND0': 4.0000000000000003e-07, 'TIME0': 18867.0}</INFO><INFO name="QUERY_STATUS" value="OK"></INFO><INFO name="request" value="/__system__/siap2/sitewide/siap2.xml?BAND=4.0000000000000003e-07+4.0000000000000003e-07&amp;TIME=18867.0+18867.0"></INFO><INFO name="standardID" value="ivo://ivoa.net/std/sia">Written by DaCHS 2.9.2 SIAP2Renderer</INFO><INFO name="server_software" value="DaCHS/2.9.2 twistedWeb/20.3.0">Software that produced this VOTable</INFO><INFO name="server" value="http://dc.zah.uni-heidelberg.de">Base URI of the server</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore#ti-citing">Advice on citing this resource</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/__system__/siap2/sitewide/howtocite">Advice on citing this resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/obscore/ObsCore">Originating VO resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/siap2/sitewide">Originating VO resource</INFO><INFO name="publisher" value="The GAVO DC team">Data centre that has delivered the data</INFO><INFO name="request_date" ucd="time.creation" value="2024-02-12T12:56:07Z"></INFO><INFO name="contact" ucd="meta.email" value="[email protected]">Contact option</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore">More information on the data Source</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/__system__/siap2/sitewide/info">More information on the data Source</INFO><INFO name="creator" ucd="meta.bib.author" value="GAVO Data Center">Name of a person or entity that produced a contributing resource</INFO><COOSYS ID="system" system="ICRS"/><TABLE name="result" utype="ivo://ivoa.net/std/obscore#table-1.1"><DESCRIPTION>The IVOA-defined obscore table, containing generic metadata for
datasets within this datacenter.</DESCRIPTION><GROUP utype="stc:CatalogEntryLocation"><PARAM arraysize="*" datatype="char" name="CoordFlavor" utype="stc:AstroCoordSystem.SpaceFrame.CoordFlavor" value="SPHERICAL"/><PARAM arraysize="*" datatype="char" name="CoordRefFrame" utype="stc:AstroCoordSystem.SpaceFrame.CoordRefFrame" value="ICRS"/><PARAM arraysize="*" datatype="char" name="URI" utype="stc:DataModel.URI" value="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"/><FIELDref ref="s_region" utype="stc:AstroCoordArea.Polygon"/></GROUP><GROUP ID="ndnppnaubdua" name="note-calib"><DESCRIPTION>
<VOTABLE version="1.4" xmlns="http://www.ivoa.net/xml/VOTable/v1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://vo.ari.uni-heidelberg.de/docs/schemata/VOTable-1.4.xsd"><DESCRIPTION>Definition and support code for the ObsCore data model and table.</DESCRIPTION><RESOURCE type="results"><INFO name="queryPars" value="(%(BAND0)s &gt;= em_min AND em_max &gt;= %(BAND0)s) AND (%(TIME0)s &gt;= t_min AND t_max &gt;= %(TIME0)s) AND (dataproduct_type in ('image', 'cube'))">{'BAND0': 4.0000000000000003e-07, 'TIME0': 18867.0}</INFO><INFO name="QUERY_STATUS" value="OK"></INFO><INFO name="request" value="/__system__/siap2/sitewide/siap2.xml?BAND=4.0000000000000003e-07+4.0000000000000003e-07&amp;TIME=18867.0+18867.0"></INFO><INFO name="standardID" value="ivo://ivoa.net/std/sia">Written by DaCHS 2.9.2 SIAP2Renderer</INFO><INFO name="server_software" value="DaCHS/2.9.2 twistedWeb/20.3.0">Software that produced this VOTable</INFO><INFO name="server" value="http://dc.zah.uni-heidelberg.de">Base URI of the server</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore#ti-citing">Advice on citing this resource</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/__system__/siap2/sitewide/howtocite">Advice on citing this resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/obscore/ObsCore">Originating VO resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/siap2/sitewide">Originating VO resource</INFO><INFO name="publisher" value="The GAVO DC team">Data centre that has delivered the data</INFO><INFO name="request_date" ucd="time.creation" value="2024-02-26T09:32:59Z"></INFO><INFO name="contact" ucd="meta.email" value="[email protected]">Contact option</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore">More information on the data Source</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/__system__/siap2/sitewide/info">More information on the data Source</INFO><INFO name="creator" ucd="meta.bib.author" value="GAVO Data Center">Name of a person or entity that produced a contributing resource</INFO><COOSYS ID="system" system="ICRS"/><TABLE name="result" utype="ivo://ivoa.net/std/obscore#table-1.1"><DESCRIPTION>The IVOA-defined obscore table, containing generic metadata for
datasets within this datacenter.</DESCRIPTION><GROUP utype="stc:CatalogEntryLocation"><PARAM arraysize="*" datatype="char" name="CoordFlavor" utype="stc:AstroCoordSystem.SpaceFrame.CoordFlavor" value="SPHERICAL"/><PARAM arraysize="*" datatype="char" name="CoordRefFrame" utype="stc:AstroCoordSystem.SpaceFrame.CoordRefFrame" value="ICRS"/><PARAM arraysize="*" datatype="char" name="URI" utype="stc:DataModel.URI" value="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"/><FIELDref ref="s_region" utype="stc:AstroCoordArea.Polygon"/></GROUP><GROUP ID="ndiupibsnnda" name="note-calib"><DESCRIPTION>
The calib_level flag takes the following values:

=== ===========================================================
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<VOTABLE version="1.4" xmlns="http://www.ivoa.net/xml/VOTable/v1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://vo.ari.uni-heidelberg.de/docs/schemata/VOTable-1.4.xsd"><DESCRIPTION>Definition and support code for the ObsCore data model and table.</DESCRIPTION><RESOURCE type="results"><INFO name="sql_query" value="SELECT ivoa.obscore.dataproduct_type, ivoa.obscore.dataproduct_subtype, ivoa.obscore.calib_level, ivoa.obscore.obs_collection, ivoa.obscore.obs_id, ivoa.obscore.obs_title, ivoa.obscore.obs_publisher_did, ivoa.obscore.obs_creator_did, ivoa.obscore.access_url, ivoa.obscore.access_format, ivoa.obscore.access_estsize, ivoa.obscore.target_name, ivoa.obscore.target_class, ivoa.obscore.s_ra, ivoa.obscore.s_dec, ivoa.obscore.s_fov, ivoa.obscore.s_region, ivoa.obscore.s_resolution, ivoa.obscore.t_min, ivoa.obscore.t_max, ivoa.obscore.t_exptime, ivoa.obscore.t_resolution, ivoa.obscore.em_min, ivoa.obscore.em_max, ivoa.obscore.em_res_power, ivoa.obscore.o_ucd, ivoa.obscore.pol_states, ivoa.obscore.facility_name, ivoa.obscore.instrument_name, ivoa.obscore.s_xel1, ivoa.obscore.s_xel2, ivoa.obscore.t_xel, ivoa.obscore.em_xel, ivoa.obscore.pol_xel, ivoa.obscore.s_pixel_scale, ivoa.obscore.em_ucd, ivoa.obscore.preview, ivoa.obscore.source_table FROM ivoa.obscore WHERE dataproduct_type = 'image' AND ( em_min &lt;= 4.0000000000000003e-07 AND em_max &gt;= 4.0000000000000003e-07 ) AND ( t_max &gt;= 18867.0 AND 18867.0 &gt;= t_min AND t_min &lt;= t_max AND 18867.0 &lt;= 18867.0 ) LIMIT 20000">ADQL query translated to local SQL (for debugging)</INFO><INFO name="query" value="select * from ivoa.obscore WHERE dataproduct_type='image' AND (em_min&lt;=4.0000000000000003e-07 AND em_max&gt;=4.0000000000000003e-07) AND (t_max&gt;=18867.0 AND 18867.0&gt;=t_min AND t_min&lt;=t_max AND 18867.0&lt;=18867.0)">Original ADQL query</INFO><INFO name="QUERY_STATUS" value="OK">Query successful</INFO><INFO name="server_software" value="DaCHS/2.9.2 twistedWeb/20.3.0">Software that produced this VOTable</INFO><INFO name="server" value="http://dc.zah.uni-heidelberg.de">Base URI of the server</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore#ti-citing">Advice on citing this resource</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/__system__/tap/run/howtocite">Advice on citing this resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/obscore/ObsCore">Originating VO resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/tap/run">Originating VO resource</INFO><INFO name="publisher" value="The GAVO DC team">Data centre that has delivered the data</INFO><INFO name="request_date" ucd="time.creation" value="2024-02-12T12:43:37Z"></INFO><INFO name="contact" ucd="meta.email" value="[email protected]">Contact option</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore">More information on the data Source</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/__system__/tap/run/info">More information on the data Source</INFO><INFO name="creator" ucd="meta.bib.author" value="GAVO Data Center">Name of a person or entity that produced a contributing resource</INFO><COOSYS ID="system" system="ICRS"/><TABLE name="ObsCore" utype="ivo://ivoa.net/std/obscore#table-1.1"><DESCRIPTION>The IVOA-defined obscore table, containing generic metadata for
datasets within this datacenter.</DESCRIPTION><GROUP utype="stc:CatalogEntryLocation"><PARAM arraysize="*" datatype="char" name="CoordFlavor" utype="stc:AstroCoordSystem.SpaceFrame.CoordFlavor" value="SPHERICAL"/><PARAM arraysize="*" datatype="char" name="CoordRefFrame" utype="stc:AstroCoordSystem.SpaceFrame.CoordRefFrame" value="ICRS"/><PARAM arraysize="*" datatype="char" name="URI" utype="stc:DataModel.URI" value="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"/><FIELDref ref="s_region" utype="stc:AstroCoordArea.Polygon"/></GROUP><GROUP ID="ndnppnaubdua" name="note-calib"><DESCRIPTION>
<VOTABLE version="1.4" xmlns="http://www.ivoa.net/xml/VOTable/v1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://vo.ari.uni-heidelberg.de/docs/schemata/VOTable-1.4.xsd"><DESCRIPTION>Definition and support code for the ObsCore data model and table.</DESCRIPTION><RESOURCE type="results"><INFO name="sql_query" value="SELECT ivoa.obscore.dataproduct_type, ivoa.obscore.dataproduct_subtype, ivoa.obscore.calib_level, ivoa.obscore.obs_collection, ivoa.obscore.obs_id, ivoa.obscore.obs_title, ivoa.obscore.obs_publisher_did, ivoa.obscore.obs_creator_did, ivoa.obscore.access_url, ivoa.obscore.access_format, ivoa.obscore.access_estsize, ivoa.obscore.target_name, ivoa.obscore.target_class, ivoa.obscore.s_ra, ivoa.obscore.s_dec, ivoa.obscore.s_fov, ivoa.obscore.s_region, ivoa.obscore.s_resolution, ivoa.obscore.t_min, ivoa.obscore.t_max, ivoa.obscore.t_exptime, ivoa.obscore.t_resolution, ivoa.obscore.em_min, ivoa.obscore.em_max, ivoa.obscore.em_res_power, ivoa.obscore.o_ucd, ivoa.obscore.pol_states, ivoa.obscore.facility_name, ivoa.obscore.instrument_name, ivoa.obscore.s_xel1, ivoa.obscore.s_xel2, ivoa.obscore.t_xel, ivoa.obscore.em_xel, ivoa.obscore.pol_xel, ivoa.obscore.s_pixel_scale, ivoa.obscore.em_ucd, ivoa.obscore.preview, ivoa.obscore.source_table FROM ivoa.obscore WHERE dataproduct_type = 'image' AND ( em_min &lt;= 4.0000000000000003e-07 AND em_max &gt;= 4.0000000000000003e-07 ) AND ( t_max &gt;= 18867.0 AND 18867.0 &gt;= t_min AND t_min &lt;= t_max AND 18867.0 &lt;= 18867.0 ) LIMIT 20000">ADQL query translated to local SQL (for debugging)</INFO><INFO name="query" value="select * from ivoa.obscore WHERE dataproduct_type='image' AND (em_min&lt;=4.0000000000000003e-07 AND em_max&gt;=4.0000000000000003e-07) AND (t_max&gt;=18867.0 AND 18867.0&gt;=t_min AND t_min&lt;=t_max AND 18867.0&lt;=18867.0)">Original ADQL query</INFO><INFO name="QUERY_STATUS" value="OK">Query successful</INFO><INFO name="server_software" value="DaCHS/2.9.2 twistedWeb/20.3.0">Software that produced this VOTable</INFO><INFO name="server" value="http://dc.zah.uni-heidelberg.de">Base URI of the server</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore#ti-citing">Advice on citing this resource</INFO><INFO name="citation" ucd="" value="http://dc.zah.uni-heidelberg.de/__system__/tap/run/howtocite">Advice on citing this resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/obscore/ObsCore">Originating VO resource</INFO><INFO name="ivoid" ucd="meta.ref.ivoid" value="ivo://org.gavo.dc/__system__/tap/run">Originating VO resource</INFO><INFO name="publisher" value="The GAVO DC team">Data centre that has delivered the data</INFO><INFO name="request_date" ucd="time.creation" value="2024-02-26T09:32:59Z"></INFO><INFO name="contact" ucd="meta.email" value="[email protected]">Contact option</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/tableinfo/ivoa.ObsCore">More information on the data Source</INFO><INFO name="reference_url" ucd="meta.ref.url" value="http://dc.zah.uni-heidelberg.de/__system__/tap/run/info">More information on the data Source</INFO><INFO name="creator" ucd="meta.bib.author" value="GAVO Data Center">Name of a person or entity that produced a contributing resource</INFO><COOSYS ID="system" system="ICRS"/><TABLE name="ObsCore" utype="ivo://ivoa.net/std/obscore#table-1.1"><DESCRIPTION>The IVOA-defined obscore table, containing generic metadata for
datasets within this datacenter.</DESCRIPTION><GROUP utype="stc:CatalogEntryLocation"><PARAM arraysize="*" datatype="char" name="CoordFlavor" utype="stc:AstroCoordSystem.SpaceFrame.CoordFlavor" value="SPHERICAL"/><PARAM arraysize="*" datatype="char" name="CoordRefFrame" utype="stc:AstroCoordSystem.SpaceFrame.CoordRefFrame" value="ICRS"/><PARAM arraysize="*" datatype="char" name="URI" utype="stc:DataModel.URI" value="http://www.ivoa.net/xml/STC/stc-v1.30.xsd"/><FIELDref ref="s_region" utype="stc:AstroCoordArea.Polygon"/></GROUP><GROUP ID="ndiupibsnnda" name="note-calib"><DESCRIPTION>
The calib_level flag takes the following values:

=== ===========================================================
Expand Down
Binary file not shown.
Loading

0 comments on commit e6ca7bc

Please sign in to comment.