Skip to content

Commit d6fafb5

Browse files
committed
missed a couple of docstrings
1 parent e5a10e6 commit d6fafb5

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,5 @@ ignore = [
104104
"D400", # first line should end with a period [Bug: doesn’t work with single-line docstrings]
105105
"D401", # First line should be in imperative mood; try rephrasing
106106
]
107-
per-file-ignores."*/__init__.py" = ["F401"]
108107
per-file-ignores."tests/*" = ["D"]
109108
pydocstyle.convention = "numpy"

tests/preprocessing/resize_images_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_resize_volumes(self):
132132
),
133133
ignore_index=True,
134134
)
135-
op_fname = f"im_c00{c}_z000_t005_p007_3.3-0.8-1.0.npy"
135+
op_fname = "im_c00{c}_z000_t005_p007_3.3-0.8-1.0.npy".format(c=c)
136136
exp_meta_dict.append(
137137
{
138138
"time_idx": self.time_idx,
@@ -168,7 +168,7 @@ def test_resize_volumes(self):
168168
exp_meta_dict = []
169169
for c in channel_ids:
170170
for s in [0, 2]:
171-
op_fname = f"im_c00{c}_z00{s}_t005_p007_3.3-0.8-1.0.npy"
171+
op_fname = "im_c00{c}_z00{s}_t005_p007_3.3-0.8-1.0.npy".format(c=c, s=s)
172172
exp_meta_dict.append(
173173
{
174174
"time_idx": self.time_idx,

viscy/data/combined.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,20 @@ class CachedConcatDataModule(LightningDataModule):
396396
397397
Concatenates multiple data modules with support for distributed
398398
sampling and caching optimizations for large-scale ML training.
399-
# TODO: MANUAL_REVIEW - Verify caching behavior and memory usage
399+
400+
Parameters
401+
----------
402+
data_modules : Sequence[LightningDataModule]
403+
Data modules to concatenate.
404+
405+
Raises
406+
------
407+
ValueError
408+
If inconsistent number of workers or batch size across data modules.
409+
NotImplementedError
410+
If stage other than "fit" is requested.
411+
ValueError
412+
If patches per stack are inconsistent across data modules.
400413
"""
401414

402415
def __init__(self, data_modules: Sequence[LightningDataModule]):

viscy/data/hcs.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import os
44
import re
55
import tempfile
6-
7-
# from collections.abc import Callable, Sequence
86
from pathlib import Path
97
from typing import Callable, Literal, Sequence
108

@@ -35,8 +33,15 @@ def _ensure_channel_list(str_or_seq: str | Sequence[str]) -> list[str]:
3533
"""
3634
Ensure channel argument is a list of strings.
3735
38-
:param Union[str, Sequence[str]] str_or_seq: channel name or list of channel names
39-
:return list[str]: list of channel names
36+
Parameters
37+
----------
38+
str_or_seq : str | Sequence[str]
39+
Channel name or list of channel names
40+
41+
Returns
42+
-------
43+
list[str]
44+
List of channel names
4045
"""
4146
if isinstance(str_or_seq, str):
4247
return [str_or_seq]
@@ -81,10 +86,17 @@ def _search_int_in_str(pattern: str, file_name: str) -> str:
8186
def _collate_samples(batch: Sequence[Sample]) -> Sample:
8287
"""Collate samples into a batch sample.
8388
84-
:param Sequence[Sample] batch: a sequence of dictionaries,
89+
Parameters
90+
----------
91+
batch : Sequence[Sample]
92+
A sequence of dictionaries,
8593
where each key may point to a value of a single tensor or a list of tensors,
8694
as is the case with ``train_patches_per_stack > 1``.
87-
:return Sample: Batch sample (dictionary of tensors)
95+
96+
Returns
97+
-------
98+
Sample
99+
Batch sample (dictionary of tensors)
88100
"""
89101
collated: Sample = {}
90102
for key in batch[0].keys():

0 commit comments

Comments
 (0)