From 52bb7c1cc1bb5008af677de72539ef3e66f72b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Ftay=20Fabry?= Date: Tue, 25 Jun 2024 07:37:43 +0200 Subject: [PATCH] add deprecation warning --- weldx/transformations/cs_manager.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/weldx/transformations/cs_manager.py b/weldx/transformations/cs_manager.py index 5e51e9a29..1cb4ff002 100644 --- a/weldx/transformations/cs_manager.py +++ b/weldx/transformations/cs_manager.py @@ -14,7 +14,7 @@ from weldx import util from weldx.core import TimeSeries -from weldx.exceptions import WeldxException +from weldx.exceptions import WeldxDeprecationWarning, WeldxException from weldx.geometry import SpatialData from weldx.time import Time, types_time_like, types_timestamp_like from weldx.util import check_matplotlib_available, dataclass_nested_eq @@ -441,6 +441,7 @@ def add_cs( reference_system_name: str, lcs: LocalCoordinateSystem, lcs_child_in_parent: bool = True, + lsc_child_in_parent: bool = True, ): """Add a coordinate system to the coordinate system manager. @@ -473,8 +474,22 @@ def add_cs( If set to `True`, the passed `LocalCoordinateSystem` instance describes the new system orientation towards is parent. If `False`, it describes how the parent system is positioned in its new child system. + lsc_child_in_parent + DEPRECATED. Use ``lcs_child_in_parent`` instead. """ + if not lsc_child_in_parent: + warnings.warn( + ( + "Argument 'lsc_child_in_parent' is deprecated" + " and will be removed in 0.7 please use 'lcs_child_in_parent'" + ), + category=WeldxDeprecationWarning, + stacklevel=2, + ) + if lcs_child_in_parent: + lcs_child_in_parent = lsc_child_in_parent + if not isinstance(lcs, LocalCoordinateSystem): raise TypeError( "'local_coordinate_system' must be an instance of LocalCoordinateSystem"