From 22f7f464187a3cf0f0cc061f704be0917c5b9b1d Mon Sep 17 00:00:00 2001 From: "Martin K. Scherer" Date: Wed, 6 Mar 2024 11:20:24 +0100 Subject: [PATCH] use util func instead of TDI --- weldx/tests/test_time.py | 70 +++++---- weldx/tests/transformations/test_local_cs.py | 156 +++++++++++-------- 2 files changed, 131 insertions(+), 95 deletions(-) diff --git a/weldx/tests/test_time.py b/weldx/tests/test_time.py index 8e979fdad..2ca0028ee 100644 --- a/weldx/tests/test_time.py +++ b/weldx/tests/test_time.py @@ -7,7 +7,6 @@ import xarray as xr from pandas import DatetimeIndex as DTI from pandas import Timedelta, Timestamp, date_range -from pandas import TimedeltaIndex as TDI from pint import DimensionalityError from weldx.constants import Q_ @@ -77,7 +76,7 @@ def _initialize_time_type( def _is_timedelta(cls_type): """Return ``True`` if the passed type is a timedelta type.""" - return cls_type in [TDI, Timedelta, np.timedelta64] or ( + return cls_type in [pd.to_timedelta, Timedelta, np.timedelta64] or ( cls_type is Time and not Time.is_absolute ) @@ -143,7 +142,9 @@ def _get_init_exp_values( val = [v + offset for v in delta_val] val = val[0] if data_was_scalar else val - exp_timedelta = Timedelta(val, "s") if data_was_scalar else TDI(val, "s") + exp_timedelta = ( + Timedelta(val, "s") if data_was_scalar else pd.to_timedelta(val, "s") + ) # expected datetime exp_datetime = None @@ -168,7 +169,7 @@ def _get_init_exp_values( (str, "timedelta"), (Time, "timedelta"), (Q_, "timedelta"), - TDI, + pd.to_timedelta, Timedelta, np.timedelta64, (str, "datetime"), @@ -209,7 +210,7 @@ def test_init( # skip matrix cases that do not work -------------------- if arr and input_type in [Timedelta, Timestamp]: return - if not arr and input_type in [DTI, TDI]: + if not arr and input_type in [DTI, pd.to_timedelta]: return # create input values ----------------------------------- @@ -247,7 +248,7 @@ def test_init( LocalCoordinateSystem( coordinates=Q_(np.zeros((2, 3)), "mm"), time=["2000", "2001"] ), - TimeSeries(Q_([2, 4, 1], "m"), TDI([1, 2, 3], "s")), + TimeSeries(Q_([2, 4, 1], "m"), pd.to_timedelta([1, 2, 3], "s")), TimeSeries(Q_([2, 4, 1], "m"), ["2001", "2002", "2003"]), ], ) @@ -262,7 +263,7 @@ def test_init_from_time_dependent_types(time_dep_type): @pytest.mark.parametrize( "time, time_ref, raises", [ - (TDI([3, 2, 1]), None, ValueError), + (pd.to_timedelta([3, 2, 1]), None, ValueError), (DTI(["2010", "2000"]), None, ValueError), (["2010", "2000"], None, ValueError), (Q_([3, 2, 1], "s"), None, ValueError), @@ -290,7 +291,7 @@ def test_init_exception(time, time_ref, raises): (str, "timedelta"), (Time, "timedelta"), (Q_, "timedelta"), - TDI, + pd.to_timedelta, Timedelta, np.timedelta64, (str, "datetime"), @@ -331,7 +332,7 @@ def test_add_timedelta( # skip array cases where the type does not support arrays if other_type in [Timedelta, Timestamp] and other_is_array: return - if not other_is_array and other_type in [DTI, TDI]: + if not other_is_array and other_type in [DTI, pd.to_timedelta]: return # skip __radd__ cases where we got conflicts with the other types' __add__ @@ -341,7 +342,7 @@ def test_add_timedelta( np.timedelta64, np.datetime64, DTI, - TDI, + pd.to_timedelta, ): return @@ -392,7 +393,7 @@ def test_add_timedelta( str, Time, Q_, - TDI, + pd.to_timedelta, Timedelta, np.timedelta64, ], @@ -421,11 +422,16 @@ def test_add_datetime( # skip array cases where the type does not support arrays if other_type in [Timedelta, Timestamp] and other_is_array: return - if not other_is_array and other_type in [DTI, TDI]: + if not other_is_array and other_type in [DTI, pd.to_timedelta]: return # skip __radd__ cases where we got conflicts with the other types' __add__ - if not other_on_rhs and other_type in (Q_, np.ndarray, np.timedelta64, TDI): + if not other_on_rhs and other_type in ( + Q_, + np.ndarray, + np.timedelta64, + pd.to_timedelta, + ): return # setup rhs @@ -477,7 +483,7 @@ def _date_diff(date_1: str, date_2: str, unit: str) -> int: (str, "timedelta"), (Time, "timedelta"), (Q_, "timedelta"), - TDI, + pd.to_timedelta, Timedelta, np.timedelta64, (str, "datetime"), @@ -532,7 +538,7 @@ def test_sub( # skip array cases where the type does not support arrays or scalars if other_type in [Timedelta, Timestamp] and other_is_array: return - if not other_is_array and other_type in [DTI, TDI]: + if not other_is_array and other_type in [DTI, pd.to_timedelta]: return # skip __rsub__ cases where we got conflicts with the other types' __sub__ @@ -542,7 +548,7 @@ def test_sub( np.timedelta64, np.datetime64, DTI, - TDI, + pd.to_timedelta, ): return @@ -612,13 +618,16 @@ def test_sub( "arg, expected", [ # timedeltas - (TDI([42], unit="ns"), TDI([42], unit="ns")), + (pd.to_timedelta([42], unit="ns"), pd.to_timedelta([42], unit="ns")), (pd.timedelta_range("0s", "20s", 10), pd.timedelta_range("0s", "20s", 10)), - (np.timedelta64(42), TDI([42], unit="ns")), - (np.array([-10, 0, 20]).astype("timedelta64[ns]"), TDI([-10, 0, 20], "ns")), - (Q_(42, "ns"), TDI([42], unit="ns")), - ("10s", TDI(["10s"])), - (["5ms", "10s", "2D"], TDI(["5 ms", "10s", "2D"])), + (np.timedelta64(42), pd.to_timedelta([42], unit="ns")), + ( + np.array([-10, 0, 20]).astype("timedelta64[ns]"), + pd.to_timedelta([-10, 0, 20], "ns"), + ), + (Q_(42, "ns"), pd.to_timedelta([42], unit="ns")), + ("10s", pd.to_timedelta(["10s"])), + (["5ms", "10s", "2D"], pd.to_timedelta(["5 ms", "10s", "2D"])), # datetimes (np.datetime64(50, "Y"), DTI(["2020-01-01"])), ("2020-01-01", DTI(["2020-01-01"])), @@ -647,10 +656,10 @@ def test_pandas_index(arg, expected): ("1s", "ms", 1000), ("1s", "us", 1000000), ("1s", "ns", 1000000000), - (TDI([1, 2, 3], "s"), "s", [1, 2, 3]), - (TDI([1, 2, 3], "s"), "ms", np.array([1, 2, 3]) * 1e3), - (TDI([1, 2, 3], "s"), "us", np.array([1, 2, 3]) * 1e6), - (TDI([1, 2, 3], "s"), "ns", np.array([1, 2, 3]) * 1e9), + (pd.to_timedelta([1, 2, 3], "s"), "s", [1, 2, 3]), + (pd.to_timedelta([1, 2, 3], "s"), "ms", np.array([1, 2, 3]) * 1e3), + (pd.to_timedelta([1, 2, 3], "s"), "us", np.array([1, 2, 3]) * 1e6), + (pd.to_timedelta([1, 2, 3], "s"), "ns", np.array([1, 2, 3]) * 1e9), ("2020-01-01", "s", 0), ], ) @@ -775,7 +784,14 @@ def test_resample_exceptions(values, number_or_interval, raises): ], date_range("2020-02-01", periods=8, freq="1D"), ), - ([TDI([1, 5]), TDI([2, 6, 7]), TDI([1, 3, 7])], TDI([1, 2, 3, 5, 6, 7])), + ( + [ + pd.to_timedelta([1, 5]), + pd.to_timedelta([2, 6, 7]), + pd.to_timedelta([1, 3, 7]), + ], + pd.to_timedelta([1, 2, 3, 5, 6, 7]), + ), ], ) @pytest.mark.parametrize("test_instance", [True, False]) diff --git a/weldx/tests/transformations/test_local_cs.py b/weldx/tests/transformations/test_local_cs.py index 1bb1ff03e..7de20db85 100644 --- a/weldx/tests/transformations/test_local_cs.py +++ b/weldx/tests/transformations/test_local_cs.py @@ -9,7 +9,6 @@ import pint import pytest import xarray as xr -from pandas import TimedeltaIndex as TDI from pandas import Timestamp as TS from pandas import date_range from pint import DimensionalityError @@ -57,7 +56,7 @@ def test_init(orient, coords, time, time_ref, exception, data_array_coords): # test_init_time_formats --------------------------------------------------------------- timestamp = TS("2000-01-01") -time_delta = TDI([0, 1, 2], "s") +time_delta = pd.to_timedelta([0, 1, 2], "s") time_quantity = Q_([0, 1, 2], "s") date_time = date_range("2000-01-01", periods=3, freq="s") @@ -73,7 +72,7 @@ def test_init(orient, coords, time, time_ref, exception, data_array_coords): ( date_time, TS("1999-12-31"), - TDI([86400, 86401, 86402], "s"), + pd.to_timedelta([86400, 86401, 86402], "s"), TS("1999-12-31"), ), ], @@ -110,8 +109,13 @@ def test_init_time_formats(time, time_ref, time_exp, time_ref_exp): @pytest.mark.parametrize( "coordinates, orientation, time, warning", [ - (Q_(np.zeros(3), "mm"), np.eye(3, 3), TDI([0, 2], "s"), UserWarning), - (Q_(np.zeros((2, 3)), "mm"), np.eye(3, 3), TDI([0, 2], "s"), None), + ( + Q_(np.zeros(3), "mm"), + np.eye(3, 3), + pd.to_timedelta([0, 2], "s"), + UserWarning, + ), + (Q_(np.zeros((2, 3)), "mm"), np.eye(3, 3), pd.to_timedelta([0, 2], "s"), None), (Q_(np.zeros(3), "mm"), np.eye(3, 3), None, None), ], ) @@ -149,11 +153,15 @@ def _call(): @pytest.mark.parametrize( "time_o, time_c, time_exp", [ - (TDI([0, 1, 2], "s"), TDI([0, 1, 2], "s"), TDI([0, 1, 2], "s")), ( - TDI([0, 2, 4], "s"), - TDI([1, 3, 5], "s"), - TDI([0, 1, 2, 3, 4, 5], "s"), + pd.to_timedelta([0, 1, 2], "s"), + pd.to_timedelta([0, 1, 2], "s"), + pd.to_timedelta([0, 1, 2], "s"), + ), + ( + pd.to_timedelta([0, 2, 4], "s"), + pd.to_timedelta([1, 3, 5], "s"), + pd.to_timedelta([0, 1, 2, 3, 4, 5], "s"), ), ], ) @@ -326,22 +334,22 @@ def test_from_axis_vectors_exceptions(kwargs, exception_type, test_name): "time, time_ref, time_ref_new, time_exp", [ ( - TDI([1, 2, 3], "D"), + pd.to_timedelta([1, 2, 3], "D"), TS("2020-02-02"), TS("2020-02-01"), - TDI([2, 3, 4], "D"), + pd.to_timedelta([2, 3, 4], "D"), ), ( - TDI([1, 2, 3], "D"), + pd.to_timedelta([1, 2, 3], "D"), TS("2020-02-02"), "2020-02-01", - TDI([2, 3, 4], "D"), + pd.to_timedelta([2, 3, 4], "D"), ), ( - TDI([1, 2, 3], "D"), + pd.to_timedelta([1, 2, 3], "D"), None, "2020-02-01", - TDI([1, 2, 3], "D"), + pd.to_timedelta([1, 2, 3], "D"), ), ], ) @@ -417,42 +425,42 @@ def test_reset_reference_time_exceptions( [ ( # broadcast left TS("2020-02-10"), - TDI([1, 2, 14], "D"), + pd.to_timedelta([1, 2, 14], "D"), TS("2020-02-10"), r_mat_z([0, 0, 0.5]), np.array([[2, 8, 7], [2, 8, 7], [4, 9, 2]]), ), ( # broadcast right TS("2020-02-10"), - TDI([14, 29, 30], "D"), + pd.to_timedelta([14, 29, 30], "D"), TS("2020-02-10"), r_mat_z([0.5, 0.5, 0.5]), np.array([[4, 9, 2], [3, 1, 2], [3, 1, 2]]), ), ( # pure interpolation TS("2020-02-10"), - TDI([11, 14, 17, 20], "D"), + pd.to_timedelta([11, 14, 17, 20], "D"), TS("2020-02-10"), r_mat_z([0.125, 0.5, 0.875, 0.75]), np.array([[2.5, 8.25, 5.75], [4, 9, 2], [1, 3.75, 1.25], [1.5, 1.5, 1.5]]), ), ( # mixed TS("2020-02-10"), - TDI([6, 12, 18, 24, 32], "D"), + pd.to_timedelta([6, 12, 18, 24, 32], "D"), TS("2020-02-10"), r_mat_z([0, 0.25, 1, 0.5, 0.5]), np.array([[2, 8, 7], [3, 8.5, 4.5], [0, 2, 1], [3, 1, 2], [3, 1, 2]]), ), ( # different reference times TS("2020-02-10"), - TDI([8, 14, 20, 26, 34], "D"), + pd.to_timedelta([8, 14, 20, 26, 34], "D"), TS("2020-02-08"), r_mat_z([0, 0.25, 1, 0.5, 0.5]), np.array([[2, 8, 7], [3, 8.5, 4.5], [0, 2, 1], [3, 1, 2], [3, 1, 2]]), ), ( # no reference time None, - TDI([6, 12, 18, 24, 32], "D"), + pd.to_timedelta([6, 12, 18, 24, 32], "D"), None, r_mat_z([0, 0.25, 1, 0.5, 0.5]), np.array([[2, 8, 7], [3, 8.5, 4.5], [0, 2, 1], [3, 1, 2], [3, 1, 2]]), @@ -708,10 +716,22 @@ def test_interp_time_timeseries_as_coords( @pytest.mark.parametrize( "time_ref_lcs, time, time_ref, exception_type, test_name", [ - (TS("2020-02-02"), TDI([1]), None, TypeError, "# mixed ref. times #1"), - (None, TDI([1]), TS("2020-02-02"), TypeError, "# mixed ref. times #2"), + ( + TS("2020-02-02"), + pd.to_timedelta([1]), + None, + TypeError, + "# mixed ref. times #1", + ), + ( + None, + pd.to_timedelta([1]), + TS("2020-02-02"), + TypeError, + "# mixed ref. times #2", + ), (TS("2020-02-02"), "no", TS("2020-02-02"), TypeError, "# wrong type #1"), - (TS("2020-02-02"), TDI([1]), "no", Exception, "# wrong type #2"), + (TS("2020-02-02"), pd.to_timedelta([1]), "no", Exception, "# wrong type #2"), ], ids=get_test_name, ) @@ -764,26 +784,26 @@ def test_interp_time_exceptions( LCS( r_mat_z([0, 0.5, 1]), Q_([1, 4, 2], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), LCS(r_mat_z(0.5), Q_([3, 7, 1], "mm")), r_mat_z([0.5, 1, 1.5]), [[-1, 8, 3], [-1, 8, 3], [-1, 8, 3]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 3 - left system coordinates time dependent LCS( r_mat_y(0.5), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), LCS(r_mat_z(0.5), Q_([3, 7, 1], "mm")), [[[0, -1, 0], [0, 0, 1], [-1, 0, 0]] for _ in range(3)], [[-4, 10, 2], [5, 11, 9], [0, 2, 0]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 4 - right system orientation time dependent @@ -791,12 +811,12 @@ def test_interp_time_exceptions( LCS( r_mat_z([0, 0.5, 1]), Q_([1, 4, 2], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.5, 1, 1.5]), [[4, 11, 3], [-6, 7, 3], [-2, -3, 3]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 5 - right system coordinates time dependent @@ -804,12 +824,12 @@ def test_interp_time_exceptions( LCS( r_mat_z(0.5), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z(1), [[-4, 10, 2], [-3, 1, 9], [-12, 6, 0]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 6 - right system fully time dependent @@ -817,84 +837,84 @@ def test_interp_time_exceptions( LCS( r_mat_z([0, 0.5, 1]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.5, 1, 1.5]), [[6, 14, 2], [-3, 1, 9], [-8, -4, 0]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 7 - both fully time dependent - same time and reference time LCS( r_mat_z([1, 0, 0]), Q_([[4, 2, 5], [3, -3, 2], [1, 7, -9]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), LCS( r_mat_z([0, 0.5, 1]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([1, 0.5, 1]), [[7, 9, 6], [7, 1, 10], [-6, -4, -10]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 8 - both fully time dependent - different time but same reference time LCS( r_mat_z([1.5, 1.0, 0.75]), Q_([[4, 2, 5], [3, -3, 2], [1, 7, -9]], "mm"), - TDI([2, 4, 6], "D"), + pd.to_timedelta([2, 4, 6], "D"), TS("2020-02-02"), ), LCS( r_mat_z([0.75, 1.25, 0.75]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.5, 0.0, 1.5]), [[-0.5, 0.5, 9.5], [-3.5, 3.5, 5.5], [-10.6568542, -1.242640687, -10]], - TDI([2, 4, 6], "D"), + pd.to_timedelta([2, 4, 6], "D"), TS("2020-02-02"), ), ( # 9 - both fully time dependent - different time and reference time #1 LCS( r_mat_z([1.5, 1.0, 0.75]), Q_([[4, 2, 5], [3, -3, 2], [1, 7, -9]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-03"), ), LCS( r_mat_z([0.75, 1.25, 0.75]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.5, 0.0, 1.5]), [[-0.5, 0.5, 9.5], [-3.5, 3.5, 5.5], [-10.6568542, -1.242640687, -10]], - TDI([2, 4, 6], "D"), + pd.to_timedelta([2, 4, 6], "D"), TS("2020-02-02"), ), ( # 10 - both fully time dependent - different time and reference time #2 LCS( r_mat_z([1.5, 1.0, 0.75]), Q_([[4, 2, 5], [3, -3, 2], [1, 7, -9]], "mm"), - TDI([3, 5, 7], "D"), + pd.to_timedelta([3, 5, 7], "D"), TS("2020-02-01"), ), LCS( r_mat_z([0.75, 1.25, 0.75]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.5, 0.0, 1.5]), [[-0.5, 0.5, 9.5], [-3.5, 3.5, 5.5], [-10.6568542, -1.242640687, -10]], - TDI([3, 5, 7], "D"), + pd.to_timedelta([3, 5, 7], "D"), TS("2020-02-01"), ), ], @@ -949,26 +969,26 @@ def test_addition( LCS( r_mat_z([0.5, 1, 1.5]), Q_([-1, 8, 3], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), LCS(r_mat_z(0.5), Q_([3, 7, 1], "mm")), r_mat_z([0, 0.5, 1]), [[1, 4, 2], [1, 4, 2], [1, 4, 2]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 3 - left system coordinates time dependent LCS( [[0, -1, 0], [0, 0, 1], [-1, 0, 0]], Q_([[-4, 10, 2], [5, 11, 9], [0, 2, 0]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), LCS(r_mat_z(0.5), Q_([3, 7, 1], "mm")), r_mat_y([0.5, 0.5, 0.5]), [[3, 7, 1], [4, -2, 8], [-5, 3, -1]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 4 - right system orientation time dependent @@ -976,12 +996,12 @@ def test_addition( LCS( r_mat_z([0, 0.5, 1]), Q_([1, 4, 2], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.5, 0, 1.5]), [[2, 3, -1], [3, -2, -1], [-2, -3, -1]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 5 - right system coordinates time dependent @@ -989,12 +1009,12 @@ def test_addition( LCS( r_mat_z(0.5), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z(0), [[0, 0, 0], [9, 1, -7], [4, -8, 2]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 6 - right system fully time dependent @@ -1002,84 +1022,84 @@ def test_addition( LCS( r_mat_z([0, 0.5, 1]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.5, 0, 1.5]), [[0, 0, 0], [9, 1, -7], [-8, -4, 2]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 7 - both fully time dependent - same time and reference time LCS( r_mat_z([1, 0.5, 1]), Q_([[7, 9, 6], [7, 1, 10], [-6, -4, -10]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), LCS( r_mat_z([0, 0.5, 1]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([1, 0, 0]), [[4, 2, 5], [3, -3, 2], [1, 7, -9]], - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), ( # 8 - both fully time dependent - different time but same reference time LCS( r_mat_z([1.5, 1.0, 0.75]), Q_([[4, 2, 5], [3, -3, 2], [1, 7, -9]], "mm"), - TDI([2, 4, 6], "D"), + pd.to_timedelta([2, 4, 6], "D"), TS("2020-02-02"), ), LCS( r_mat_z([1, 1.5, 1]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.25, 1.75, 1.75]), [[-3.7426406, 2.9142135, 0.5], [-3.5, 3.742640, -1.5], [-6, -4, -8.0]], - TDI([2, 4, 6], "D"), + pd.to_timedelta([2, 4, 6], "D"), TS("2020-02-02"), ), ( # 9 - both fully time dependent - different time and reference time #1 LCS( r_mat_z([1.5, 1.0, 0.75]), Q_([[4, 2, 5], [3, -3, 2], [1, 7, -9]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-03"), ), LCS( r_mat_z([1, 1.5, 1]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.25, 1.75, 1.75]), [[-3.7426406, 2.9142135, 0.5], [-3.5, 3.742640, -1.5], [-6, -4, -8.0]], - TDI([2, 4, 6], "D"), + pd.to_timedelta([2, 4, 6], "D"), TS("2020-02-02"), ), ( # 10 - both fully time dependent - different time and reference time #2 LCS( r_mat_z([1.5, 1.0, 0.75]), Q_([[4, 2, 5], [3, -3, 2], [1, 7, -9]], "mm"), - TDI([3, 5, 7], "D"), + pd.to_timedelta([3, 5, 7], "D"), TS("2020-02-01"), ), LCS( r_mat_z([1, 1.5, 1]), Q_([[3, 7, 1], [4, -2, 8], [-5, 3, -1]], "mm"), - TDI([1, 3, 5], "D"), + pd.to_timedelta([1, 3, 5], "D"), TS("2020-02-02"), ), r_mat_z([0.25, 1.75, 1.75]), [[-3.7426406, 2.9142135, 0.5], [-3.5, 3.742640, -1.5], [-6, -4, -8.0]], - TDI([3, 5, 7], "D"), + pd.to_timedelta([3, 5, 7], "D"), TS("2020-02-01"), ), ],