From ffb7aa0541e2ecef4a48e87d4b0b805df8e29b6c Mon Sep 17 00:00:00 2001 From: Pim Nelissen Date: Wed, 28 Jan 2026 08:59:05 +0100 Subject: [PATCH] rename piecewise_regression_on_path to simplify_path --- src/pg_rad/path.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pg_rad/path.py b/src/pg_rad/path.py index 3093153..82215d5 100644 --- a/src/pg_rad/path.py +++ b/src/pg_rad/path.py @@ -43,13 +43,14 @@ class Path: self, coord_list: Sequence[tuple[float, float]], z: float = 0, - simplify_path = False + path_simplify = False ): """Construct a path of sequences based on a list of coordinates. Args: coord_list (Sequence[tuple[float, float]]): List of x,y coordinates. z (float, optional): Height of the path. Defaults to 0. + path_simplify (bool, optional): Whether to pg_rad.path.simplify_path(). Defaults to False. """ if len(coord_list) < 2: @@ -57,9 +58,9 @@ class Path: x, y = tuple(zip(*coord_list)) - if simplify_path: + if path_simplify: try: - x, y = piecewise_regression_on_path(list(x), list(y)) + x, y = simplify_path(list(x), list(y)) except ConvergenceError: logger.warning("Continuing without simplifying path.") @@ -89,7 +90,7 @@ class Path: """ plt.plot(self.x_list, self.y_list, **kwargs) -def piecewise_regression_on_path( +def simplify_path( x: Sequence[float], y: Sequence[float], keep_endpoints_equal: bool = False,