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

use canonical name of RTD config and enable nitpicky mode to catch broken links in docs #430

Merged
merged 2 commits into from
Dec 23, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Bug Fixes
- Replace ``domain`` with ``bounding_box``. [#74]

- Added a ``LabelMapper`` model where ``mapper`` is an instance of
`~astropy.modeling.core.Model`. [#78]
`~astropy.modeling.Model`. [#78]

- Evaluating a WCS with bounding box was moved to ``astropy.modeling``. [#86]

Expand Down
9 changes: 9 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,12 @@

sys.path.insert(0, os.path.join(os.path.dirname('__file__'), 'sphinxext'))
extensions += ['sphinx_asdf']

# Enable nitpicky mode - which ensures that all references in the docs resolve.
nitpicky = True
nitpick_ignore = [
('py:class', 'gwcs.api.GWCSAPIMixin'),
('py:obj', 'astropy.modeling.projections.projcodes'),
('py:attr', 'gwcs.WCS.bounding_box'),
('py:meth', 'gwcs.WCS.footprint')
]
2 changes: 1 addition & 1 deletion docs/gwcs/points_to_wcs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ between pixel and sky.
This example shows how to use the `~gwcs.wcstools.wcs_from_points` tool to fit a WCS to a matched set of
pixel and sky positions. Along with arrays of the (x,y) pixel position in the image and the matched sky coordinates,
the fiducial point for the projection must be supplied as a `~astropy.coordinates.SkyCoord` object. Additionally,
the projection type must be specified from the available projections in `~astropy.modeling.projections.projcode`.
the projection type must be specified from the available projections in `~astropy.modeling.projections.projcodes`.

Geometric distortion can also be fit to the input coordinates - the distortion type (2D polynomial, chebyshev, legendre) and
the degree can be supplied to fit this component of the model.
Expand Down
2 changes: 1 addition & 1 deletion docs/gwcs/using_wcs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ of accuracy or about divergence of the iterative process.

In order to catch these kind of errors that can occur during numerical
inversion, we need to turn off ``quiet`` mode and be prepared to catch
`gwcs.wcs.WCS.NoConvergence` exceptions. In the next example, let's also add a
`gwcs.wcs.NoConvergence` exceptions. In the next example, let's also add a
point far away from the image for which numerical inverse fails.

.. doctest-skip::
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ Other Examples



Using `gwcs`
------------
Using ``gwcs``
--------------

.. toctree::
:maxdepth: 2
Expand Down
6 changes: 3 additions & 3 deletions gwcs/coordinate_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CoordinateFrame:
reference_frame : astropy.coordinates.builtin_frames
Reference frame (usually used with output_frame to convert to world coordinate objects).
reference_position : str
Reference position - one of `STANDARD_REFERENCE_POSITION`
Reference position - one of ``STANDARD_REFERENCE_POSITION``
unit : list of astropy.units.Unit
Unit for each axis.
axes_names : list
Expand Down Expand Up @@ -431,7 +431,7 @@ class SpectralFrame(CoordinateFrame):
name : str
Name for this frame.
reference_position : str
Reference position - one of `STANDARD_REFERENCE_POSITION`
Reference position - one of ``STANDARD_REFERENCE_POSITION``

"""

Expand Down Expand Up @@ -481,7 +481,7 @@ class TemporalFrame(CoordinateFrame):
reference_frame : `~astropy.time.Time`
A Time object which holds the time scale and format.
If data is provided, it is the time zero point.
To not set a zero point for the frame initialize `reference_frame`
To not set a zero point for the frame initialize ``reference_frame``
with an empty list.
unit : str or `~astropy.units.Unit`
Time unit.
Expand Down
6 changes: 3 additions & 3 deletions gwcs/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- A mapping of inputs to labels - "label_mapper"
- A mapping of labels to transforms - "transform_selector"

A "label_mapper" is also a transform, a subclass of `astropy.modeling.core.Model`,
A "label_mapper" is also a transform, a subclass of `astropy.modeling.Model`,
which returns the labels corresponding to the inputs.

An instance of a ``LabelMapper`` class is passed to `RegionsSelector`.
Expand Down Expand Up @@ -504,7 +504,7 @@ class RegionsSelector(Model):
selector : dict
Mapping of region labels to transforms.
Labels can be of type int or str, transforms are of type
`~astropy.modeling.core.Model`.
`~astropy.modeling.Model`.
label_mapper : a subclass of `~gwcs.selector._LabelMapper`
A model which maps locations to region labels.
undefined_transform_value : float, np.nan (default)
Expand Down Expand Up @@ -651,7 +651,7 @@ class LabelMapper(_LabelMapper):

Parameters
----------
mapper : `~astropy.modeling.core.Model`
mapper : `~astropy.modeling.Model`
A function which returns a region.
no_label : str or int
"" or 0
Expand Down
8 changes: 4 additions & 4 deletions gwcs/spectroscopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class SellmeierGlass(Model):
Iterable of size 3 containing B coefficients.
C_coef : ndarray
Iterable of size 3 containing c coefficients in
units of `u.um**2`.
units of ``u.um**2``.

Returns
-------
Expand Down Expand Up @@ -264,9 +264,9 @@ class SellmeierZemax(Model):
Parameters
----------
temperature : float
Temperature of the material in `u.Kelvin`.
Temperature of the material in ``u.Kelvin``.
ref_temperature : float
Reference emperature of the glass in `u.Kelvin`.
Reference emperature of the glass in ``u.Kelvin``.
ref_pressure : float
Reference pressure in ATM.
pressure : float
Expand All @@ -275,7 +275,7 @@ class SellmeierZemax(Model):
Iterable of size 3 containing B coefficients.
C_coef : ndarray
Iterable of size 3 containing C coefficients in
units of `u.um**2`.
units of ``u.um**2``.
D_coef : ndarray
Iterable of size 3 containing constants to describe the
behavior of the material.
Expand Down
44 changes: 22 additions & 22 deletions gwcs/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ def get_transform(self, from_frame, to_frame):

Parameters
----------
from_frame : str or `~gwcs.coordinate_frame.CoordinateFrame`
from_frame : str or `~gwcs.coordinate_frames.CoordinateFrame`
Initial coordinate frame name of object.
to_frame : str, or instance of `~gwcs.cordinate_frames.CoordinateFrame`
to_frame : str, or instance of `~gwcs.coordinate_frames.CoordinateFrame`
End coordinate frame name or object.

Returns
Expand Down Expand Up @@ -236,9 +236,9 @@ def set_transform(self, from_frame, to_frame, transform):

Parameters
----------
from_frame : str or `~gwcs.coordinate_frame.CoordinateFrame`
from_frame : str or `~gwcs.coordinate_frames.CoordinateFrame`
Initial coordinate frame.
to_frame : str, or instance of `~gwcs.cordinate_frames.CoordinateFrame`
to_frame : str, or instance of `~gwcs.coordinate_frames.CoordinateFrame`
End coordinate frame.
transform : `~astropy.modeling.Model`
Transform between ``from_frame`` and ``to_frame``.
Expand Down Expand Up @@ -1114,7 +1114,7 @@ def transform(self, from_frame, to_frame, *args, **kwargs):
----------
from_frame : str or `~gwcs.coordinate_frames.CoordinateFrame`
Initial coordinate frame.
to_frame : str, or instance of `~gwcs.cordinate_frames.CoordinateFrame`
to_frame : str, or instance of `~gwcs.coordinate_frames.CoordinateFrame`
Coordinate frame into which to transform.
args : float or array-like
Inputs in ``from_frame``, separate inputs for each dimension.
Expand Down Expand Up @@ -1179,7 +1179,7 @@ def insert_transform(self, frame, transform, after=False):

Parameters
----------
frame : str or `~gwcs.coordinate_frame.CoordinateFrame`
frame : str or `~gwcs.coordinate_frames.CoordinateFrame`
Coordinate frame which sets the point of insertion.
transform : `~astropy.modeling.Model`
New transform to be inserted in the pipeline
Expand All @@ -1201,17 +1201,17 @@ def insert_frame(self, input_frame, transform, output_frame):
Insert a new frame into an existing pipeline. This frame must be
anchored to a frame already in the pipeline by a transform. This
existing frame is identified solely by its name, although an entire
`~gwcs.coordinate_frame.CoordinateFrame` can be passed (e.g., the
`~gwcs.coordinate_frames.CoordinateFrame` can be passed (e.g., the
`input_frame` or `output_frame` attribute). This frame is never
modified.

Parameters
----------
input_frame : str or `~gwcs.coordinate_frame.CoordinateFrame`
input_frame : str or `~gwcs.coordinate_frames.CoordinateFrame`
Coordinate frame at start of new transform
transform : `~astropy.modeling.Model`
New transform to be inserted in the pipeline
output_frame: str or `~gwcs.coordinate_frame.CoordinateFrame`
output_frame: str or `~gwcs.coordinate_frames.CoordinateFrame`
Coordinate frame at end of new transform
"""
input_name, input_frame_obj = self._get_frame_name(input_frame)
Expand Down Expand Up @@ -1417,12 +1417,12 @@ def footprint(self, bounding_box=None, center=False, axis_type="all"):
Parameters
----------
bounding_box : tuple of floats: (start, stop)
`prop: bounding_box`
``prop: bounding_box``
center : bool
If `True` use the center of the pixel, otherwise use the corner.
axis_type : str
A supported ``output_frame.axes_type`` or "all" (default).
One of ['spatial', 'spectral', 'temporal'] or a custom type.
A supported ``output_frame.axes_type`` or ``"all"`` (default).
One of [``'spatial'``, ``'spectral'``, ``'temporal'``] or a custom type.

Returns
-------
Expand Down Expand Up @@ -1480,12 +1480,12 @@ def fix_inputs(self, fixed):
Parameters
----------
fixed : dict
Keyword arguments with fixed values corresponding to `self.selector`.
Keyword arguments with fixed values corresponding to ``self.selector``.

Returns
-------
new_wcs : `WCS`
A new unique WCS corresponding to the values in `fixed`.
A new unique WCS corresponding to the values in ``fixed``.

Examples
--------
Expand Down Expand Up @@ -2181,8 +2181,8 @@ def to_fits_tab(self, bounding_box=None, bin_ext_name='WCS-TABLE',
does not match the number of image axes.

RuntimeError
If the number of image axes (`~gwcs.WCS.pixel_n_dim`) is larger
than the number of world axes (`~gwcs.WCS.world_n_dim`).
If the number of image axes (``~gwcs.WCS.pixel_n_dim``) is larger
than the number of world axes (``~gwcs.WCS.world_n_dim``).

"""
if bounding_box is None:
Expand Down Expand Up @@ -2362,8 +2362,8 @@ def to_fits(self, bounding_box=None, max_pix_error=0.25, degree=None,
does not match the number of image axes.

RuntimeError
If the number of image axes (`~gwcs.WCS.pixel_n_dim`) is larger
than the number of world axes (`~gwcs.WCS.world_n_dim`).
If the number of image axes (``~gwcs.WCS.pixel_n_dim``) is larger
than the number of world axes (``~gwcs.WCS.world_n_dim``).

"""
if bounding_box is None:
Expand Down Expand Up @@ -2544,8 +2544,8 @@ def _to_fits_tab(self, hdr, world_axes_group, use_cd, bounding_box,
TypeError

RuntimeError
If the number of image axes (`~gwcs.WCS.pixel_n_dim`) is larger
than the number of world axes (`~gwcs.WCS.world_n_dim`).
If the number of image axes (``~gwcs.WCS.pixel_n_dim``) is larger
than the number of world axes (``~gwcs.WCS.world_n_dim``).

"""
if isinstance(bin_ext, str):
Expand Down Expand Up @@ -3084,9 +3084,9 @@ class Step:
----------
frame : `~gwcs.coordinate_frames.CoordinateFrame`
A gwcs coordinate frame object.
transform : `~astropy.modeling.core.Model` or None
transform : `~astropy.modeling.Model` or None
A transform from this step's frame to next step's frame.
The transform of the last step should be ``None``.
The transform of the last step should be `None`.
"""
def __init__(self, frame, transform=None):
self.frame = frame
Expand Down
6 changes: 3 additions & 3 deletions gwcs/wcstools.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def wcs_from_fiducial(fiducial, coordinate_frame=None, projection=None,
bounding_box : tuple
The bounding box over which the WCS is valid.
It is a tuple of tuples of size 2 where each tuple
represents a range of (low, high) values. The `bounding_box` is in the order of
represents a range of (low, high) values. The ``bounding_box`` is in the order of
the axes, `~gwcs.coordinate_frames.CoordinateFrame.axes_order`.
For two inputs and axes_order(0, 1) the bounding box is ((xlow, xhigh), (ylow, yhigh)).
input_frame : ~gwcs.coordinate_frames.CoordinateFrame`
Expand Down Expand Up @@ -247,8 +247,8 @@ def wcs_from_points(xy, world_coords, proj_point='center',
be passed in.
projection : `~astropy.modeling.projections.Projection`
A projection type. One of the projections in
`~astropy.modeling.projections.projcode`. Defaults to TAN projection
(`projections.Sky2Pix_TAN()`).
`~astropy.modeling.projections.projcodes`. Defaults to TAN projection
(`astropy.modeling.projections.Sky2Pix_TAN`).
poly_degree : int
Degree of polynomial model to be fit to data. Defaults to 4.
polynomial_type : str
Expand Down