diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 93c7a47a6..5d5964982 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -48,9 +48,8 @@ fixes - fix broken `Time.all_close` to now work as intended `[#603] `__ - -- fix `weldx.asdf.util.get_yaml_header` to work correctly with windows line endings. - `[#609] `__ +- fix `weldx.asdf.util.get_yaml_header` to work correctly with windows + line endings. `[#609] `__ documentation ============= @@ -65,6 +64,9 @@ ASDF deprecations ============ +- removed ``welding.util.lcs_coords_from_ts`` `[#620] + `__ + dependencies ============ @@ -878,7 +880,7 @@ added object represents a unity transformation step. `[#177] `__ -- added `welding.util.lcs_coords_from_ts` function `[#199] +- added ``welding.util.lcs_coords_from_ts`` function `[#199] `__ - add a tutorial with advanced use case for combining groove diff --git a/RELEASE.md b/RELEASE.md index 389a14b08..20bc1dfbd 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -10,6 +10,7 @@ A short primer in the steps needed to release a new version of the `weldx` packa - [ ] make sure `CHANGELOG.md` is up to date and enter current date to the release version - [ ] add summarized release highlights where appropriate - [ ] update the `CITATION.cff` version number and date + - [ ] search the project for `deprecated` and remove deprecated code - [ ] wait for review and the CI jobs to finish - [ ] check the readthedocs PR build diff --git a/tutorials/experiment_design_01.ipynb b/tutorials/experiment_design_01.ipynb index 0f0b7feda..274208498 100644 --- a/tutorials/experiment_design_01.ipynb +++ b/tutorials/experiment_design_01.ipynb @@ -72,7 +72,7 @@ "from weldx import Q_\n", "from weldx import LocalCoordinateSystem as LCS\n", "from weldx import get_groove\n", - "from weldx.welding.util import lcs_coords_from_ts, sine" + "from weldx.welding.util import sine" ] }, { @@ -235,11 +235,10 @@ "outputs": [], "source": [ "sine_y = sine(f=Q_(1, \"Hz\"), amp=Q_([[0, 1, 0]], \"mm\"))\n", - "coords = lcs_coords_from_ts(sine_y, time)\n", "csm.add_cs(\n", " coordinate_system_name=\"tcp_sine_y\",\n", " reference_system_name=\"tcp_wire\",\n", - " lcs=LCS(coordinates=coords),\n", + " lcs=LCS(coordinates=sine_y),\n", ")" ] }, @@ -257,11 +256,10 @@ "outputs": [], "source": [ "sine_z = sine(f=Q_(1, \"Hz\"), amp=Q_([[0, 0, 2]], \"mm\"), bias=Q_([0, 0, 0], \"mm\"))\n", - "coords = lcs_coords_from_ts(sine_z, time)\n", "csm.add_cs(\n", " coordinate_system_name=\"tcp_sine_z\",\n", " reference_system_name=\"tcp_wire\",\n", - " lcs=LCS(coordinates=coords),\n", + " lcs=LCS(coordinates=sine_z),\n", ")" ] }, diff --git a/tutorials/welding_example_02_weaving.ipynb b/tutorials/welding_example_02_weaving.ipynb index 53e4642d4..d7b0b4626 100644 --- a/tutorials/welding_example_02_weaving.ipynb +++ b/tutorials/welding_example_02_weaving.ipynb @@ -49,7 +49,7 @@ " util,\n", " welding,\n", ")\n", - "from weldx.welding.util import lcs_coords_from_ts, sine" + "from weldx.welding.util import sine" ] }, { @@ -495,7 +495,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Use the `lcs_coords_from_ts` function to create the translation coordinate vectors at our specified timestamps." + "We define a new `LocalCoordinateSystem` and interpolate it our specified timestamps." ] }, { @@ -505,8 +505,7 @@ "outputs": [], "source": [ "t = pd.timedelta_range(start=\"0s\", end=\"8s\", freq=\"25ms\")\n", - "ts_sine_data = lcs_coords_from_ts(ts_sine, t)\n", - "tcp_sine2 = LocalCoordinateSystem(coordinates=ts_sine_data)" + "tcp_sine2 = LocalCoordinateSystem(coordinates=ts_sine).interp_time(t)" ] }, { diff --git a/weldx/asdf/util.py b/weldx/asdf/util.py index 47cdb92eb..885319576 100644 --- a/weldx/asdf/util.py +++ b/weldx/asdf/util.py @@ -23,7 +23,6 @@ types_path_and_file_like, types_path_like, ) -from weldx.util import deprecated _USE_WELDX_FILE = False _INVOKE_SHOW_HEADER = False @@ -259,21 +258,6 @@ def readline_replace_eol(): return code.decode("utf-8") -@deprecated("0.4.0", "0.5.0", " _write_buffer was renamed to write_buffer") -def _write_buffer(*args, **kwargs): - return write_buffer(*args, **kwargs) - - -@deprecated("0.4.0", "0.5.0", " _read_buffer was renamed to read_buffer") -def _read_buffer(*args, **kwargs): - return read_buffer(*args, **kwargs) - - -@deprecated("0.4.0", "0.5.0", " _write_read_buffer was renamed to write_read_buffer") -def _write_read_buffer(*args, **kwargs): - return write_read_buffer(*args, **kwargs) - - def notebook_fileprinter(file: types_path_and_file_like, lexer="YAML"): """Print the code from file/BytesIO to notebook cell with syntax highlighting. @@ -358,12 +342,6 @@ def view_tree(file: types_path_and_file_like, path: Tuple = None, **kwargs): return JSON(yaml_dict, **kwargs) -@deprecated("0.4.0", "0.5.0", " asdf_json_repr was renamed to view_tree") -def asdf_json_repr(file: Union[str, Path, BytesIO], path: Tuple = None, **kwargs): - """See `view_tree` function.""" - return view_tree(file, path, **kwargs) - - def _fullname(obj): """Get the fully qualified class name of an object.""" if isinstance(obj, str): diff --git a/weldx/visualization/k3d_impl.py b/weldx/visualization/k3d_impl.py index f61913aed..798a616b2 100644 --- a/weldx/visualization/k3d_impl.py +++ b/weldx/visualization/k3d_impl.py @@ -166,7 +166,7 @@ def __init__( self._trace = k3d.line( np.array(lcs.coordinates.values, dtype="float32"), # type: ignore - shader="line", + shader="thick", width=0.1, # change with .set_trait("width", value) color=color, name=name if name is None else f"{name} (line)", diff --git a/weldx/welding/util.py b/weldx/welding/util.py index 0dabbf0c4..23ee7808a 100644 --- a/weldx/welding/util.py +++ b/weldx/welding/util.py @@ -2,13 +2,10 @@ from typing import Union import numpy as np -import pandas as pd import pint -import xarray as xr from weldx.constants import Q_, WELDX_UNIT_REGISTRY from weldx.core import MathematicalExpression, TimeSeries -from weldx.util import deprecated from weldx.welding.groove.iso_9692_1 import IsoBaseGroove __all__ = ["compute_welding_speed"] @@ -49,39 +46,6 @@ def sine( return TimeSeries(expr) -@deprecated( - "0.4.1", - "0.5.0", - "The 'LocalCoordinateSystem' now supports 'TimeSeries' as coordinates rendering " - "this function obsolete.", -) -def lcs_coords_from_ts( - ts: TimeSeries, time: Union[pd.DatetimeIndex, pint.Quantity] -) -> xr.DataArray: - """Create translation coordinates from a TimeSeries at specific timesteps. - - Parameters - ---------- - ts: - TimeSeries that describes the coordinate motion as a 3D vector. - time - Timestamps used for interpolation. - TODO: add support for pd.DateTimeindex as well - - Returns - ------- - xarray.DataArray : - A DataArray with correctly labeled dimensions to be used for LCS creation. - - """ - ts_data = ts.interp_time(time=time).data_array - # assign vector coordinates and convert to mm - ts_data = ts_data.rename({"dim_1": "c"}).assign_coords({"c": ["x", "y", "z"]}) - ts_data.data = ts_data.data.to("mm").magnitude - ts_data["time"] = pd.TimedeltaIndex(ts_data["time"].data) - return ts_data - - @WELDX_UNIT_REGISTRY.check(None, "[length]/[time]", "[length]") def compute_welding_speed( groove: IsoBaseGroove,