Skip to content

Commit

Permalink
DEP: votable.tree.Table was renamed to TableElement
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Oct 20, 2023
1 parent d564bc4 commit 5b280e4
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/dal/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ conventions.

If you want to work with the XML data structures
:py:class:`astropy.io.votable.tree.VOTableFile` or
:py:class:`astropy.io.votable.tree.Table`, they are accessible by the
:py:class:`astropy.io.votable.tree.TableElement`, they are accessible by the
attributes :py:attr:`pyvo.dal.DALResults.resultstable` and
:py:attr:`pyvo.dal.DALResults.votable`, respectively.

Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/adhoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class DatalinkResults(DatalinkResultsMixin, DALResults):
``DatalinkResults`` is essentially a wrapper around an Astropy
:py:mod:`~astropy.io.votable`
:py:class:`~astropy.io.votable.tree.Table` instance where the
:py:class:`~astropy.io.votable.tree.TableElement` instance where the
columns contain the various metadata describing the images.
One can access that VOTable directly via the
:py:attr:`~pyvo.dal.query.DALResults.votable` attribute. Thus,
Expand Down
4 changes: 2 additions & 2 deletions pyvo/dal/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def execute_votable(self, post=False):
Returns
-------
astropy.io.votable.tree.Table
astropy.io.votable.tree.TableElement
an Astropy votable Table instance
Raises
Expand Down Expand Up @@ -420,7 +420,7 @@ def votable(self):
@property
def resultstable(self):
"""
The votable XML element `astropy.io.votable.tree.Table`
The votable XML element `astropy.io.votable.tree.TableElement`
"""
return self._resultstable

Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/scs.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class SCSResults(DatalinkResultsMixin, DALResults):
``SCSResults`` is essentially a wrapper around an Astropy
:py:mod:`~astropy.io.votable`
:py:class:`~astropy.io.votable.tree.Table` instance where the
:py:class:`~astropy.io.votable.tree.TableElement` instance where the
columns contain the various metadata describing the images.
One can access that VOTable directly via the
:py:attr:`~pyvo.dal.query.DALResults.votable` attribute. Thus,
Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/sia.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ class SIAResults(DatalinkResultsMixin, DALResults):
``SIAResults`` is essentially a wrapper around an Astropy
:py:mod:`~astropy.io.votable`
:py:class:`~astropy.io.votable.tree.Table` instance where the
:py:class:`~astropy.io.votable.tree.TableElement` instance where the
columns contain the various metadata describing the images.
One can access that VOTable directly via the
:py:attr:`~pyvo.dal.query.DALResults.votable` attribute. Thus,
Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/sia2.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ class SIA2Results(DatalinkResultsMixin, DALResults):
``SIA2Results`` is essentially a wrapper around an Astropy
:py:mod:`~astropy.io.votable`
:py:class:`~astropy.io.votable.tree.Table` instance where the
:py:class:`~astropy.io.votable.tree.TableElement` instance where the
columns contain the various metadata describing the images.
One can access that VOTable directly via the
:py:attr:`~pyvo.dal.query.DALResults.votable` attribute. Thus,
Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/sla.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class SLAResults(DALResults):
``SLAResults`` is essentially a wrapper around an Astropy
:py:mod:`~astropy.io.votable`
:py:class:`~astropy.io.votable.tree.Table` instance where the
:py:class:`~astropy.io.votable.tree.TableElement` instance where the
columns contain the various metadata describing the images.
One can access that VOTable directly via the
:py:attr:`~pyvo.dal.query.DALResults.votable` attribute. Thus,
Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/ssa.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class SSAResults(DatalinkResultsMixin, DALResults):
``SSAResults`` is essentially a wrapper around an Astropy
:py:mod:`~astropy.io.votable`
:py:class:`~astropy.io.votable.tree.Table` instance where the
:py:class:`~astropy.io.votable.tree.TableElement` instance where the
columns contain the various metadata describing the spectra.
One can access that VOTable directly via the
:py:attr:`~pyvo.dal.query.DALResults.votable` attribute. Thus,
Expand Down
2 changes: 1 addition & 1 deletion pyvo/dal/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ class TAPResults(DatalinkResultsMixin, DALResults):
``TAPResults`` is essentially a wrapper around an Astropy
:py:mod:`~astropy.io.votable`
:py:class:`~astropy.io.votable.tree.Table` instance where the
:py:class:`~astropy.io.votable.tree.TableElement` instance where the
columns contain the various metadata describing the images.
One can access that VOTable directly via the
:py:attr:`~pyvo.dal.query.DALResults.votable` attribute. Thus,
Expand Down
12 changes: 9 additions & 3 deletions pyvo/dal/tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
from pyvo.version import version

from astropy.table import Table, QTable
from astropy.io.votable.tree import VOTableFile, Table as VOTable
from astropy.io.fits import HDUList
from astropy.io.votable.tree import VOTableFile

try:
# Workaround astropy deprecation, remove try/except once >=6.0 is required
from astropy.io.votable.tree import TableElement
except ImportError:
from astropy.io.votable.tree import Table as TableElement

from astropy.io.fits import HDUList
from astropy.utils.data import get_pkg_data_contents

get_pkg_data_contents = partial(
Expand Down Expand Up @@ -271,7 +277,7 @@ def test_init(self):

assert dalresults.queryurl == 'http://example.com/query/basic'
assert isinstance(dalresults.votable, VOTableFile)
assert isinstance(dalresults.resultstable, VOTable)
assert isinstance(dalresults.resultstable, TableElement)

assert dalresults.fieldnames == ('1', '2')
assert (
Expand Down

0 comments on commit 5b280e4

Please sign in to comment.