Skip to content

Commit 6c512c9

Browse files
authored
Merge pull request #67 from pllim/all-the-docs
DOC: nitpicky, CI badge
2 parents d427a23 + 6412dae commit 6c512c9

File tree

5 files changed

+48
-45
lines changed

5 files changed

+48
-45
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# AIDA, the Astronomical Image Display API
22

33
[![Documentation Status](https://readthedocs.org/projects/aida/badge/?version=latest)](https://aida.readthedocs.io/en/latest/?badge=latest)
4+
[![CI](https://github.com/astropy/astro-image-display-api/actions/workflows/run_tests.yml/badge.svg)](https://github.com/astropy/astro-image-display-api/actions/workflows/run_tests.yml)
45

56
Also see: https://github.com/astropy/astrowidgets

docs/api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ AID API
55

66
.. automodapi:: astro_image_display_api.interface_definition
77
:no-inheritance-diagram:
8+
9+
.. automodapi:: astro_image_display_api.image_viewer_logic
10+
:no-inheritance-diagram:

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
# A dictionary of values to pass into the template engine's context for all pages.
125125
html_context = {
126126
"default_mode": "dark",
127-
"to_be_indexed": ["stable", "latest"],
127+
"to_be_indexed": ["latest"],
128128
"is_development": dev,
129129
"github_user": "astropy",
130130
"github_repo": "astro-image-display-api",
@@ -183,8 +183,8 @@
183183

184184
# -- Turn on nitpicky mode for sphinx (to warn about references not found) ----
185185
#
186-
# nitpicky = True
187-
# nitpick_ignore = []
186+
nitpicky = True
187+
nitpick_ignore = []
188188
#
189189
# Some warnings are impossible to suppress, and you can list specific references
190190
# that should be ignored in a nitpick-exceptions file which should be inside

src/astro_image_display_api/image_viewer_logic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
from .interface_definition import ImageViewerInterface
2626

27+
__all__ = ["ImageViewerLogic"]
2728

2829
@dataclass
2930
class CatalogInfo:
@@ -298,7 +299,7 @@ def load_image(
298299
299300
Parameters
300301
----------
301-
file : str or `astropy.io.fits.HDU`
302+
file : str or array-like
302303
The FITS file to load. If a string, it can be a URL or a
303304
file path.
304305

src/astro_image_display_api/interface_definition.py

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def load_image(self, data: Any, image_label: str | None = None) -> None:
2929
"""
3030
Load data into the viewer. At a minimum, this should allow a FITS file
3131
to be loaded. Viewers may allow additional data types to be loaded, such as
32-
2D arrays or `astropy.nddata.NDData` objects.
32+
2D arrays or `~astropy.nddata.NDData` objects.
3333
3434
Parameters
3535
----------
3636
data :
3737
The data to load. This can be a FITS file, a 2D array,
38-
or an `astropy.nddata.NDData` object.
38+
or an `~astropy.nddata.NDData` object.
3939
4040
image_label : optional
4141
The label for the image.
@@ -70,12 +70,12 @@ def set_cuts(
7070
Raises
7171
------
7272
TypeError
73-
If the `cuts` parameter is not a tuple or an
73+
If the ``cuts`` parameter is not a tuple or an
7474
`astropy.visualization.BaseInterval` object.
7575
7676
ValueError
77-
If the `image_label` is not provided when there are multiple images loaded,
78-
or if the `image_label` does not correspond to a loaded image.
77+
If the ``image_label`` is not provided when there are multiple images loaded,
78+
or if the ``image_label`` does not correspond to a loaded image.
7979
"""
8080
raise NotImplementedError
8181

@@ -99,8 +99,8 @@ def get_cuts(self, image_label: str | None = None) -> BaseInterval:
9999
Raises
100100
------
101101
ValueError
102-
If the `image_label` is not provided when there are multiple images loaded,
103-
or if the `image_label` does not correspond to a loaded image.
102+
If the ``image_label`` is not provided when there are multiple images loaded,
103+
or if the ``image_label`` does not correspond to a loaded image.
104104
"""
105105
raise NotImplementedError
106106

@@ -122,11 +122,11 @@ def set_stretch(self, stretch: BaseStretch, image_label: str | None = None) -> N
122122
Raises
123123
------
124124
TypeError
125-
If the `stretch` is not a valid `BaseStretch` object
125+
If the ``stretch`` is not a valid `~astropy.visualization.BaseStretch` object.
126126
127127
ValueError
128-
if the `image_label` is not provided when there are multiple images loaded
129-
or if the `image_label` does not correspond to a loaded image.
128+
If the ``image_label`` is not provided when there are multiple images loaded
129+
or if the ``image_label`` does not correspond to a loaded image.
130130
"""
131131
raise NotImplementedError
132132

@@ -158,7 +158,7 @@ def set_colormap(self, map_name: str, image_label: str | None = None) -> None:
158158
----------
159159
map_name
160160
The name of the colormap to set. This should be a
161-
valid colormap name from Matplotlib`_;
161+
valid colormap name from `Matplotlib <https://matplotlib.org/stable/gallery/color/colormap_reference.html>`_;
162162
not all backends will support
163163
all colormaps, so the viewer should handle errors gracefully.
164164
image_label : optional
@@ -169,10 +169,8 @@ def set_colormap(self, map_name: str, image_label: str | None = None) -> None:
169169
Raises
170170
------
171171
ValueError
172-
If the `map_name` is not a valid colormap name or if the `image_label`
172+
If the ``map_name`` is not a valid colormap name or if the ``image_label``
173173
is not provided when there are multiple images loaded.
174-
175-
.. _Matplotlib: https://matplotlib.org/stable/gallery/color/colormap_reference.html
176174
"""
177175
raise NotImplementedError
178176

@@ -196,8 +194,8 @@ def get_colormap(self, image_label: str | None = None) -> str:
196194
Raises
197195
------
198196
ValueError
199-
If the `image_label` is not provided when there are multiple images loaded
200-
or if the `image_label` does not correspond to a loaded image.
197+
If the ``image_label`` is not provided when there are multiple images loaded
198+
or if the ``image_label`` does not correspond to a loaded image.
201199
"""
202200
raise NotImplementedError
203201

@@ -220,7 +218,7 @@ def save(self, filename: str | os.PathLike, overwrite: bool = False) -> None:
220218
Raises
221219
------
222220
FileExistsError
223-
If the file already exists and `overwrite` is `False`.
221+
If the file already exists and ``overwrite`` is `False`.
224222
"""
225223
raise NotImplementedError
226224

@@ -258,16 +256,16 @@ def load_catalog(
258256
catalog_label : str, optional
259257
The name of the marker set to use. If not given, a unique
260258
name will be generated.
261-
catalog_style: dict, optional
259+
catalog_style : dict, optional
262260
A dictionary that specifies the style of the markers used to
263-
represent the catalog. See `ImageViewerInterface.set_catalog_style`
261+
represent the catalog. See `~astro_image_display_api.interface_definition.ImageViewerInterface.set_catalog_style`
264262
for details.
265263
266264
Raises
267265
------
268266
ValueError
269-
If the `table` does not contain the required columns, or if
270-
the `catalog_label` is not provided when there are multiple
267+
If the ``table`` does not contain the required columns, or if
268+
the ``catalog_label`` is not provided when there are multiple
271269
catalogs loaded.
272270
"""
273271
raise NotImplementedError
@@ -288,7 +286,7 @@ def set_catalog_style(
288286
----------
289287
shape : str, optional
290288
The shape of the markers. Default is ``'circle'``. The set of
291-
supported shapes is listed below in the `Notes` section.
289+
supported shapes is listed below in the *Note* section below.
292290
color : str, optional
293291
The color of the markers. Default is ``'red'``. Permitted colors are
294292
any CSS4 color name. CSS4 also permits hex RGB or RGBA colors.
@@ -298,16 +296,16 @@ def set_catalog_style(
298296
**kwargs
299297
Additional keyword arguments to pass to the marker style.
300298
301-
Notes
302-
-----
299+
Note
300+
----
303301
The following shapes are supported: "circle", "square", "crosshair", "plus",
304302
"diamond".
305303
306304
Raises
307305
------
308306
ValueError
309307
If there are multiple catalog styles set and the user has not
310-
specified a `catalog_label` for which to set the style, or if
308+
specified a ``catalog_label`` for which to set the style, or if
311309
an style is set for a catalog that does not exist.
312310
"""
313311
raise NotImplementedError
@@ -336,7 +334,7 @@ def get_catalog_style(self, catalog_label: str | None = None) -> dict:
336334
337335
ValueError
338336
If there are multiple catalog styles set and the user has not
339-
specified a `catalog_label` for which to get the style.
337+
specified a ``catalog_label`` for which to get the style.
340338
341339
"""
342340
raise NotImplementedError
@@ -356,12 +354,12 @@ def remove_catalog(self, catalog_label: str | None = None) -> None:
356354
Raises
357355
------
358356
ValueError
359-
If the `catalog_label` is not provided when there are multiple
360-
catalogs loaded, or if the `catalog_label` does not correspond to a
357+
If the ``catalog_label`` is not provided when there are multiple
358+
catalogs loaded, or if the ``catalog_label`` does not correspond to a
361359
loaded catalog.
362360
363361
TypeError
364-
If the `catalog_label` is not a string or `None`, or if it is not
362+
If the ``catalog_label`` is not a string or `None`, or if it is not
365363
one of the allowed values.
366364
"""
367365
raise NotImplementedError
@@ -400,7 +398,7 @@ def get_catalog(
400398
Raises
401399
------
402400
ValueError
403-
If the `catalog_label` is not provided when there are multiple catalogs
401+
If the ``catalog_label`` is not provided when there are multiple catalogs
404402
loaded.
405403
"""
406404
raise NotImplementedError
@@ -446,15 +444,15 @@ def set_viewport(
446444
Raises
447445
------
448446
TypeError
449-
If the `center` is not a `SkyCoord` object or a tuple of floats, or if
450-
the `fov` is not a angular `Quantity` or a float, or if there is no WCS
447+
If the ``center`` is not a `~astropy.coordinates.SkyCoord` object or a tuple of floats, or if
448+
the ``fov`` is not a angular `~astropy.units.Quantity` or a float, or if there is no WCS
451449
and the center or field of view require a WCS to be applied.
452450
453451
ValueError
454-
If `image_label` is not provided when there are multiple images loaded.
452+
If ``image_label`` is not provided when there are multiple images loaded.
455453
456454
`astropy.units.UnitTypeError`
457-
If the `fov` is a `Quantity` but does not have an angular unit.
455+
If the ``fov`` is a `~astropy.units.Quantity` but does not have an angular unit.
458456
"""
459457
raise NotImplementedError
460458

@@ -468,9 +466,9 @@ def get_viewport(
468466
Parameters
469467
----------
470468
sky_or_pixel : str, optional
471-
If 'sky', the center will be returned as a `SkyCoord` object.
469+
If 'sky', the center will be returned as a `~astropy.coordinates.SkyCoord` object.
472470
If 'pixel', the center will be returned as a tuple of pixel coordinates.
473-
If `None`, the default behavior is to return the center as a `SkyCoord` if
471+
If `None`, the default behavior is to return the center as a `~astropy.coordinates.SkyCoord` if
474472
possible, or as a tuple of floats if the image is in pixel coordinates and
475473
has no WCS information.
476474
image_label : str, optional
@@ -483,15 +481,15 @@ def get_viewport(
483481
dict
484482
A dictionary containing the current viewport settings.
485483
The keys are 'center', 'fov', and 'image_label'.
486-
- 'center' is an `astropy.coordinates.SkyCoord` object or a tuple of floats.
487-
- 'fov' is an `astropy.units.Quantity` object or a float.
484+
- 'center' is an `~astropy.coordinates.SkyCoord` object or a tuple of floats.
485+
- 'fov' is an `~astropy.units.Quantity` object or a float.
488486
- 'image_label' is a string representing the label of the image.
489487
490488
Raises
491489
------
492490
ValueError
493-
If the `sky_or_pixel` parameter is not one of 'sky', 'pixel', or `None`,
494-
or if the `image_label` is not provided when there are multiple images
495-
loaded, or if the `image_label` does not correspond to a loaded image.
491+
If the ``sky_or_pixel`` parameter is not one of 'sky', 'pixel', or `None`,
492+
or if the ``image_label`` is not provided when there are multiple images
493+
loaded, or if the ``image_label`` does not correspond to a loaded image.
496494
"""
497495
raise NotImplementedError

0 commit comments

Comments
 (0)