diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 54db0a534..74471bc30 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all tags and branches @@ -74,10 +74,10 @@ jobs: name: pypi build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all tags and branches - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 with: python-version: '3.8' diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 57af54e8b..a02c76e6b 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -15,6 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Grep for PR number in CHANGELOG.rst run: grep -P ':pull:`${{github.event.number}}`' CHANGELOG.rst diff --git a/.github/workflows/citation.yml b/.github/workflows/citation.yml index 710ceb914..12fdc553c 100644 --- a/.github/workflows/citation.yml +++ b/.github/workflows/citation.yml @@ -11,8 +11,8 @@ jobs: name: Validate CITATION.cff runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 - uses: actions/cache@v2 with: path: ~/.cache/pip diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 72753d79a..57afe067a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,7 +29,7 @@ jobs: nbsphinx_execute: 'always' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Cache conda uses: actions/cache@v2 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6a0b54cf6..d13d4e4de 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -27,10 +27,10 @@ jobs: os: [ubuntu-latest] py: ['3.8', '3.9', '3.10'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all tags and branches - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 with: python-version: ${{ matrix.py }} @@ -88,10 +88,10 @@ jobs: os: [macos-latest, windows-latest] py: ['3.8'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all tags and branches - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 with: python-version: ${{ matrix.py }} diff --git a/.github/workflows/pytest_asdf.yml b/.github/workflows/pytest_asdf.yml index 00bc0b95f..ec1b4333b 100644 --- a/.github/workflows/pytest_asdf.yml +++ b/.github/workflows/pytest_asdf.yml @@ -11,10 +11,10 @@ jobs: name: pytest asdf runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for all tags and branches - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v3 with: python-version: '3.10' - name: pip installs @@ -28,8 +28,8 @@ jobs: name: validate weldx manifest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 with: python-version: '3.10' - name: pip installs diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index c691954eb..1dd7a2660 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -10,8 +10,8 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 with: python-version: 3.x - name: Lint @@ -25,8 +25,8 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 with: python-version: '3.9' - name: pip installs diff --git a/doc/conf.py b/doc/conf.py index 65d0d10d6..6cd5f99d1 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -38,6 +38,7 @@ def _workaround_imports_typechecking(): import meshio # noqa import pandas # noqa import pint # noqa + import sympy # noqa import xarray # noqa diff --git a/weldx/geometry.py b/weldx/geometry.py index 4126893fc..4d8f6fd93 100644 --- a/weldx/geometry.py +++ b/weldx/geometry.py @@ -1443,13 +1443,15 @@ def _get_component(v, i): me = self._series.data subs = [(k, _get_component(v.data, i)) for k, v in me.parameters.items()] - return me.expression.subs(subs).diff(self._series.position_dim_name) ** 2 + + sym = sympy.sympify(self._series.position_dim_name) + return me.expression.subs(subs).diff(sym) ** 2 def _get_derivative_expression(self) -> MathematicalExpression: """Get the derivative of an expression as `MathematicalExpression`.""" - expr = MathematicalExpression( - self._series.data.expression.diff(self._series.position_dim_name) - ) + sym = sympy.sympify(self._series.position_dim_name) + der = self._series.data.expression.diff(sym) + expr = MathematicalExpression(der) # parameters might not be present anymore in the derived expression params = { @@ -1467,7 +1469,10 @@ def _get_tangent_vec_discrete(self, position: float) -> np.ndarray: idx_low = np.abs(pos_data - position).argmin() if pos_data[idx_low] > position or idx_low + 1 == len(pos_data): idx_low -= 1 - vals = self._series.evaluate(s=[pos_data[idx_low], pos_data[idx_low + 1]]).data + + pdn = self._series.position_dim_name + coords = {pdn: [pos_data[idx_low], pos_data[idx_low + 1]]} + vals = self._series.evaluate(**coords).data return (vals[1] - vals[0]).m def _get_length_expr(self) -> MathematicalExpression: @@ -1524,7 +1529,7 @@ def _get_lcs_from_coords_and_tangent( pdn = self._series.position_dim_name if coords.coords[pdn].size == 1: - coords = coords.isel(s=0) + coords = coords.isel(**{pdn: 0}) x = tangent z = [0, 0, 1] if x.size == 3 else [[0, 0, 1] for _ in range(x.shape[0])] @@ -1658,7 +1663,8 @@ def __init__( else: self._sign_winding = -1 - expr = "(x*sin(s)+w*y*(cos(s)-1))*r " + pdn = SpatialSeries._position_dim_name + expr = f"(x*sin({pdn})+w*y*(cos({pdn})-1))*r " params = dict( x=Q_([1, 0, 0], "mm"), y=Q_([0, 1, 0], "mm"),