Skip to content

Commit 8c6b91b

Browse files
committed
minor touch-up of docstrings
1 parent 5ac194e commit 8c6b91b

File tree

9 files changed

+90
-89
lines changed

9 files changed

+90
-89
lines changed

pyapr/filter/convolution.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def correlate(apr: APR,
7979
method: str
8080
Method used to apply the operation:
8181
82-
- 'pencil': construct isotropic neighborhoods of shape (stencil.shape[0], stencil.shape[1], apr.shape[2])
83-
- 'slice': construct isotropic neighborhoods of shape (stencil.shape[0], apr.shape[1], apr.shape[2])
84-
- 'cuda': compute the correlation using the GPU. Requires the package to be built with CUDA support,
82+
- ``'pencil'``: construct isotropic neighborhoods of shape (stencil.shape[0], stencil.shape[1], apr.shape[2])
83+
- ``'slice'``: construct isotropic neighborhoods of shape (stencil.shape[0], apr.shape[1], apr.shape[2])
84+
- ``'cuda'``: compute the correlation using the GPU. Requires the package to be built with CUDA support,
8585
and ``stencil`` to have shape (3, 3, 3) or (5, 5, 5).
8686
8787
The methods may differ in performance, depending on the input data, but produce the same result. (default: 'pencil')
@@ -151,9 +151,9 @@ def convolve(apr: APR,
151151
method: str
152152
Method used to apply the operation:
153153
154-
- 'pencil': construct isotropic neighborhoods of shape (stencil.shape[0], stencil.shape[1], apr.shape[2])
155-
- 'slice': construct isotropic neighborhoods of shape (stencil.shape[0], apr.shape[1], apr.shape[2])
156-
- 'cuda': compute the convolution using the GPU. Requires the package to be built with CUDA support,
154+
- ``'pencil'``: construct isotropic neighborhoods of shape (stencil.shape[0], stencil.shape[1], apr.shape[2])
155+
- ``'slice'``: construct isotropic neighborhoods of shape (stencil.shape[0], apr.shape[1], apr.shape[2])
156+
- ``'cuda'``: compute the convolution using the GPU. Requires the package to be built with CUDA support,
157157
and ``stencil`` to have shape (3, 3, 3) or (5, 5, 5).
158158
159159
The methods may differ in performance, depending on the input data, but produce the same result. (default: 'pencil')

pyapr/io/io_api.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def read(fpath: str,
2929
Parameters
3030
----------
3131
fpath: str
32-
APR file path, e.g. `/home/data/test.apr`
32+
APR file path, e.g. '/home/data/test.apr'
3333
apr: APR, optional
3434
APR object to read the file into. If None, a new object is generated. (default: None)
3535
parts: ByteParticles, ShortParticles, LongParticles or FloatParticles, optional
@@ -38,9 +38,9 @@ def read(fpath: str,
3838
t: int
3939
Time point to read. (default: 0)
4040
channel_name: str
41-
Channel to read. (default: `t`)
41+
Channel to read. (default: 't')
4242
parts_name: str
43-
Name of the particle field to read. (default: `particles`)
43+
Name of the particle field to read. (default: 'particles')
4444
4545
Return
4646
------
@@ -85,17 +85,17 @@ def write(fpath: str,
8585
Parameters
8686
----------
8787
fpath: str
88-
APR file path, e.g. `/home/data/test.apr`
88+
APR file path, e.g. '/home/data/test.apr'
8989
apr: APR
9090
APR object to write.
9191
parts: ByteParticles, ShortParticles, LongParticles or FloatParticles
9292
ParticleData object to write.
9393
t: int
9494
Time point under which the data is written. (default: 0)
9595
channel_name: str
96-
Channel under which the data is written. (default: `t`)
96+
Channel under which the data is written. (default: 't')
9797
parts_name: str
98-
Name of the particle field to write. (default: `particles`)
98+
Name of the particle field to write. (default: 'particles')
9999
write_linear: bool
100100
If `True`, writes linear APR structure, otherwise the sparse (random access) structure is written. The
101101
linear structure is used in most processing methods, but requires more memory. (default: `True`)
@@ -105,7 +105,7 @@ def write(fpath: str,
105105
subsequently using the tree. (default: `True`)
106106
tree_parts: ByteParticles, ShortParticles, LongParticles or FloatParticles, optional
107107
Values of tree particles (computed via e.g. `pyapr.tree.fill_tree_mean`). If provided, and
108-
`write_tree=True`, the values are written to file. This allows, e.g. lazy reconstruction at coarse resolutions
108+
``write_tree=True``, the values are written to file. This allows, e.g. lazy reconstruction at coarse resolutions
109109
using `pyapr.reconstruction.LazySlicer`. (default: None)
110110
111111
See also
@@ -144,15 +144,15 @@ def write_particles(fpath: str,
144144
Parameters
145145
----------
146146
fpath: str
147-
APR file path, e.g. `/home/data/test.apr`
147+
APR file path, e.g. '/home/data/test.apr'
148148
parts: ByteParticles, ShortParticles, LongParticles or FloatParticles
149149
ParticleData object to write.
150150
t: int
151151
Time point under which the data is written. (default: 0)
152152
channel_name: str
153-
Channel under which the data is written. (default: `t`)
153+
Channel under which the data is written. (default: 't')
154154
parts_name: str
155-
Name of the particle field to write. (default: `particles`)
155+
Name of the particle field to write. (default: 'particles')
156156
tree: bool
157157
If `True`, writes the particles under the tree structure. The provided particles should then correspond
158158
to the APR tree. Otherwise the data is written under the standard APR structure (default: `False`)
@@ -191,7 +191,7 @@ def read_particles(fpath: str,
191191
Parameters
192192
----------
193193
fpath: str
194-
APR file path, e.g. `/home/data/test.apr`
194+
APR file path, e.g. '/home/data/test.apr'
195195
apr: APR, optional
196196
Corresponding APR object, allowing an alternative (equivalent) read method to be used. Currently does not
197197
affect the result. (default: None)
@@ -201,9 +201,9 @@ def read_particles(fpath: str,
201201
t: int
202202
Time point under which the data is written. (default: 0)
203203
channel_name: str
204-
Channel under which the data is written. (default: `t`)
204+
Channel under which the data is written. (default: 't')
205205
parts_name: str
206-
Name of the particle field to write. (default: `particles`)
206+
Name of the particle field to write. (default: 'particles')
207207
tree: bool
208208
If `True`, reads the particles under the tree structure in the file. (default: `False`)
209209
@@ -248,13 +248,13 @@ def write_apr(fpath: str,
248248
Parameters
249249
----------
250250
fpath: str
251-
APR file path, e.g. `/home/data/test.apr`
251+
APR file path, e.g. '/home/data/test.apr'
252252
apr: APR
253253
APR object to write.
254254
t: int
255255
Time point under which the data is written. (default: 0)
256256
channel_name: str
257-
Channel under which the data is written. (default: `t`)
257+
Channel under which the data is written. (default: 't')
258258
write_linear: bool
259259
If `True`, writes linear APR structure, otherwise the sparse (random access) structure is written. The
260260
linear structure is used in most processing methods, but requires more memory. (default: `True`)
@@ -295,13 +295,13 @@ def read_apr(fpath: str,
295295
Parameters
296296
----------
297297
fpath: str
298-
APR file path, e.g. `/home/data/test.apr`
298+
APR file path, e.g. '/home/data/test.apr'
299299
apr: APR, optional
300300
APR object to read the file into. If None, a new object is generated. (default: None)
301301
t: int
302302
Time point to read. (default: 0)
303303
channel_name: str
304-
Channel to read. (default: `t`)
304+
Channel to read. (default: 't')
305305
306306
Return
307307
------
@@ -333,11 +333,11 @@ def get_particle_names(fpath: str,
333333
Parameters
334334
----------
335335
fpath: str
336-
APR file path, e.g. `/home/data/test.apr`
336+
APR file path, e.g. '/home/data/test.apr'
337337
t: int
338338
Time point to read. (default: 0)
339339
channel_name: str
340-
Channel to read. (default: `t`)
340+
Channel to read. (default: 't')
341341
tree: bool
342342
If `True`, checks the tree structure under the given channel and time point. (default: False)
343343
@@ -371,13 +371,13 @@ def get_particle_type(fpath: str,
371371
Parameters
372372
----------
373373
fpath: str
374-
APR file path, e.g. `/home/data/test.apr`
374+
APR file path, e.g. '/home/data/test.apr'
375375
t: int
376376
Time point to read. (default: 0)
377377
channel_name: str
378-
Channel to read. (default: `t`)
378+
Channel to read. (default: 't')
379379
parts_name: str
380-
Name of the particle field whose type is to be determined.
380+
Name of the particle field whose type is to be determined. (default: 'particles')
381381
tree: bool
382382
If `True`, checks the tree structure under the given channel and time point. (default: False)
383383

pyapr/morphology/morphology.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def dilation(apr: APR,
1515
inplace: bool = False) -> ParticleData:
1616
"""
1717
Apply morphological dilation (binary or grayscale) to an APR image. Only considers face-side neighbors
18-
(6-connectivity in 3D). If `radius > 1` the operation is repeated `radius` times.
18+
(6-connectivity in 3D). If ``radius > 1`` the operation is repeated ``radius`` times.
1919
2020
Parameters
2121
----------
@@ -26,14 +26,14 @@ def dilation(apr: APR,
2626
binary: bool
2727
If `True`, apply binary dilation. Otherwise, grayscale dilation is used. (default: False)
2828
radius: int
29-
Radius of the operation (the 6-connective operation is iterated `radius` times). (default: 1)
29+
Radius of the operation (the 6-connective operation is iterated ``radius`` times). (default: 1)
3030
inplace: bool
31-
If `True`, the operation modifies the input `parts`. Otherwise, a copy of the input is used. (default: False)
31+
If `True`, the operation modifies the input ``parts``. Otherwise, a copy of the input is used. (default: False)
3232
3333
Returns
3434
-------
3535
parts_copy: ByteParticles, ShortParticles, LongParticles or FloatParticles
36-
Output particle values of the same type as the input `parts`.
36+
Output particle values of the same type as the input ``parts``.
3737
"""
3838
_check_input(apr, parts)
3939
parts_copy = parts if inplace else parts.copy()
@@ -51,7 +51,7 @@ def erosion(apr: APR,
5151
inplace: bool = False) -> ParticleData:
5252
"""
5353
Apply morphological erosion (binary or grayscale) to an APR image. Only considers face-side neighbors
54-
(6-connectivity in 3D). If `radius > 1` the operation is repeated `radius` times.
54+
(6-connectivity in 3D). If ``radius > 1`` the operation is repeated ``radius`` times.
5555
5656
Parameters
5757
----------
@@ -62,14 +62,14 @@ def erosion(apr: APR,
6262
binary: bool
6363
If `True`, apply binary erosion. Otherwise, grayscale erosion is used. (default: False)
6464
radius: int
65-
Radius of the operation (the 6-connective operation is iterated `radius` times). (default: 1)
65+
Radius of the operation (the 6-connective operation is iterated ``radius`` times). (default: 1)
6666
inplace: bool
67-
If `True`, the operation modifies the input `parts`. Otherwise, a copy of the input is used. (default: False)
67+
If `True`, the operation modifies the input ``parts``. Otherwise, a copy of the input is used. (default: False)
6868
6969
Returns
7070
-------
7171
parts_copy: ByteParticles, ShortParticles, LongParticles or FloatParticles
72-
Output particle values of the same type as the input `parts`.
72+
Output particle values of the same type as the input ``parts``.
7373
"""
7474
_check_input(apr, parts)
7575
parts_copy = parts if inplace else parts.copy()
@@ -87,7 +87,7 @@ def opening(apr: APR,
8787
inplace: bool = False) -> ParticleData:
8888
"""
8989
Apply morphological opening (erosion followed by dilation) to an APR image. Only considers face-side neighbors
90-
(6-connectivity in 3D). If `radius > 1` the erosion and dilation are repeated `radius` times.
90+
(6-connectivity in 3D). If ``radius > 1`` the erosion and dilation are repeated ``radius`` times.
9191
9292
Parameters
9393
----------
@@ -96,16 +96,16 @@ def opening(apr: APR,
9696
parts: ByteParticles, ShortParticles, LongParticles or FloatParticles
9797
Input particle values.
9898
binary: bool
99-
If `True`, binary erosion and dilation is used. Otherwise `min` and `max` operators are used. (default: False)
99+
If `True`, binary erosion and dilation is used. Otherwise ``min`` and ``max`` operators are used. (default: False)
100100
radius: int
101-
Radius of the erosion and dilation operations. The 6-connective operations are iterated `radius` times. (default: 1)
101+
Radius of the erosion and dilation operations. The 6-connective operations are iterated ``radius`` times. (default: 1)
102102
inplace: bool
103-
If `True`, the operation modifies the input `parts`. Otherwise, a copy of the input is used. (default: False)
103+
If `True`, the operation modifies the input ``parts``. Otherwise, a copy of the input is used. (default: False)
104104
105105
Returns
106106
-------
107107
parts_copy: ByteParticles, ShortParticles, LongParticles or FloatParticles
108-
Output particle values of the same type as the input `parts`.
108+
Output particle values of the same type as the input ``parts``.
109109
"""
110110
_check_input(apr, parts)
111111
parts_copy = parts if inplace else parts.copy()
@@ -125,7 +125,7 @@ def closing(apr: APR,
125125
inplace: bool = False) -> ParticleData:
126126
"""
127127
Apply morphological closing (dilation followed by erosion) to an APR image. Only considers face-side neighbors
128-
(6-connectivity in 3D). If `radius > 1` the erosion and dilation are repeated `radius` times.
128+
(6-connectivity in 3D). If ``radius > 1`` the erosion and dilation are repeated ``radius`` times.
129129
130130
Parameters
131131
----------
@@ -134,16 +134,16 @@ def closing(apr: APR,
134134
parts: ByteParticles, ShortParticles, LongParticles or FloatParticles
135135
Input particle values.
136136
binary: bool
137-
If `True`, binary erosion and dilation is used. Otherwise `min` and `max` operators are used. (default: False)
137+
If `True`, binary erosion and dilation is used. Otherwise ``min`` and ``max`` operators are used. (default: False)
138138
radius: int
139-
Radius of the erosion and dilation operations. The 6-connective operations are iterated `radius` times. (default: 1)
139+
Radius of the erosion and dilation operations. The 6-connective operations are iterated ``radius`` times. (default: 1)
140140
inplace: bool
141-
If `True`, the operation modifies the input `parts`. Otherwise, a copy of the input is used. (default: False)
141+
If `True`, the operation modifies the input ``parts``. Otherwise, a copy of the input is used. (default: False)
142142
143143
Returns
144144
-------
145145
parts_copy: ByteParticles, ShortParticles, LongParticles or FloatParticles
146-
Output particle values of the same type as the input `parts`.
146+
Output particle values of the same type as the input ``parts``.
147147
"""
148148
_check_input(apr, parts)
149149
parts_copy = parts if inplace else parts.copy()
@@ -177,7 +177,7 @@ def tophat(apr: APR,
177177
Returns
178178
-------
179179
out: ByteParticles, ShortParticles, LongParticles or FloatParticles
180-
Output particle values of the same type as the input `parts`.
180+
Output particle values of the same type as the input ``parts``.
181181
182182
See also
183183
--------
@@ -209,7 +209,7 @@ def bottomhat(apr: APR,
209209
Returns
210210
-------
211211
out: ByteParticles, ShortParticles, LongParticles or FloatParticles
212-
Output particle values of the same type as the input `parts`.
212+
Output particle values of the same type as the input ``parts``.
213213
214214
See also
215215
--------
@@ -227,7 +227,7 @@ def remove_small_objects(apr: APR,
227227
"""
228228
Remove objects smaller than a threshold from an input label mask. Assumes that the background value is 0.
229229
230-
Note: internally allocates a vector of size `labels.max()+1`. If ``labels`` contains large values, consider
230+
Note: internally allocates a vector of size ``labels.max()+1``. If ``labels`` contains large values, consider
231231
relabeling consecutively from 0.
232232
233233
Parameters
@@ -237,9 +237,9 @@ def remove_small_objects(apr: APR,
237237
labels: ByteParticles, ShortParticles or LongParticles
238238
Input particle label mask.
239239
min_volume: int
240-
Remove objects smaller in volume than `min_volume` voxels.
240+
Remove objects smaller in volume than ``min_volume`` voxels.
241241
inplace: bool
242-
If True, the input `labels` are modified in-place. Otherwise, a copy is used. (default: False)
242+
If True, the input ``labels`` are modified in-place. Otherwise, a copy is used. (default: False)
243243
244244
Returns
245245
-------
@@ -259,7 +259,7 @@ def remove_large_objects(apr: APR,
259259
"""
260260
Remove objects larger than a threshold from an input label mask. Assumes that the background value is 0.
261261
262-
Note: internally allocates a vector of size `labels.max()+1`. If ``labels`` contains large values, consider
262+
Note: internally allocates a vector of size ``labels.max()+1``. If ``labels`` contains large values, consider
263263
relabeling consecutively from 0.
264264
265265
Parameters
@@ -269,7 +269,7 @@ def remove_large_objects(apr: APR,
269269
labels: ByteParticles, ShortParticles or LongParticles
270270
Input particle label mask.
271271
max_volume: int
272-
Remove objects larger in volume than `min_volume` voxels.
272+
Remove objects larger in volume than ``min_volume`` voxels.
273273
inplace: bool
274274
If True, the input `labels` are modified in-place. Otherwise, a copy is used. (default: False)
275275
@@ -298,7 +298,7 @@ def remove_small_holes(apr: APR,
298298
labels: ByteParticles, ShortParticles or LongParticles
299299
Input particle mask.
300300
min_volume: int
301-
Remove holes smaller in volume than `min_volume` voxels.
301+
Remove holes smaller in volume than ``min_volume`` voxels.
302302
background_label: int
303303
Value of the background label (default: 0)
304304
@@ -347,7 +347,7 @@ def remove_edge_objects(apr: APR,
347347
y_edges: bool
348348
If True, checks edges in the y dimension. (default: True)
349349
inplace: bool
350-
If True, the input `labels` are modified in-place. Otherwise, a copy is used. (default: False)
350+
If True, the input ``labels`` are modified in-place. Otherwise, a copy is used. (default: False)
351351
352352
Returns
353353
-------

0 commit comments

Comments
 (0)