diff --git a/src/probeinterface/utils.py b/src/probeinterface/utils.py index 364af8f4..5a87acfc 100644 --- a/src/probeinterface/utils.py +++ b/src/probeinterface/utils.py @@ -139,7 +139,24 @@ def generate_unique_ids(min: int, max: int, n: int, trials: int = 20) -> np.arra return ids -def get_auto_lims(probe, margin=40): +def get_auto_lims(probe: Probe, margin: float = 40.0) -> tuple[float, float, float]: + """ + Compute the boundaries of a given probe, considering its contour and an optional margin. + The function is designed to handle both planar and three-dimensional probes. + + Parameters + ---------- + probe : Probe + The probe for which the limits are to be computed. + margin : float, default: 40 + An isotropic margin that is added to the exact probe boundaries. + + Returns + ------- + lims : a tuple containing the limits in the x, y, and z directions + (xlims, ylims, zlims). If the provided probe is planar, then + zlims is None. + """ positions = probe.contact_positions planar_contour = probe.probe_planar_contour