Skip to content

Commit f0e7bf6

Browse files
committed
add documentation of __init__ method
1 parent c85818b commit f0e7bf6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def setup(app):
9393
autodoc_default_options = {
9494
"member-order": "bysource",
9595
}
96+
autoclass_content = 'both'
9697

9798
html_favicon = "favicon.png"
9899
html_logo = "_static/scPortrait_logo_light.svg"

src/scportrait/pipeline/segmentation/segmentation.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Segmentation(ProcessingStep):
2929
"""Segmentation helper class used for creating segmentation workflows.
3030
3131
Attributes:
32-
maps (dict(str)): Segmentation workflows based on the :class:`.Segmentation` class can use maps for saving and loading checkpoints and perform. Maps can be numpy arrays
32+
maps (dict(str)): Segmentation workflows based on the :class:`.Segmentation` class can use maps for saving and loading checkpoints and perform operations. Maps can be array like structures, e.g. memory-mapped temp arrays.
3333
3434
DEFAULT_FILTER_ADDTIONAL_FILE (str, default ``filtered_classes.csv``)
3535
PRINT_MAPS_ON_DEBUG (bool, default ``False``)
@@ -59,8 +59,8 @@ def process(self):
5959
"""
6060

6161
# setup log and plotting behaviour
62-
CLEAN_LOG = True
63-
PRINT_MAPS_ON_DEBUG = True
62+
CLEAN_LOG: bool = True
63+
PRINT_MAPS_ON_DEBUG: bool = True
6464

6565
# load default values from constants.py
6666
DEFAULT_FILTER_ADDTIONAL_FILE = DEFAULT_FILTER_ADDTIONAL_FILE
@@ -350,11 +350,11 @@ def _save_segmentation_sdata(self, labels, classes, masks=None):
350350
self.log("No cytosols found in segmentation mask. Please check your processing")
351351
warnings.warn("No cytosols found in segmentation mask. Please check your processing", stacklevel=2)
352352

353-
def save_map(self, map_name):
353+
def save_map(self, map_name: str) -> None:
354354
"""Saves newly computed map.
355355
356-
Args
357-
map_name (str): name of the map to be saved, as defined in ``self.maps``.
356+
Args:
357+
map_name: name of the map to be saved, as defined in ``self.maps``.
358358
359359
Example:
360360
@@ -395,6 +395,7 @@ def save_map(self, map_name):
395395
if self.debug and self.PRINT_MAPS_ON_DEBUG:
396396
self.save_image(self.maps[map_name], save_name=channel_path)
397397

398+
398399
def save_image(self, array, save_name="", cmap="magma", **kwargs):
399400
if np.issubdtype(array.dtype.type, np.integer):
400401
self.log(f"{save_name} will be saved as tif")
@@ -417,7 +418,7 @@ def save_image(self, array, save_name="", cmap="magma", **kwargs):
417418
def get_output(self):
418419
return os.path.join(self.directory, self.DEFAULT_SEGMENTATION_FILE)
419420

420-
def _initialize_as_shard(self, identifier, window, input_path, zarr_status=True):
421+
def _initialize_as_shard(self, identifier: int, window, input_path, zarr_status=True):
421422
"""Initialize Segmentation Step with further parameters needed for federated segmentation.
422423
423424
Important:

0 commit comments

Comments
 (0)