Skip to content

Commit 1a1cb10

Browse files
committed
doc: simplify cross-references
No rendering changes intended. Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent 21841c5 commit 1a1cb10

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

doc/index.rst

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ OpenSlide objects
100100
If any operation on the object fails, :exc:`OpenSlideError` is raised.
101101
OpenSlide has latching error semantics: once :exc:`OpenSlideError` is
102102
raised, all future operations on the :class:`OpenSlide`, other than
103-
:meth:`close()`, will also raise :exc:`OpenSlideError`.
103+
:meth:`close`, will also raise :exc:`OpenSlideError`.
104104

105-
:meth:`close()` is called automatically when the object is deleted.
105+
:meth:`close` is called automatically when the object is deleted.
106106
The object may be used as a context manager, in which case it will be
107107
closed upon exiting the context.
108108

@@ -161,7 +161,7 @@ OpenSlide objects
161161

162162
Images, such as label or macro images, which are associated with this
163163
slide. This is a :class:`~collections.abc.Mapping` from image
164-
name to RGBA :class:`Image <PIL.Image.Image>`.
164+
name to RGBA :class:`~PIL.Image.Image`.
165165

166166
Unlike in the C interface, these images are not premultiplied.
167167

@@ -176,8 +176,8 @@ OpenSlide objects
176176

177177
.. method:: read_region(location: tuple[int, int], level: int, size: tuple[int, int]) -> ~PIL.Image.Image
178178

179-
Return an RGBA :class:`Image <PIL.Image.Image>` containing the
180-
contents of the specified region.
179+
Return an RGBA :class:`~PIL.Image.Image` containing the contents of
180+
the specified region.
181181

182182
Unlike in the C interface, the image data is not premultiplied.
183183

@@ -194,8 +194,8 @@ OpenSlide objects
194194

195195
.. method:: get_thumbnail(size: tuple[int, int]) -> ~PIL.Image.Image
196196

197-
Return an :class:`Image <PIL.Image.Image>` containing an RGB thumbnail
198-
of the slide.
197+
Return an :class:`~PIL.Image.Image` containing an RGB thumbnail of the
198+
slide.
199199

200200
:param size: the maximum size of the thumbnail as a ``(width, height)``
201201
tuple
@@ -347,7 +347,7 @@ Exceptions
347347

348348
Once :exc:`OpenSlideError` has been raised by a particular
349349
:class:`OpenSlide`, all future operations on that :class:`OpenSlide`
350-
(other than :meth:`close() <OpenSlide.close>`) will also raise
350+
(other than :meth:`~OpenSlide.close`) will also raise
351351
:exc:`OpenSlideError`.
352352

353353
.. exception:: OpenSlideUnsupportedFormatError
@@ -372,10 +372,10 @@ Wrapping a Pillow Image
372372

373373
.. class:: ImageSlide(file: str | bytes | ~os.PathLike[typing.Any] | ~PIL.Image.Image)
374374

375-
A wrapper around an :class:`Image <PIL.Image.Image>` object that
376-
provides an :class:`OpenSlide`-compatible API.
375+
A wrapper around an :class:`~PIL.Image.Image` object that provides an
376+
:class:`OpenSlide`-compatible API.
377377

378-
:param file: a filename or :class:`Image <PIL.Image.Image>` object
378+
:param file: a filename or :class:`~PIL.Image.Image` object
379379
:raises OSError: if the file cannot be opened
380380

381381
.. function:: open_slide(filename: str | bytes | ~os.PathLike[typing.Any]) -> OpenSlide | ImageSlide
@@ -403,17 +403,16 @@ Deep Zoom or a similar format.
403403

404404
.. class:: DeepZoomGenerator(osr: AbstractSlide, tile_size: int = 254, overlap: int = 1, limit_bounds: bool = False)
405405

406-
A Deep Zoom generator that wraps an
407-
:class:`OpenSlide <openslide.OpenSlide>` object,
408-
:class:`ImageSlide <openslide.ImageSlide>` object, or user-provided
409-
instance of :class:`~openslide.AbstractSlide`.
406+
A Deep Zoom generator that wraps an :class:`~openslide.OpenSlide` object,
407+
:class:`~openslide.ImageSlide` object, or user-provided instance of
408+
:class:`~openslide.AbstractSlide`.
410409

411410
:param osr: the slide object
412411
:param tile_size: the width and height of a single tile. For best viewer
413412
performance, ``tile_size + 2 * overlap`` should be a power of two.
414413
:param overlap: the number of extra pixels to add to each interior edge of a
415414
tile
416-
:param limit_bounds: ``True`` to render only the non-empty slide region
415+
:param limit_bounds: :obj:`True` to render only the non-empty slide region
417416

418417
.. attribute:: level_count
419418

@@ -451,7 +450,7 @@ Deep Zoom or a similar format.
451450

452451
.. method:: get_tile(level: int, address: tuple[int, int]) -> ~PIL.Image.Image
453452

454-
Return an RGB :class:`Image <PIL.Image.Image>` for a tile.
453+
Return an RGB :class:`~PIL.Image.Image` for a tile.
455454

456455
:param level: the Deep Zoom level
457456
:param address: the address of the tile within the level as a
@@ -463,7 +462,7 @@ Deep Zoom or a similar format.
463462
<openslide.OpenSlide.read_region>` arguments corresponding to the
464463
specified tile.
465464

466-
Most applications should use :meth:`get_tile()` instead.
465+
Most applications should use :meth:`get_tile` instead.
467466

468467
:param level: the Deep Zoom level
469468
:param address: the address of the tile within the level as a

0 commit comments

Comments
 (0)