From 5ff61c7b32f97b5d6cd0e21640078b165953ca50 Mon Sep 17 00:00:00 2001 From: FrancescoNegri Date: Thu, 25 Jul 2024 15:59:18 +0200 Subject: [PATCH 1/4] Add docs to get_auto_lims --- src/probeinterface/utils.py | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/probeinterface/utils.py b/src/probeinterface/utils.py index 364af8f4..59bf9085 100644 --- a/src/probeinterface/utils.py +++ b/src/probeinterface/utils.py @@ -139,7 +139,42 @@ 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]: + """ + Automatically compute a probe boundaries given its contour and an optional + margin. Both planar and tridimensional probes are accepted. + + Parameters + ---------- + probe : Probe + The probe whose limits are to be computed. + margin : float, default: 40 + An isotropic margin added to the exact probe boundaries. + + Returns + ------- + lims : a tuple containing xlims, ylims, and zlims. If the provided probe + is planar, then zlims is None. + + """ + + """ + Compute the boundaries of a given probe, considering its contour and an optional margin. + The function is designed to handle both planar and tridimensional 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 From 9647013c16475c4d2565a2df6e6280e9035cbae1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 14:01:26 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/probeinterface/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/probeinterface/utils.py b/src/probeinterface/utils.py index 59bf9085..e8ba5dc7 100644 --- a/src/probeinterface/utils.py +++ b/src/probeinterface/utils.py @@ -155,11 +155,11 @@ def get_auto_lims(probe: Probe, margin: float = 40.0) -> tuple[float, float, flo ------- lims : a tuple containing xlims, ylims, and zlims. If the provided probe is planar, then zlims is None. - + """ """ - Compute the boundaries of a given probe, considering its contour and an optional margin. + Compute the boundaries of a given probe, considering its contour and an optional margin. The function is designed to handle both planar and tridimensional probes. Parameters From e8c63b903e03b8db497314b93123b7700d77fc4c Mon Sep 17 00:00:00 2001 From: FrancescoNegri Date: Mon, 29 Jul 2024 15:08:39 +0200 Subject: [PATCH 3/4] Fix duplicate --- src/probeinterface/utils.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/probeinterface/utils.py b/src/probeinterface/utils.py index e8ba5dc7..a31a2927 100644 --- a/src/probeinterface/utils.py +++ b/src/probeinterface/utils.py @@ -140,24 +140,6 @@ def generate_unique_ids(min: int, max: int, n: int, trials: int = 20) -> np.arra def get_auto_lims(probe: Probe, margin: float = 40.0) -> tuple[float, float, float]: - """ - Automatically compute a probe boundaries given its contour and an optional - margin. Both planar and tridimensional probes are accepted. - - Parameters - ---------- - probe : Probe - The probe whose limits are to be computed. - margin : float, default: 40 - An isotropic margin added to the exact probe boundaries. - - Returns - ------- - lims : a tuple containing xlims, ylims, and zlims. If the provided probe - is planar, then zlims is None. - - """ - """ Compute the boundaries of a given probe, considering its contour and an optional margin. The function is designed to handle both planar and tridimensional probes. From a4557b51accf26450b28bf68cd1cdfc5cdfd59b0 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 6 Aug 2024 11:01:11 +0200 Subject: [PATCH 4/4] Update src/probeinterface/utils.py Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com> --- src/probeinterface/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/probeinterface/utils.py b/src/probeinterface/utils.py index a31a2927..5a87acfc 100644 --- a/src/probeinterface/utils.py +++ b/src/probeinterface/utils.py @@ -142,7 +142,7 @@ def generate_unique_ids(min: int, max: int, n: int, trials: int = 20) -> np.arra 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 tridimensional probes. + The function is designed to handle both planar and three-dimensional probes. Parameters ----------