Skip to content

Commit

Permalink
Fix lots of sphinx formatting and links in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeil committed Apr 18, 2014
1 parent 0b56b45 commit 33556bd
Show file tree
Hide file tree
Showing 20 changed files with 316 additions and 287 deletions.
11 changes: 6 additions & 5 deletions astroquery/alfalfa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def query_region(self, coordinates, radius=3. * u.arcmin,
in which case it is resolved using online services or as the appropriate
`astropy.coordinates` object. ICRS coordinates may also be entered as strings
as specified in the `astropy.coordinates` module.
radius : str or `astropy.units.Quantity` object, optional
radius : str or `~astropy.units.Quantity` object, optional
The string must be parsable by `astropy.coordinates.Angle`. The appropriate
`Quantity` object from `astropy.units` may also be used. Defaults to 3 arcmin.
`~astropy.units.Quantity` object from `astropy.units` may also be used. Defaults to 3 arcmin.
optical_counterpart : bool
Search for position match using radio positions or position of
any optical counterpart identified by ALFALFA team? Keep in mind that
Expand Down Expand Up @@ -176,9 +176,8 @@ def get_spectrum_async(self, agc):
See Also
--------
get_catalog : method that downloads ALFALFA catalog
crossID : find object in catalog closest to supplied position (use this
query_region : find object in catalog closest to supplied position (use this
to determine AGC number first)
"""

agc = str(agc).zfill(6)
Expand All @@ -192,7 +191,9 @@ def get_spectrum(self, agc):
"""
Returns
-------
PyFITS HDUList. Spectrum is in hdulist[0].data[0][2]
spectrum : `~astropy.io.fits.HDUList`
Spectrum is in ``hdulist[0].data[0][2]``
"""

result = self.get_spectrum_async(agc)
Expand Down
20 changes: 12 additions & 8 deletions astroquery/besancon/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, email=None):

def get_besancon_model_file(self, filename, verbose=True, timeout=5.0):
"""
Download a Besancon model from the website
Download a Besancon model from the website.
Parameters
----------
Expand Down Expand Up @@ -175,7 +175,8 @@ def _parse_args(self, glon, glat, email=None, smallfield=True, extinction=0.7,
colors_limits=copy.copy(colors_limits),
**kwargs):
"""
Perform a query on the Besancon model of the galaxy
Perform a query on the Besancon model of the galaxy.
http://model.obs-besancon.fr/
Parameters
Expand Down Expand Up @@ -300,9 +301,10 @@ def query_async(self, *args, **kwargs):

def parse_besancon_dict(bd):
"""
Turn a dict like default_keys into a list of tuples (must be a list of
tuples because there are some repeated entries, which dictionaries do not
support)
Turn a dict like default_keys into a list of tuples.
Must be a list of tuples because there are some repeated entries,
which dictionaries do not support.
.. todo::
In the future, a better way to do this is to make each dict entry a list;
Expand Down Expand Up @@ -330,7 +332,7 @@ def parse_besancon_dict(bd):

def parse_errors(text):
"""
Attempt to extract the errors from a Besancon web page with error messages in it
Attempt to extract the errors from a Besancon web page with error messages in it.
"""
# py3 compatibility:
if hasattr(text,'decode'):
Expand All @@ -353,7 +355,7 @@ def parse_errors(text):
def parse_besancon_model_string(bms,):
"""
Given an entire Besancon model result in *string* form, parse it into an
astropy table
`~astropy.table.Table`.
"""

# py3 compatibility:
Expand Down Expand Up @@ -429,7 +431,9 @@ def parse_besancon_model_string(bms,):

for cn in besancon_table.columns:
if besancon_table[cn].dtype.kind in ('s','S'):
print("WARNING: The Besancon table did not parse properly. Some columns are likely to have invalid values and others incorrect values. Please report this error.")
print("WARNING: The Besancon table did not parse properly. "
"Some columns are likely to have invalid values and others incorrect values. "
"Please report this error.")
break

return besancon_table
40 changes: 28 additions & 12 deletions astroquery/besancon/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
class BesanconFixed(fixedwidth.FixedWidth):

"""
Read data from a Besancon galactic model table file. Assumes a
fixed-length header; it is possible that different parameters in the model
Read data from a Besancon galactic model table file.
Assumes a fixed-length header;
it is possible that different parameters in the model
will result in different length headers
"""

Expand Down Expand Up @@ -68,22 +70,36 @@ def get_cols(self, lines):
col.index = i

def process_lines(self, lines):
"""Strip out comment lines from list of ``lines``
(unlike the normal process_lines, does NOT exclude blank lines)
:param lines: all lines in table
:returns: list of lines
"""Strip out comment lines from list of ``lines``.
Unlike the normal process_lines, does NOT exclude blank lines.
Parameters
----------
lines : TODO
All lines in table
Returns
-------
list of lines
"""
return lines[self.header_line+1:self.footer_line]


class BesanconFixedWidthData(fixedwidth.FixedWidthData):

def process_lines(self, lines):
"""Strip out comment lines from list of ``lines``
(unlike the normal process_lines, does NOT exclude blank lines)
:param lines: all lines in table
:returns: list of lines
"""Strip out comment lines from list of ``lines``.
Unlike the normal process_lines, does NOT exclude blank lines.
Parameters
----------
lines : TODO
All lines in table
Returns
-------
list of lines
"""
return lines[self.header.header_line+1:self.header.footer_line]
4 changes: 2 additions & 2 deletions astroquery/eso/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def query_survey(self, survey, **kwargs):
-------
table : `astropy.table.Table`
A table representing the data available in the archive for the specified survey,
matching the constraints specified in `kwargs`. The number of rows returned is capped
matching the constraints specified in ``kwargs``. The number of rows returned is capped
by the ROW_LIMIT configuration item.
"""
Expand Down Expand Up @@ -197,7 +197,7 @@ def query_instrument(self, instrument, open_form=False, **kwargs):
-------
table : `astropy.table.Table`
A table representing the data available in the archive for the specified instrument,
matching the constraints specified in `kwargs`. The number of rows returned is capped
matching the constraints specified in ``kwargs``. The number of rows returned is capped
by the ROW_LIMIT configuration item.
"""
Expand Down
26 changes: 13 additions & 13 deletions astroquery/irsa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ def query_region(self, coordinates=None, catalog=None, spatial='Cone', radius=10
spatial : str
Type of spatial query: 'Cone', 'Box', 'Polygon', and 'All-Sky'.
If missing then defaults to 'Cone'.
radius : str or `astropy.units.Quantity` object, [optional for spatial is 'Cone']
radius : str or `~astropy.units.Quantity` object, [optional for spatial is 'Cone']
The string must be parsable by `astropy.coordinates.Angle`. The appropriate
`Quantity` object from `astropy.units` may also be used. Defaults to 10 arcsec.
width : str, `astropy.units.Quantity` object [Required for spatial is 'Polygon'.]
`~astropy.units.Quantity` object from `astropy.units` may also be used. Defaults to 10 arcsec.
width : str, `~astropy.units.Quantity` object [Required for spatial is 'Polygon'.]
The string must be parsable by `astropy.coordinates.Angle`. The appropriate
`Quantity` object from `astropy.units` may also be used.
`~astropy.units.Quantity` object from `astropy.units` may also be used.
polygon : list, [Required for spatial is 'Polygon']
A list of ``(ra, dec)`` pairs (as tuples), in decimal degrees,
outlinining the polygon to search in. It can also be a list of
Expand Down Expand Up @@ -170,7 +170,7 @@ def query_region_async(self, coordinates=None, catalog=None,
spatial='Cone', radius=10 * u.arcsec, width=None,
polygon=None,get_query_payload=False):
"""
This function serves the same purpose as :meth:`~astroquery.irsa.Irsa.query_region`,
This function serves the same purpose as :meth:`~astroquery.irsa.IrsaClass.query_region`,
but returns the raw HTTP response rather than the results in an `astropy.table.Table`.
Parameters
Expand All @@ -188,12 +188,12 @@ def query_region_async(self, coordinates=None, catalog=None,
spatial : str
Type of spatial query: 'Cone', 'Box', 'Polygon', and 'All-Sky'.
If missing then defaults to 'Cone'.
radius : str or `astropy.units.Quantity` object, [optional for spatial is 'Cone']
radius : str or `~astropy.units.Quantity` object, [optional for spatial is 'Cone']
The string must be parsable by `astropy.coordinates.Angle`. The appropriate
`Quantity` object from `astropy.units` may also be used. Defaults to 10 arcsec.
width : str, `astropy.units.Quantity` object [Required for spatial is 'Polygon'.]
`~astropy.units.Quantity` object from `astropy.units` may also be used. Defaults to 10 arcsec.
width : str, `~astropy.units.Quantity` object [Required for spatial is 'Polygon'.]
The string must be parsable by `astropy.coordinates.Angle`. The appropriate
`Quantity` object from `astropy.units` may also be used.
`~astropy.units.Quantity` object from `astropy.units` may also be used.
polygon : list, [Required for spatial is 'Polygon']
A list of ``(ra, dec)`` pairs (as tuples), in decimal degrees,
outlinining the polygon to search in. It can also be a list of
Expand Down Expand Up @@ -240,12 +240,12 @@ def _parse_spatial(self, spatial, coordinates, radius=None, width=None,
<http://irsa.ipac.caltech.edu/search_help.html>`_ for more
details). Required if spatial is 'Cone' or 'Box'. Optional if
spatial is 'Polygon'.
radius : str or `astropy.units.Quantity` object, [optional for spatial is 'Cone']
radius : str or `~astropy.units.Quantity` object, [optional for spatial is 'Cone']
The string must be parsable by `astropy.coordinates.Angle`. The appropriate
`Quantity` object from `astropy.units` may also be used. Defaults to 10 arcsec.
width : str, `astropy.units.Quantity` object [Required for spatial is 'Polygon'.]
`~astropy.units.Quantity` object from `astropy.units` may also be used. Defaults to 10 arcsec.
width : str, `~astropy.units.Quantity` object [Required for spatial is 'Polygon'.]
The string must be parsable by `astropy.coordinates.Angle`. The appropriate
`Quantity` object from `astropy.units` may also be used.
`~astropy.units.Quantity` object from `astropy.units` may also be used.
polygon : list, [Required for spatial is 'Polygon']
A list of ``(ra, dec)`` pairs as tuples of
`astropy.coordinates.Angle`s outlinining the polygon to search in.
Expand Down
Loading

0 comments on commit 33556bd

Please sign in to comment.