Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve intersphinx to astropy as current build #11690

Merged
merged 6 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion astropy/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def set_enabled_constants(modname):
"""
Context manager to temporarily set values in the ``constants``
namespace to an older version.
See :ref:`astropy-constants-prior` for usage.
See :ref:`astropy:astropy-constants-prior` for usage.

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions astropy/coordinates/builtin_frames/equatorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class TETE(BaseRADecFrame):
with local apparent sidereal time to calculate the apparent (TIRS) hour angle.

For more background on TETE, see the references provided in the
:ref:`astropy-coordinates-seealso` section of the documentation.
:ref:`astropy:astropy-coordinates-seealso` section of the documentation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These astropy:astropy references are unfortunate. I won't ask you to change them, but I wonder why those labels contained "astropy-" in the first place. Seems redundant. We can deal with that in a follow-up, if at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I didn't like those either. And they're now doubly redundant.

Of particular note are Sections 5 and 6 of
`USNO Circular 179 <https://arxiv.org/abs/astro-ph/0602086>`_) and
especially the diagram at the top of page 57.
Expand Down Expand Up @@ -96,7 +96,7 @@ class TEME(BaseCoordinateFrame):
conventions and relations to other frames that are set out in Vallado et al (2006).

For more background on TEME, see the references provided in the
:ref:`astropy-coordinates-seealso` section of the documentation.
:ref:`astropy:astropy-coordinates-seealso` section of the documentation.
"""

default_representation = CartesianRepresentation
Expand Down
5 changes: 3 additions & 2 deletions astropy/coordinates/builtin_frames/galactocentric.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class galactocentric_frame_defaults(ScienceState):
:meth:`~galactocentric_frame_defaults.get_from_registry` since
it ensures the immutability of the registry.

See :ref:`astropy-coordinates-galactocentric-defaults` for more information.
See :ref:`astropy:astropy-coordinates-galactocentric-defaults` for more
information.

Examples
--------
Expand Down Expand Up @@ -461,7 +462,7 @@ class Galactocentric(BaseCoordinateFrame):
roughly towards the North Galactic Pole (:math:`b=90^\circ`).

For a more detailed look at the math behind this transformation, see
the document :ref:`coordinates-galactocentric`.
the document :ref:`astropy:coordinates-galactocentric`.

The frame attributes are listed under **Other Parameters**.
"""
Expand Down
2 changes: 1 addition & 1 deletion astropy/coordinates/builtin_frames/gcrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class GCRS(BaseRADecFrame):
center-of-mass rather than the solar system Barycenter. That means this
frame includes the effects of aberration (unlike ICRS). For more background
on the GCRS, see the references provided in the
:ref:`astropy-coordinates-seealso` section of the documentation. (Of
:ref:`astropy:astropy-coordinates-seealso` section of the documentation. (Of
particular note is Section 1.2 of
`USNO Circular 179 <https://arxiv.org/abs/astro-ph/0602086>`_)

Expand Down
4 changes: 2 additions & 2 deletions astropy/coordinates/builtin_frames/hcrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class HCRS(BaseRADecFrame):
of the order of 8 milli-arcseconds.

For more background on the ICRS and related coordinate transformations, see
the references provided in the :ref:`astropy-coordinates-seealso` section of
the documentation.
the references provided in the :ref:`astropy:astropy-coordinates-seealso`
section of the documentation.

The frame attributes are listed under **Other Parameters**.
"""
Expand Down
4 changes: 2 additions & 2 deletions astropy/coordinates/builtin_frames/icrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class ICRS(BaseRADecFrame):
very close (within tens of milliarcseconds) to J2000 equatorial.

For more background on the ICRS and related coordinate transformations, see
the references provided in the :ref:`astropy-coordinates-seealso` section
of the documentation.
the references provided in the :ref:`astropy:astropy-coordinates-seealso`
section of the documentation.
"""
2 changes: 1 addition & 1 deletion astropy/coordinates/builtin_frames/itrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ITRS(BaseCoordinateFrame):
(ITRS). This is approximately a geocentric system, although strictly it is
defined by a series of reference locations near the surface of the Earth.
For more background on the ITRS, see the references provided in the
:ref:`astropy-coordinates-seealso` section of the documentation.
:ref:`astropy:astropy-coordinates-seealso` section of the documentation.
"""

default_representation = CartesianRepresentation
Expand Down
2 changes: 1 addition & 1 deletion astropy/coordinates/builtin_frames/skyoffset.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class SkyOffsetFrame(BaseCoordinateFrame):
object's ``lat`` will be pointed in the direction of Dec, while ``lon``
will point in the direction of RA.

For more on skyoffset frames, see :ref:`astropy-skyoffset-frames`.
For more on skyoffset frames, see :ref:`astropy:astropy-skyoffset-frames`.

Parameters
----------
Expand Down
12 changes: 6 additions & 6 deletions astropy/coordinates/sky_coordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def separation(self, other):
not give the same answer in this case.

For more on how to use this (and related) functionality, see the
examples in :doc:`/coordinates/matchsep`.
examples in :doc:`astropy:/coordinates/matchsep`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been following the various conversation on Sphinx xref and just by looking at this diff, I don't understand why this is needed in the core repo. Why not use the built-in Sphinx :ref: again? What is an example use case where this would benefit affiliated package? Thanks!

Copy link
Member Author

@nstarman nstarman May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the built-in Sphinx :ref: again?

The link is to a :doc:, not a specific section, so :ref: can't be used. Perhaps the link could be changed entirely, but for page references :doc: is the Sphinx built-in.

What is an example use case where this would benefit affiliated package?

In this case, for subclassing SkyCoord. Both :doc: and :ref: are not inter-sphinxed automatically, so any link in the SkyCoord subclass can break when building the docs (if warnings -> errors). This PR enables astropy to set up internal links as if they were intersphinx links, but have them be interpreted as internal links. Affiliate packages would see these links as intersphinx links. This is quite similar to the astropy-dev label, where Astropy sees it as internal (if it's the dev build), while affiliate packages see it as an intersphinx.

I hope this PR will enable astropy to provide more links in docstrings and affiliate packages won't have to worry about a thing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find any documentation of :doc: in the official Sphinx doc (which is kinda ironic), can you please link me to its doc? Thanks!

As for :ref: intersphinx, I haven't seen a problem downstream where I use ~astropy.coordinates.SkyCoord and so on. I did see a problem when the doc here refers to simply SkyCoord but the fix is to mention the full namespace in core API doc.

As for referring to page vs section, I don't see the point of the former. Why not have a :ref: at the top of the page and then use :ref:?

Sorry if all these had been discussed before. If so, please point me to the old discussions. Thanks for your patience!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I do remember discussion quite a while ago that docstrings should use proper http links so that people who see them in an interactive session can actually follow them....

But in that respect the scheme with :doc: is better than a :ref: - with that, the user truly has no hope to find this except by going to the docstring online. Also, the :doc:astrop seems a nice clear marker. Plus, this scheme has the advantage over an http link that we'll notice breakage sooner.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question: is the / in front of /coordinates necessary? Or does it try to find the link in the local environment of the SkyCoord docstring rendering otherwise?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. It makes sense now. The whole sphinx stuff remains a bit of black magic to me... Not sure that expanding the changelog will be needed; if anything, we'd need some docs for affiliate package maintainers, but not clear how they would find that... So, let's just stick with fixing a possible bug with subclassing SkyCoord here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing a project to refer to itself via intersphinx seems generically useful for protecting from docstring inheritance. I wish sphinx did this automatically.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think I get it now. I was thinking about :ref: in docstring pointing to another API, but here you are talking about human doc.

Is this PR standalone or it depends on the other PR you opened over at sphinx-astropy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is standalone in that it works and does the docs stuff independently.

It's definitely part of a larger push to make intersphinx and particularly xref useful for downstream packages. In some respects, this PR is the foundation on which future PRs can be built since all the downstream packages need astropy xref links to be intersphinxed, but without this PR, those links wouldn't work inside of Astropy. Now sphinx-astropy will work equally well for both Astropy and downstream packages.


Parameters
----------
Expand Down Expand Up @@ -1081,7 +1081,7 @@ def separation_3d(self, other):
and another.

For more on how to use this (and related) functionality, see the
examples in :doc:`/coordinates/matchsep`.
examples in :doc:`astropy:/coordinates/matchsep`.

Parameters
----------
Expand Down Expand Up @@ -1259,7 +1259,7 @@ def match_to_catalog_sky(self, catalogcoord, nthneighbor=1):
catalog coordinates.

For more on how to use this (and related) functionality, see the
examples in :doc:`/coordinates/matchsep`.
examples in :doc:`astropy:/coordinates/matchsep`.

Parameters
----------
Expand Down Expand Up @@ -1324,7 +1324,7 @@ def match_to_catalog_3d(self, catalogcoord, nthneighbor=1):
``catalogcoord`` object.

For more on how to use this (and related) functionality, see the
examples in :doc:`/coordinates/matchsep`.
examples in :doc:`astropy:/coordinates/matchsep`.

Parameters
----------
Expand Down Expand Up @@ -1389,7 +1389,7 @@ def search_around_sky(self, searcharoundcoords, seplimit):
`~astropy.coordinates.SkyCoord.separation`.

For more on how to use this (and related) functionality, see the
examples in :doc:`/coordinates/matchsep`.
examples in :doc:`astropy:/coordinates/matchsep`.

Parameters
----------
Expand Down Expand Up @@ -1448,7 +1448,7 @@ def search_around_3d(self, searcharoundcoords, distlimit):
`~astropy.coordinates.SkyCoord.separation_3d`.

For more on how to use this (and related) functionality, see the
examples in :doc:`/coordinates/matchsep`.
examples in :doc:`astropy:/coordinates/matchsep`.

Parameters
----------
Expand Down
3 changes: 2 additions & 1 deletion astropy/coordinates/spectral_quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def to(self, unit,
by the `~astropy.units` package, and should be a spectral unit.
equivalencies : list of `~astropy.units.equivalencies.Equivalency`, optional
A list of equivalence pairs to try if the units are not
directly convertible (along with spectral). See :ref:`unit_equivalencies`.
directly convertible (along with spectral).
See :ref:`astropy:unit_equivalencies`.
If not provided or ``[]``, spectral equivalencies will be used.
If `None`, no equivalencies will be applied at all, not even any
set globally or within a context.
Expand Down
6 changes: 3 additions & 3 deletions astropy/io/ascii/fixedwidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class FixedWidth(basic.Basic):
1.2hello there 3
2.4many words 7

See the :ref:`fixed_width_gallery` for specific usage examples.
See the :ref:`astropy:fixed_width_gallery` for specific usage examples.

"""
_format_name = 'fixed_width'
Expand Down Expand Up @@ -342,7 +342,7 @@ class FixedWidthNoHeader(FixedWidth):
This class is just a convenience wrapper around the ``FixedWidth`` reader
but with ``header_start=None`` and ``data_start=0``.

See the :ref:`fixed_width_gallery` for specific usage examples.
See the :ref:`astropy:fixed_width_gallery` for specific usage examples.

"""
_format_name = 'fixed_width_no_header'
Expand Down Expand Up @@ -399,7 +399,7 @@ class FixedWidthTwoLine(FixedWidth):
| 2.4 | there world|
+------+------------+

See the :ref:`fixed_width_gallery` for specific usage examples.
See the :ref:`astropy:fixed_width_gallery` for specific usage examples.

"""
_format_name = 'fixed_width_two_line'
Expand Down
2 changes: 1 addition & 1 deletion astropy/io/ascii/ipac.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class Ipac(basic.Basic):
of missing or bad data. On writing, this value defaults to ``null``.
To specify a different null value, use the ``fill_values`` option to
replace masked values with a string or number of your choice as
described in :ref:`io_ascii_write_parameters`::
described in :ref:`astropy:io_ascii_write_parameters`::

>>> from astropy.io.ascii import masked
>>> fill = [(masked, 'N/A', 'ra'), (masked, -999, 'sptype')]
Expand Down
2 changes: 1 addition & 1 deletion astropy/io/ascii/qdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
This package contains functions for reading and writing QDP tables that are
not meant to be used directly, but instead are available as readers/writers in
`astropy.table`. See :ref:`table_io` for more details.
`astropy.table`. See :ref:`astropy:table_io` for more details.
"""
import re
import copy
Expand Down
4 changes: 2 additions & 2 deletions astropy/io/fits/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ def __init__(self, name=None, format=None, unit=None, null=None,
time_ref_pos=None):
"""
Construct a `Column` by specifying attributes. All attributes
except ``format`` can be optional; see :ref:`column_creation` and
:ref:`creating_ascii_table` for more information regarding
except ``format`` can be optional; see :ref:`astropy:column_creation`
and :ref:`astropy:creating_ascii_table` for more information regarding
``TFORM`` keyword.

Parameters
Expand Down
4 changes: 2 additions & 2 deletions astropy/io/fits/convenience.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ def writeto(filename, data, header=None, output_verify='exception',
Output verification option. Must be one of ``"fix"``, ``"silentfix"``,
``"ignore"``, ``"warn"``, or ``"exception"``. May also be any
combination of ``"fix"`` or ``"silentfix"`` with ``"+ignore"``,
``+warn``, or ``+exception" (e.g. ``"fix+warn"``). See :ref:`verify`
for more info.
``+warn``, or ``+exception" (e.g. ``"fix+warn"``). See
:ref:`astropy:verify` for more info.

overwrite : bool, optional
If ``True``, overwrite the output file if it exists. Raises an
Expand Down
4 changes: 2 additions & 2 deletions astropy/io/fits/hdu/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def writeto(self, name, output_verify='exception', overwrite=False,
``"silentfix"``, ``"ignore"``, ``"warn"``, or
``"exception"``. May also be any combination of ``"fix"`` or
``"silentfix"`` with ``"+ignore"``, ``+warn``, or ``+exception"
(e.g. ``"fix+warn"``). See :ref:`verify` for more info.
(e.g. ``"fix+warn"``). See :ref:`astropy:verify` for more info.

overwrite : bool, optional
If ``True``, overwrite the output file if it exists. Raises an
Expand Down Expand Up @@ -1122,7 +1122,7 @@ def req_cards(self, keyword, pos, test, fix_value, option, errlist):
``"silentfix"``, ``"ignore"``, ``"warn"``, or
``"exception"``. May also be any combination of ``"fix"`` or
``"silentfix"`` with ``"+ignore"``, ``+warn``, or ``+exception"
(e.g. ``"fix+warn"``). See :ref:`verify` for more info.
(e.g. ``"fix+warn"``). See :ref:`astropy:verify` for more info.

errlist : list
A list of validation errors already found in the FITS file; this is
Expand Down
4 changes: 2 additions & 2 deletions astropy/io/fits/hdu/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ class GroupsHDU(PrimaryHDU, _TableLikeHDU):
"""
FITS Random Groups HDU class.

See the :ref:`random-groups` section in the Astropy documentation for more
details on working with this type of HDU.
See the :ref:`astropy:random-groups` section in the Astropy documentation
for more details on working with this type of HDU.
"""

_bitpix2tform = {8: 'B', 16: 'I', 32: 'J', 64: 'K', -32: 'E', -64: 'D'}
Expand Down
8 changes: 4 additions & 4 deletions astropy/io/fits/hdu/hdulist.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def fitsopen(name, mode='readonly', memmap=None, save_backup=False,
``"silentfix"``, ``"ignore"``, ``"warn"``, or
``"exception"``. May also be any combination of ``"fix"`` or
``"silentfix"`` with ``"+ignore"``, ``+warn``, or ``+exception"
(e.g. ``"fix+warn"``). See :ref:`verify` for more info.
(e.g. ``"fix+warn"``). See :ref:`astropy:verify` for more info.

Returns
-------
Expand Down Expand Up @@ -805,7 +805,7 @@ def flush(self, output_verify='fix', verbose=False):
``"silentfix"``, ``"ignore"``, ``"warn"``, or
``"exception"``. May also be any combination of ``"fix"`` or
``"silentfix"`` with ``"+ignore"``, ``+warn``, or ``+exception"
(e.g. ``"fix+warn"``). See :ref:`verify` for more info.
(e.g. ``"fix+warn"``). See :ref:`astropy:verify` for more info.

verbose : bool
When `True`, print verbose messages
Expand Down Expand Up @@ -907,7 +907,7 @@ def writeto(self, fileobj, output_verify='exception', overwrite=False,
``"silentfix"``, ``"ignore"``, ``"warn"``, or
``"exception"``. May also be any combination of ``"fix"`` or
``"silentfix"`` with ``"+ignore"``, ``+warn``, or ``+exception"
(e.g. ``"fix+warn"``). See :ref:`verify` for more info.
(e.g. ``"fix+warn"``). See :ref:`astropy:verify` for more info.

overwrite : bool, optional
If ``True``, overwrite the output file if it exists. Raises an
Expand Down Expand Up @@ -965,7 +965,7 @@ def close(self, output_verify='exception', verbose=False, closed=True):
``"silentfix"``, ``"ignore"``, ``"warn"``, or
``"exception"``. May also be any combination of ``"fix"`` or
``"silentfix"`` with ``"+ignore"``, ``+warn``, or ``+exception"
(e.g. ``"fix+warn"``). See :ref:`verify` for more info.
(e.g. ``"fix+warn"``). See :ref:`astropy:verify` for more info.

verbose : bool
When `True`, print out verbose messages.
Expand Down
8 changes: 4 additions & 4 deletions astropy/io/fits/hdu/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def section(self):

Sections are mostly obsoleted by memmap support, but should still be
used to deal with very large scaled images. See the
:ref:`data-sections` section of the Astropy documentation for more
details.
:ref:`astropy:data-sections` section of the Astropy documentation for
more details.
"""

return Section(self)
Expand Down Expand Up @@ -932,8 +932,8 @@ class Section:
Section slices cannot be assigned to, and modifications to a section are
not saved back to the underlying file.

See the :ref:`data-sections` section of the Astropy documentation for more
details.
See the :ref:`astropy:data-sections` section of the Astropy documentation
for more details.
"""

def __init__(self, hdu):
Expand Down
2 changes: 1 addition & 1 deletion astropy/io/fits/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def verify(self, option='warn'):
``"silentfix"``, ``"ignore"``, ``"warn"``, or
``"exception"``. May also be any combination of ``"fix"`` or
``"silentfix"`` with ``"+ignore"``, ``"+warn"``, or ``"+exception"``
(e.g. ``"fix+warn"``). See :ref:`verify` for more info.
(e.g. ``"fix+warn"``). See :ref:`astropy:verify` for more info.
"""

opt = option.lower()
Expand Down
2 changes: 1 addition & 1 deletion astropy/io/misc/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
This package contains functions for reading and writing HDF5 tables that are
not meant to be used directly, but instead are available as readers/writers in
`astropy.table`. See :ref:`table_io` for more details.
`astropy.table`. See :ref:`astropy:table_io` for more details.
"""

import os
Expand Down
2 changes: 1 addition & 1 deletion astropy/io/votable/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def write_table_votable(input, output, table_id=None, overwrite=False,
tabledata_format : str, optional
The format of table data to write. Must be one of ``tabledata``
(text representation), ``binary`` or ``binary2``. Default is
``tabledata``. See :ref:`votable-serialization`.
``tabledata``. See :ref:`astropy:votable-serialization`.
"""

# Only those columns which are instances of BaseColumn or Quantity can be written
Expand Down
2 changes: 1 addition & 1 deletion astropy/io/votable/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class W01(VOTableSpecWarning):

Many VOTable files in the wild use commas as a separator instead,
and ``astropy.io.votable`` supports this convention when not in
:ref:`pedantic-mode`.
:ref:`astropy:pedantic-mode`.

``astropy.io.votable`` always outputs files using only spaces, regardless of
how they were input.
Expand Down
2 changes: 1 addition & 1 deletion astropy/io/votable/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def writeto(table, file, tabledata_format=None):
one of ``tabledata`` (text representation), ``binary`` or
``binary2``. By default, use the format that was specified in
each ``table`` object as it was created or read in. See
:ref:`votable-serialization`.
:ref:`astropy:astropy:votable-serialization`.
"""
from astropy.table import Table
if isinstance(table, Table):
Expand Down
4 changes: 2 additions & 2 deletions astropy/io/votable/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,7 @@ def format(self):
file, can not be written out. Any file read in with 'fits'
format will be read out, by default, in 'tabledata' format.

See :ref:`votable-serialization`.
See :ref:`astropy:votable-serialization`.
"""
return self._format

Expand Down Expand Up @@ -3644,7 +3644,7 @@ def to_xml(self, fd, compressed=False, tabledata_format=None,
be one of ``tabledata`` (text representation), ``binary`` or
``binary2``. By default, use the format that was specified
in each `Table` object as it was created or read in. See
:ref:`votable-serialization`.
:ref:`astropy:votable-serialization`.
"""
if tabledata_format is not None:
if tabledata_format.lower() not in (
Expand Down