pyvo
Advanced tools
@@ -26,3 +26,3 @@ # This test job is separated out into its own workflow to be able to trigger separately | ||
| - name: Set up Python 3.12 | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -29,0 +29,0 @@ python-version: "3.12" |
@@ -46,3 +46,3 @@ # Developer version testing is in separate workflow | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -68,3 +68,3 @@ python-version: ${{ matrix.python-version }} | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -85,3 +85,3 @@ python-version: '3.10' | ||
| - name: Set up Python 3.8 | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -88,0 +88,0 @@ python-version: 3.8 |
+12
-0
@@ -0,1 +1,13 @@ | ||
| 1.5.2 (2024-05-22) | ||
| ================== | ||
| Bug Fixes | ||
| --------- | ||
| - Avoid Astropy Time error for SIAResult.dateobs when | ||
| VOX:Image_MJDateObs or ssa:DataID.Date is nan. [#550] | ||
| - More robust handling of SIA1 FORMAT [#545] | ||
| 1.5.1 (2024-02-21) | ||
@@ -2,0 +14,0 @@ ================== |
@@ -201,3 +201,3 @@ .. _pyvo-data-access: | ||
| >>> print([tab_name for tab_name in tap_service.tables.keys()]) # doctest: +IGNORE_WARNINGS | ||
| ['amanda.nucand', 'annisred.main', 'antares.data', ..., 'wise.main', 'xpparams.main', 'zcosmos.data'] | ||
| ['ivoa.obs_radio', 'ivoa.obscore', 'tap_schema.columns', 'tap_schema.tables',..., 'taptest.main', 'veronqsos.data', 'vlastripe82.stripe82'] | ||
@@ -204,0 +204,0 @@ |
@@ -337,3 +337,3 @@ .. _pyvo-registry: | ||
| >>> for service in archives: | ||
| ... print(service.res_title, service.access_url) | ||
| ... print(service.res_title, service.access_url) # doctest: +IGNORE_OUTPUT | ||
| Chandra X-ray Observatory Data Archive https://cda.harvard.edu/cxcsiap/queryImages? | ||
@@ -340,0 +340,0 @@ Chandra Source Catalog http://cda.cfa.harvard.edu/cscsiap/queryImages? |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: pyvo | ||
| Version: 1.5.1 | ||
| Version: 1.5.2 | ||
| Summary: Astropy affiliated package for accessing Virtual Observatory data and services | ||
@@ -5,0 +5,0 @@ Author: the PyVO Developers |
| Metadata-Version: 2.1 | ||
| Name: pyvo | ||
| Version: 1.5.1 | ||
| Version: 1.5.2 | ||
| Summary: Astropy affiliated package for accessing Virtual Observatory data and services | ||
@@ -5,0 +5,0 @@ Author: the PyVO Developers |
@@ -33,3 +33,3 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| SODA_SYNC_IVOID = 'ivo://ivoa.net/std/SODA#sync-1.0' | ||
| SODA_SYNC_IVOID = 'ivo://ivoa.net/std/SODA#sync-1' | ||
| DATALINK_IVOID = 'ivo://ivoa.net/std/datalink' | ||
@@ -113,3 +113,2 @@ | ||
| super().__init__(votable, url=url, session=session) | ||
| self._adhocservices = list( | ||
@@ -116,0 +115,0 @@ resource for resource in votable.resources |
+19
-7
@@ -38,2 +38,3 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| from astropy.units import Quantity, Unit | ||
| import numpy as np | ||
@@ -509,6 +510,14 @@ from .query import DALResults, DALQuery, DALService, Record | ||
| if isinstance(format_, (str, bytes)): | ||
| format_ = [format_] | ||
| if not isinstance(format_, list): | ||
| format_ = format_.split(',') | ||
| normalized_formats = [] | ||
| for user_input in format_: | ||
| if user_input.upper() in ['ALL', 'METADATA', 'GRAPHIC', 'GRAPHIC-ALL']: | ||
| normalized_formats.append(user_input.upper()) | ||
| elif user_input.split('-')[0].upper() == 'GRAPHIC': | ||
| normalized_formats.append(user_input.split('-')[0].upper()+"-"+user_input.split('-')[1]) | ||
| else: | ||
| normalized_formats.append(user_input) | ||
| self["FORMAT"] = ",".join(_.upper() for _ in format_) | ||
| self["FORMAT"] = ",".join(normalized_formats) | ||
@@ -707,6 +716,9 @@ @format.deleter | ||
| dateobs = self.getbyucd("VOX:Image_MJDateObs") | ||
| if dateobs: | ||
| return Time(dateobs, format="mjd") | ||
| else: | ||
| return None | ||
| try: | ||
| if not dateobs or np.isnan(dateobs): | ||
| return None | ||
| except TypeError: | ||
| # np.isnan can only check floats. If can't check for nan, pass it along | ||
| pass | ||
| return Time(dateobs, format="mjd") | ||
@@ -713,0 +725,0 @@ @property |
+8
-4
@@ -42,2 +42,3 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| from astropy.table import Table | ||
| import numpy as np | ||
@@ -702,6 +703,9 @@ from .query import DALResults, DALQuery, DALService, Record | ||
| dateobs = self.getbyutype("ssa:DataID.Date", decode=True) | ||
| if dateobs: | ||
| return Time(dateobs, format="iso") | ||
| else: | ||
| return None | ||
| try: | ||
| if not dateobs or np.isnan(dateobs): | ||
| return None | ||
| except TypeError: | ||
| # np.isnan can only check floats. If can't check for nan, pass it along | ||
| pass | ||
| return Time(dateobs, format="iso") | ||
@@ -708,0 +712,0 @@ @property |
+3
-1
@@ -969,3 +969,5 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| try: | ||
| response = self._session.post(self.url, data={"ACTION": "DELETE"}) | ||
| response = self._session.delete( | ||
| self.url, | ||
| allow_redirects=False) | ||
| response.raise_for_status() | ||
@@ -972,0 +974,0 @@ except requests.RequestException as ex: |
@@ -61,2 +61,16 @@ <?xml version="1.0" encoding="utf-8"?> | ||
| </TR> | ||
| <TR> | ||
| <TD>This should not be the dataurl</TD> | ||
| <TD>http://example.com/querydata/image.fits</TD> | ||
| <TD>image/fits</TD> | ||
| <TD>153280</TD> | ||
| <TD/> <!-- Empty VOX:Image_MJDateObs field --> | ||
| <TD>Test</TD> | ||
| <TD>288.95078924817</TD> | ||
| <TD>15.0322239971381</TD> | ||
| <TD>Test Observation</TD> | ||
| <TD>3.8e-07</TD> | ||
| <TD>5.2e-07</TD> | ||
| <TD>0.000403806 0.000406123</TD> | ||
| </TR> | ||
| </TABLEDATA> | ||
@@ -63,0 +77,0 @@ </DATA> |
@@ -212,2 +212,3 @@ <?xml version="1.0" encoding="UTF-8"?> | ||
| <TR><TD>8.441184510333563E-42</TD><TD>http://vaosa-vm1.aoc.nrao.edu/ivoa-dal/JhuSsapServlet?REQUEST=getData&FORMAT=votable&PubDID=ivo%3A%2F%2Fjhu%2Fsdss%2Fdr6%2Fspec%2F2.5%2380442261136998400</TD><TD>application/x-votable+xml</TD><TD>SPECTRUM-1.0</TD><TD>SPECTRUM</TD><TD>4000</TD><TD>s</TD><TD>A</TD><TD>10**(-17) erg s**(-1) cm**(-2) A**(-1)</TD><TD>SDSS J115918.12+005113.61 GALAXY</TD><TD>sdss</TD><TD>SDSS DR6</TD><TD>ivo://sdss/dr6/spec/2_5/#80442261136998400</TD><TD>2000-04-29 03:22:00Z</TD><TD>6.2.5</TD><TD>ivo://sdss/dr6/spec/2_5/#80442261136998400</TD><TD>SDSS 2.5-M SPEC2 v4_5</TD><TD>OPTICAL</TD><TD>SURVEY</TD><TD>ARCHIVAL</TD><TD>ELTE VO</TD><TD>ivo://jhu/sdss/dr6/spec/2.5#80442261136998400</TD><TD>PUBLIC</TD><TD>179.825520 0.853781</TD><TD>SDSS J115918.12+005113.61</TD><TD>GALAXY</TD><TD>0.0770941</TD><TD>0</TD><TD>FK5</TD><TD>2000</TD><TD>TAI</TD><TD>179.825520 0.853781</TD><TD></TD></TR> | ||
| <TR><TD>8.441184510333563E-42</TD><TD>http://vaosa-vm1.aoc.nrao.edu/ivoa-dal/JhuSsapServlet?REQUEST=getData&FORMAT=votable&PubDID=ivo%3A%2F%2Fjhu%2Fsdss%2Fdr6%2Fspec%2F2.5%2380442261136998400</TD><TD>application/x-votable+xml</TD><TD>SPECTRUM-1.0</TD><TD>SPECTRUM</TD><TD>4000</TD><TD>s</TD><TD>A</TD><TD>10**(-17) erg s**(-1) cm**(-2) A**(-1)</TD><TD>SDSS J115918.12+005113.61 GALAXY</TD><TD>sdss</TD><TD>SDSS DR6</TD><TD>ivo://sdss/dr6/spec/2_5/#80442261136998400</TD><TD/><!-- Empty VOX:Image_MJDateObs field --><TD>6.2.5</TD><TD>ivo://sdss/dr6/spec/2_5/#80442261136998400</TD><TD>SDSS 2.5-M SPEC2 v4_5</TD><TD>OPTICAL</TD><TD>SURVEY</TD><TD>ARCHIVAL</TD><TD>ELTE VO</TD><TD>ivo://jhu/sdss/dr6/spec/2.5#80442261136998400</TD><TD>PUBLIC</TD><TD>179.825520 0.853781</TD><TD>SDSS J115918.12+005113.61</TD><TD>GALAXY</TD><TD>0.0770941</TD><TD>0</TD><TD>FK5</TD><TD>2000</TD><TD>TAI</TD><TD>179.825520 0.853781</TD><TD></TD></TR> | ||
| </TABLEDATA> | ||
@@ -214,0 +215,0 @@ </DATA> |
@@ -11,3 +11,3 @@ #!/usr/bin/env python | ||
| from pyvo.dal.sia import search, SIAService | ||
| from pyvo.dal.sia import search, SIAService, SIAQuery | ||
@@ -51,4 +51,5 @@ from astropy.io.fits import HDUList | ||
| @pytest.mark.parametrize("position", ((288, 15), SkyCoord(288, 15, unit="deg"))) | ||
| def test_search(position): | ||
| results = search('http://example.com/sia', pos=position) | ||
| @pytest.mark.parametrize("format", ("IMAGE/JPEG", "all")) | ||
| def test_search(position, format): | ||
| results = search('http://example.com/sia', pos=position, format=format) | ||
| result = results[0] | ||
@@ -66,3 +67,5 @@ | ||
| def test_search(self): | ||
| service = SIAService('http://example.com/sia') | ||
| url = 'http://example.com/sia' | ||
| service = SIAService(url) | ||
| assert service.baseurl == url | ||
@@ -73,1 +76,19 @@ results = service.search(pos=(288, 15)) | ||
| _test_result(result) | ||
| assert results[1].dateobs is None | ||
| @pytest.mark.usefixtures('sia') | ||
| @pytest.mark.usefixtures('register_mocks') | ||
| @pytest.mark.filterwarnings("ignore::astropy.io.votable.exceptions.W06") | ||
| @pytest.mark.filterwarnings("ignore::astropy.io.votable.exceptions.W42") | ||
| @pytest.mark.filterwarnings("ignore::astropy.io.votable.exceptions.W49") | ||
| def test_formatter(self): | ||
| service = SIAQuery('http://example.com/sia') | ||
| service.format = "image" | ||
| assert service["FORMAT"] == "image" | ||
| service.format = "all" | ||
| assert service["FORMAT"] == "ALL" | ||
| service.format = "Graphic-png" | ||
| assert service["FORMAT"] == "GRAPHIC-png" | ||
| service.format = "Unsupported" | ||
| assert service["FORMAT"] == "Unsupported" |
@@ -36,3 +36,3 @@ #!/usr/bin/env python | ||
| results = search('http://example.com/ssa', pos=(0.0, 0.0), diameter=1.0) | ||
| assert len(results) == 35 | ||
| assert len(results) == 36 | ||
@@ -48,2 +48,3 @@ | ||
| assert len(results) == 35 | ||
| assert len(results) == 36 | ||
| assert results[35].dateobs is None |
| # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| from astropy.utils.collections import HomogeneousList | ||
| from astropy.utils.misc import indent | ||
| from textwrap import indent | ||
@@ -20,2 +20,5 @@ from astropy.io.votable.exceptions import vo_raise, warn_or_raise | ||
| INDENT = 4 * " " | ||
| ###################################################################### | ||
@@ -41,3 +44,3 @@ # ELEMENT CLASSES | ||
| print("Datamodel {}".format(self.content)) | ||
| print(indent(self.ivo_id)) | ||
| print(indent(self.ivo_id, INDENT)) | ||
| print() | ||
@@ -76,4 +79,4 @@ | ||
| if self.aliases: | ||
| print(indent('Also available as {}'.format( | ||
| ', '.join(self.aliases)))) | ||
| print(indent('Also available as {}'.format(', '.join(self.aliases)), | ||
| INDENT)) | ||
@@ -110,3 +113,3 @@ print() | ||
| print("Upload method supported") | ||
| print(indent(self.ivo_id)) | ||
| print(indent(self.ivo_id, INDENT)) | ||
| print() | ||
@@ -245,9 +248,9 @@ | ||
| for languagefeaturelist in self.languagefeaturelists: | ||
| print(indent(languagefeaturelist.type)) | ||
| print(indent(languagefeaturelist.type, INDENT)) | ||
| for feature in languagefeaturelist: | ||
| print(indent(feature.form, shift=2)) | ||
| print(indent(feature.form, 2 * INDENT)) | ||
| if feature.description: | ||
| print(indent(feature.description, shift=3)) | ||
| print(indent(feature.description, 3 * INDENT)) | ||
@@ -475,5 +478,5 @@ print() | ||
| print("Time a job is kept (in seconds)") | ||
| print(indent("Default {}".format(self.retentionperiod.default))) | ||
| print(indent("Default {}".format(self.retentionperiod.default), INDENT)) | ||
| if self.retentionperiod.hard: | ||
| print(indent("Maximum {}".format(self.retentionperiod.hard))) | ||
| print(indent("Maximum {}".format(self.retentionperiod.hard), INDENT)) | ||
| print() | ||
@@ -483,5 +486,5 @@ | ||
| print("Maximal run time of a job") | ||
| print(indent("Default {}".format(self.executionduration.default))) | ||
| print(indent("Default {}".format(self.executionduration.default), INDENT)) | ||
| if self.executionduration.hard: | ||
| print(indent("Maximum {}".format(self.executionduration.hard))) | ||
| print(indent("Maximum {}".format(self.executionduration.hard), INDENT)) | ||
| print() | ||
@@ -493,7 +496,7 @@ | ||
| self.outputlimit.default.content, | ||
| self.outputlimit.default.unit)) | ||
| self.outputlimit.default.unit), INDENT) | ||
| ) | ||
| if self.outputlimit.hard: | ||
| print(indent("Maximum {} {}".format( | ||
| self.outputlimit.hard.content, self.outputlimit.hard.unit)) | ||
| self.outputlimit.hard.content, self.outputlimit.hard.unit), INDENT) | ||
| ) | ||
@@ -505,3 +508,3 @@ print() | ||
| print(indent("Maximum {} {}".format( | ||
| self.uploadlimit.hard.content, self.uploadlimit.hard.unit))) | ||
| self.uploadlimit.hard.content, self.uploadlimit.hard.unit), INDENT)) | ||
| print() | ||
@@ -508,0 +511,0 @@ |
@@ -21,3 +21,3 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| from astropy.utils.collections import HomogeneousList | ||
| from astropy.utils.misc import indent | ||
| from textwrap import indent | ||
| from astropy.utils.xml import check as xml_check | ||
@@ -322,3 +322,3 @@ from astropy.io.votable.exceptions import vo_raise, vo_warn, warn_or_raise | ||
| if self.description is not None: | ||
| print(indent(self.description)) | ||
| print(indent(self.description, 4 * " ")) | ||
| else: | ||
@@ -325,0 +325,0 @@ print('No description') |
@@ -17,3 +17,3 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| from astropy.utils.collections import HomogeneousList | ||
| from astropy.utils.misc import indent | ||
| from textwrap import indent | ||
@@ -248,3 +248,3 @@ from ...utils.xml.elements import ( | ||
| print(indent(accessurls)) | ||
| print(indent(accessurls, 4 * " ")) | ||
@@ -251,0 +251,0 @@ print() |
+1
-1
@@ -8,2 +8,2 @@ # Note that we need to fall back to the hard-coded version if either | ||
| except Exception: | ||
| version = '1.5.1' | ||
| version = '1.5.2' |
+1
-1
@@ -22,3 +22,3 @@ [tool:pytest] | ||
| exclude = __init__.py, conf.py, setup.py, version.py, conftest.py | ||
| ignore = W503,E128,E131 | ||
| ignore = W503,E124,E127,E226,E128,E131 | ||
@@ -25,0 +25,0 @@ [pycodestyle] |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
2048741
0.17%17776
0.22%