Skip to content

Commit c5c308a

Browse files
committed
Remove type hints in docstrings
1 parent 1fa867e commit c5c308a

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/spatialexperiment/SpatialExperiment.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# TODO: implement readImgData and read10xVisium?
22
# TODO: interop w/ SpatialData class from scverse
3-
# TODO: no type hints in the docstring
43
from typing import Any, Dict, List, Optional, Union
54
from warnings import warn
65

@@ -338,7 +337,8 @@ def set_spatial_coordinates(self, spatial_coords: biocframe.BiocFrame, in_place:
338337
spatial_coords:
339338
New spatial coordinates.
340339
341-
in_place: Whether to modify the ``SpatialExperiment`` in place. Defaults to False.
340+
in_place:
341+
Whether to modify the ``SpatialExperiment`` in place. Defaults to False.
342342
343343
Returns:
344344
A modified ``SpatialExperiment`` object, either as a copy of the original or as a reference to the (in-place-modified) original.
@@ -401,10 +401,11 @@ def set_image_data(self, img_data: biocframe.BiocFrame, in_place: bool = False)
401401
"""Set new image data.
402402
403403
Args:
404-
img_data (biocframe.BiocFrame):
404+
img_data:
405405
New image data.
406406
407-
in_place (bool): Whether to modify the ``SpatialExperiment`` in place. Defaults to False.
407+
in_place:
408+
Whether to modify the ``SpatialExperiment`` in place. Defaults to False.
408409
409410
Returns:
410411
A modified ``SpatialExperiment`` object, either as a copy of the original or as a reference to the (in-place-modified) original.
@@ -461,12 +462,18 @@ def get_img(
461462
Retrieve spatial images based on the provided sample and image ids.
462463
463464
Args:
464-
# TODO: describe what `sample_id=True`, `sample_id=None`, `sample_id="sample_1"` mean
465-
sample_id (Union[str, True, None], optional): The sample id. `sample_id=True` then get all samples...
466-
image_id (Union[str, True, None], optional): The image id.
465+
sample_id: The sample id.
466+
- `sample_id=True`: Matches all samples.
467+
- `sample_id=None`: Matches the first sample.
468+
- `sample_id="<str>"`: Matches a sample by its id.
469+
470+
image_id: The image id.
471+
- `image_id=True`: Matches all images for the specified sample(s).
472+
- `image_id=None`: Matches the first image for the sample(s).
473+
- `image_id="<str>"`: Matches image(s) by its(their) id.
467474
468475
Returns:
469-
Union[SpatialImage, List[SpatialImage]]: One or more `SpatialImage` objects.
476+
One or more `SpatialImage` objects.
470477
471478
Behavior:
472479
- sample_id = True, image_id = True:
@@ -557,15 +564,15 @@ def add_img(
557564
Add a new image entry.
558565
559566
Args:
560-
image_source (str): The file path to the image.
561-
scale_factor (float): The scaling factor associated with the image.
562-
sample_id (Union[str, True, None]): The sample id.
563-
image_id (Union[str, True, None]): The image id.
564-
load (bool, optional): Whether to load the image into memory. If `True`,
567+
image_source: The file path to the image.
568+
scale_factor: The scaling factor associated with the image.
569+
sample_id: The sample id.
570+
image_id: The image id.
571+
load: Whether to load the image into memory. If `True`,
565572
the method reads the image file from `image_source`. Defaults to `True`.
566573
567574
Returns:
568-
SpatialExperiment: The updated SpatialExperiment object containing the
575+
The updated SpatialExperiment object containing the
569576
newly added image entry.
570577
571578
Raises:

0 commit comments

Comments
 (0)