Skip to content

Commit 54fe042

Browse files
authored
Merge pull request #290 from FrancescoNegri/docs/get-auto-lims
Add docs to get_auto_lims
2 parents a6f0387 + a4557b5 commit 54fe042

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/probeinterface/utils.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,24 @@ def generate_unique_ids(min: int, max: int, n: int, trials: int = 20) -> np.arra
139139
return ids
140140

141141

142-
def get_auto_lims(probe, margin=40):
142+
def get_auto_lims(probe: Probe, margin: float = 40.0) -> tuple[float, float, float]:
143+
"""
144+
Compute the boundaries of a given probe, considering its contour and an optional margin.
145+
The function is designed to handle both planar and three-dimensional probes.
146+
147+
Parameters
148+
----------
149+
probe : Probe
150+
The probe for which the limits are to be computed.
151+
margin : float, default: 40
152+
An isotropic margin that is added to the exact probe boundaries.
153+
154+
Returns
155+
-------
156+
lims : a tuple containing the limits in the x, y, and z directions
157+
(xlims, ylims, zlims). If the provided probe is planar, then
158+
zlims is None.
159+
"""
143160
positions = probe.contact_positions
144161
planar_contour = probe.probe_planar_contour
145162

0 commit comments

Comments
 (0)