Skip to content

Add docs to get_auto_lims #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/probeinterface/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down