From e9f0b4359826d5b4830f8c28b72263b315e28982 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 08:14:52 +0100 Subject: [PATCH 01/15] [pre-commit.ci] pre-commit autoupdate (#898) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/asottile/pyupgrade: v3.14.0 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.14.0...v3.15.0) - [github.com/psf/black: 23.9.1 → 23.11.0](https://github.com/psf/black/compare/23.9.1...23.11.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.6) - [github.com/abravalheri/validate-pyproject: v0.14 → v0.15](https://github.com/abravalheri/validate-pyproject/compare/v0.14...v0.15) - [github.com/nbQA-dev/nbQA: 1.7.0 → 1.7.1](https://github.com/nbQA-dev/nbQA/compare/1.7.0...1.7.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b8035fd1..460ccec8d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ exclude: '.*.weldx$|.*.wx$|.*.asdf$' repos: # ----- general formatting ----- - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -29,28 +29,28 @@ repos: - mdformat-config # ----- Python formatting ----- - repo: https://github.com/asottile/pyupgrade - rev: v3.14.0 + rev: v3.15.0 hooks: - id: pyupgrade args: [--py39-plus] - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.6 hooks: - id: ruff args: - --quiet - --fix - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.14 + rev: v0.15 hooks: - id: validate-pyproject # ----- Jupyter Notebooks ----- - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.0 + rev: 1.7.1 hooks: - id: nbqa-black - id: nbqa-ruff # ruff handles isort From f65d39868c9601ef2c6d2208219976ca9102a079 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:38:26 +0100 Subject: [PATCH 02/15] Bump actions/setup-python from 4 to 5 (#899) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build_pkg.yml | 2 +- .github/workflows/citation.yml | 2 +- .github/workflows/pytest_asdf.yml | 2 +- .github/workflows/static_analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 655d8b3fd..12452df5a 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -77,7 +77,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all history for all tags and branches - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/.github/workflows/citation.yml b/.github/workflows/citation.yml index 1cc572420..b2ebdfd56 100644 --- a/.github/workflows/citation.yml +++ b/.github/workflows/citation.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - uses: actions/cache@v3 diff --git a/.github/workflows/pytest_asdf.yml b/.github/workflows/pytest_asdf.yml index 78f01978c..5b0c62bfc 100644 --- a/.github/workflows/pytest_asdf.yml +++ b/.github/workflows/pytest_asdf.yml @@ -71,7 +71,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - uses: actions/cache@v3 diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index eadaa91c6..507ce0254 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.x - name: Lint From f2d55bb837de0549355c2dfead0f423c7e1c992b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Dec 2023 10:32:05 +0100 Subject: [PATCH 03/15] Bump actions/upload-artifact from 3 to 4 (#901) --- .github/workflows/build_pkg.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/pytest.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 12452df5a..7038b00ec 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -99,7 +99,7 @@ jobs: run: | python -m build - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: dist path: ./dist/ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 103b7b4ca..ebc6c39e0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -75,7 +75,7 @@ jobs: - name: Build docs run: sphinx-build -W -n -b html -d build/doctrees doc/src build/html --keep-going -j 2 -D nb_execution_mode=${{ env.nb_execution_mode }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: | always() && ( startsWith(github.ref, 'refs/tags/') || diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c407f419a..24e092251 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Event File path: ${{ github.event_path }} @@ -88,7 +88,7 @@ jobs: - name: Upload Test Results if: always() && (matrix.py == '3.10') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Unit Test Results path: pytest.xml From bb213a77ee79e8c982adfec0d56b9d5a3efee7b1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 08:10:23 +0100 Subject: [PATCH 04/15] [pre-commit.ci] pre-commit autoupdate (#902) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.11.0 → 23.12.1](https://github.com/psf/black/compare/23.11.0...23.12.1) - [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.1.9) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 460ccec8d..d42f1d30d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,11 +34,11 @@ repos: - id: pyupgrade args: [--py39-plus] - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.1.9 hooks: - id: ruff args: From 66a9ce4215c2fafeab0906286b4b8036dba880a7 Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Fri, 5 Jan 2024 06:00:35 -0500 Subject: [PATCH 05/15] fix WeldxFile doctest for asdf 3.0 (#904) --- weldx/asdf/file.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/weldx/asdf/file.py b/weldx/asdf/file.py index 93e1b1efc..e0317c06c 100644 --- a/weldx/asdf/file.py +++ b/weldx/asdf/file.py @@ -193,13 +193,10 @@ class WeldxFile(_ProtectedViewDict): %YAML 1.1 %TAG ! tag:stsci.edu:asdf/ --- !core/asdf-1.1.0 - asdf_library: !core/software-1.0.0 {... - name: asdf, version: ...} + asdf_library: !core/software-1.0.0 ... history: extensions: - - !core/extension_metadata-1.0.0 - extension_class: asdf.extension.BuiltinExtension - software: !core/software-1.0.0 {name: asdf, version: ...} + ... name: CXCOMP value: 42 From ad4b8dc8d976c1306cbdfd409c84e73f288c5686 Mon Sep 17 00:00:00 2001 From: Brett Graham Date: Fri, 5 Jan 2024 10:42:56 -0500 Subject: [PATCH 06/15] fix test that relied on slow garbage collection (#903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Çağtay Fabry --- weldx/tests/asdf_tests/test_weldx_file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weldx/tests/asdf_tests/test_weldx_file.py b/weldx/tests/asdf_tests/test_weldx_file.py index b6bc588c5..863159abf 100644 --- a/weldx/tests/asdf_tests/test_weldx_file.py +++ b/weldx/tests/asdf_tests/test_weldx_file.py @@ -449,7 +449,8 @@ def get_mem_info(): # pytest increases memory a bit, but not as much as our large array would # occupy in memory. assert diff <= large_array.nbytes * 1.1, diff / 1024**2 - assert np.all(WeldxFile(fn)["x"] == large_array) + with WeldxFile(fn) as wf: + assert np.all(wf["x"] == large_array) @staticmethod @pytest.mark.parametrize("mode", ("r", "rw")) From c38c19fa6edecd5b8f9854eeaa00fd6ad96d28f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 12:11:27 +0100 Subject: [PATCH 07/15] Bump mamba-org/setup-micromamba from 1.4.4 to 1.5.0 (#897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump mamba-org/setup-micromamba from 1.4.4 to 1.5.0 Bumps [mamba-org/setup-micromamba](https://github.com/mamba-org/setup-micromamba) from 1.4.4 to 1.5.0. - [Release notes](https://github.com/mamba-org/setup-micromamba/releases) - [Commits](https://github.com/mamba-org/setup-micromamba/compare/v1.4.4...v1.5.0) --- updated-dependencies: - dependency-name: mamba-org/setup-micromamba dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * use --nbval-current-env * update dependencies * Update pytest.yml * Update pytest.yml * unpin asdf --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Çağtay Fabry --- .github/workflows/build_pkg.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/pytest.yml | 4 ++-- .github/workflows/pytest_asdf.yml | 2 +- .github/workflows/static_analysis.yml | 2 +- pyproject.toml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 7038b00ec..029d62910 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -41,7 +41,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.4.4 + uses: mamba-org/setup-micromamba@v1.5.0 with: environment-file: ./devtools/conda.recipe/build_env.yml environment-name: build_env diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ebc6c39e0..bfe6bd653 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -47,7 +47,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.4.4 + uses: mamba-org/setup-micromamba@v1.5.0 with: environment-file: ./doc/rtd_environment.yml environment-name: rtd diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 24e092251..baf331fa1 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -47,7 +47,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.4.4 + uses: mamba-org/setup-micromamba@v1.6.0 with: environment-file: ./environment.yml environment-name: weldx @@ -147,7 +147,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.4.4 + uses: mamba-org/setup-micromamba@v1.6.0 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/pytest_asdf.yml b/.github/workflows/pytest_asdf.yml index 5b0c62bfc..afe6f704a 100644 --- a/.github/workflows/pytest_asdf.yml +++ b/.github/workflows/pytest_asdf.yml @@ -33,7 +33,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.4.4 + uses: mamba-org/setup-micromamba@v1.5.0 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 507ce0254..9b1a2f586 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -49,7 +49,7 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('./environment.yml') }} - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.4.4 + uses: mamba-org/setup-micromamba@v1.5.0 with: environment-file: ./environment.yml environment-name: weldx diff --git a/pyproject.toml b/pyproject.toml index 38e0ddeb6..e65f52b13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ test = [ "pytest >=6", "pytest-cov", "pytest-xdist", - "nbval", + "nbval <0.10", ] vis = [ "weldx_widgets >=0.2", From b69feb3b5df6c0131d0652931e6f7f017e54199e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Jan 2024 14:24:31 +0100 Subject: [PATCH 08/15] Bump mamba-org/setup-micromamba from 1.5.0 to 1.7.3 (#905) Bumps [mamba-org/setup-micromamba](https://github.com/mamba-org/setup-micromamba) from 1.5.0 to 1.7.3. - [Release notes](https://github.com/mamba-org/setup-micromamba/releases) - [Commits](https://github.com/mamba-org/setup-micromamba/compare/v1.5.0...v1.7.3) --- updated-dependencies: - dependency-name: mamba-org/setup-micromamba dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build_pkg.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/pytest.yml | 4 ++-- .github/workflows/pytest_asdf.yml | 2 +- .github/workflows/static_analysis.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 029d62910..da4be6412 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -41,7 +41,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.5.0 + uses: mamba-org/setup-micromamba@v1.7.3 with: environment-file: ./devtools/conda.recipe/build_env.yml environment-name: build_env diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bfe6bd653..4d69f680b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -47,7 +47,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.5.0 + uses: mamba-org/setup-micromamba@v1.7.3 with: environment-file: ./doc/rtd_environment.yml environment-name: rtd diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index baf331fa1..8c945de3f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -47,7 +47,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.6.0 + uses: mamba-org/setup-micromamba@v1.7.3 with: environment-file: ./environment.yml environment-name: weldx @@ -147,7 +147,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.6.0 + uses: mamba-org/setup-micromamba@v1.7.3 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/pytest_asdf.yml b/.github/workflows/pytest_asdf.yml index afe6f704a..bd04835ad 100644 --- a/.github/workflows/pytest_asdf.yml +++ b/.github/workflows/pytest_asdf.yml @@ -33,7 +33,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.5.0 + uses: mamba-org/setup-micromamba@v1.7.3 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 9b1a2f586..136285249 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -49,7 +49,7 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('./environment.yml') }} - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.5.0 + uses: mamba-org/setup-micromamba@v1.7.3 with: environment-file: ./environment.yml environment-name: weldx From c1192f10a36fb02b78efbc387e1b344839913c79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 17:12:36 +0100 Subject: [PATCH 09/15] Bump actions/cache from 3 to 4 (#906) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build_pkg.yml | 2 +- .github/workflows/citation.yml | 2 +- .github/workflows/pytest_asdf.yml | 2 +- .github/workflows/static_analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index da4be6412..1db8356ba 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -82,7 +82,7 @@ jobs: python-version: '3.10' - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 env: # Increase this value to reset cache if ./setup.cfg has not changed CACHE_NUMBER: 0 diff --git a/.github/workflows/citation.yml b/.github/workflows/citation.yml index b2ebdfd56..9eaef91c8 100644 --- a/.github/workflows/citation.yml +++ b/.github/workflows/citation.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.10' - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: pip-cffconvert-0 diff --git a/.github/workflows/pytest_asdf.yml b/.github/workflows/pytest_asdf.yml index bd04835ad..6cb646232 100644 --- a/.github/workflows/pytest_asdf.yml +++ b/.github/workflows/pytest_asdf.yml @@ -74,7 +74,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.10' - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-0 diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 136285249..a8fb57975 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -42,7 +42,7 @@ jobs: setup_requires: 'include' - name: Cache mypy cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ./.mypy_cache From 6b7e546f61e3610ad9d3e0e8d43392c97c88f299 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:32:42 +0100 Subject: [PATCH 10/15] Bump mamba-org/setup-micromamba from 1.7.3 to 1.8.0 (#907) Bumps [mamba-org/setup-micromamba](https://github.com/mamba-org/setup-micromamba) from 1.7.3 to 1.8.0. - [Release notes](https://github.com/mamba-org/setup-micromamba/releases) - [Commits](https://github.com/mamba-org/setup-micromamba/compare/v1.7.3...v1.8.0) --- updated-dependencies: - dependency-name: mamba-org/setup-micromamba dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build_pkg.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/pytest.yml | 4 ++-- .github/workflows/pytest_asdf.yml | 2 +- .github/workflows/static_analysis.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 1db8356ba..5a3da2e81 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -41,7 +41,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.7.3 + uses: mamba-org/setup-micromamba@v1.8.0 with: environment-file: ./devtools/conda.recipe/build_env.yml environment-name: build_env diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4d69f680b..9926871f7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -47,7 +47,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.7.3 + uses: mamba-org/setup-micromamba@v1.8.0 with: environment-file: ./doc/rtd_environment.yml environment-name: rtd diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8c945de3f..dce316201 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -47,7 +47,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.7.3 + uses: mamba-org/setup-micromamba@v1.8.0 with: environment-file: ./environment.yml environment-name: weldx @@ -147,7 +147,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.7.3 + uses: mamba-org/setup-micromamba@v1.8.0 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/pytest_asdf.yml b/.github/workflows/pytest_asdf.yml index 6cb646232..b022a895e 100644 --- a/.github/workflows/pytest_asdf.yml +++ b/.github/workflows/pytest_asdf.yml @@ -33,7 +33,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.7.3 + uses: mamba-org/setup-micromamba@v1.8.0 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index a8fb57975..8da2bbf9d 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -49,7 +49,7 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('./environment.yml') }} - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.7.3 + uses: mamba-org/setup-micromamba@v1.8.0 with: environment-file: ./environment.yml environment-name: weldx From 1750f5d8ac4626da382d73335115ed030c299401 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:33:04 +0100 Subject: [PATCH 11/15] Bump codecov/codecov-action from 3.1.4 to 3.1.5 (#908) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 3.1.5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.1.4...v3.1.5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index dce316201..d6b5bd1d3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -120,7 +120,7 @@ jobs: - name: codecov.io if: matrix.py == '3.10' - uses: codecov/codecov-action@v3.1.4 + uses: codecov/codecov-action@v3.1.5 compat: name: pytest From 82b79b178768641268660ff773f5c1c084001f99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:06:33 +0100 Subject: [PATCH 12/15] Bump mamba-org/setup-micromamba from 1.8.0 to 1.8.1 (#914) Bumps [mamba-org/setup-micromamba](https://github.com/mamba-org/setup-micromamba) from 1.8.0 to 1.8.1. - [Release notes](https://github.com/mamba-org/setup-micromamba/releases) - [Commits](https://github.com/mamba-org/setup-micromamba/compare/v1.8.0...v1.8.1) --- updated-dependencies: - dependency-name: mamba-org/setup-micromamba dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build_pkg.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/pytest.yml | 4 ++-- .github/workflows/pytest_asdf.yml | 2 +- .github/workflows/static_analysis.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index 5a3da2e81..2b3730742 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -41,7 +41,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.8.0 + uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: ./devtools/conda.recipe/build_env.yml environment-name: build_env diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9926871f7..32caec587 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -47,7 +47,7 @@ jobs: fetch-depth: 0 # Fetch all history for all tags and branches - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.8.0 + uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: ./doc/rtd_environment.yml environment-name: rtd diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d6b5bd1d3..1e015e4a5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -47,7 +47,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.8.0 + uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: ./environment.yml environment-name: weldx @@ -147,7 +147,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.8.0 + uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/pytest_asdf.yml b/.github/workflows/pytest_asdf.yml index b022a895e..511558463 100644 --- a/.github/workflows/pytest_asdf.yml +++ b/.github/workflows/pytest_asdf.yml @@ -33,7 +33,7 @@ jobs: setup_requires: 'include' - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.8.0 + uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: ./environment.yml environment-name: weldx diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 8da2bbf9d..1d092f4a8 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -49,7 +49,7 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('./environment.yml') }} - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v1.8.0 + uses: mamba-org/setup-micromamba@v1.8.1 with: environment-file: ./environment.yml environment-name: weldx From ab583bea6d9b2d7a3d0525d71c57796022f0afda Mon Sep 17 00:00:00 2001 From: "Martin K. Scherer" Date: Tue, 12 Mar 2024 09:14:42 +0100 Subject: [PATCH 13/15] use pandas.to_timedelta function instead of invoking deprecated ctor arg (#918) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * use pandas.to_timedelta function instead of invoking deprecated ctor (unit argument will be gone) * handle all old units * pin pandas >=1.5 * Update weldx/tags/time/timedeltaindex.py Co-authored-by: Çağtay Fabry --- CHANGELOG.md | 12 +- pyproject.toml | 5 +- .../weldx.bam.de/weldx/time/time-0.1.0.yaml | 2 +- .../weldx/time/timedeltaindex-0.1.0.yaml | 2 +- weldx/tags/time/timedeltaindex.py | 10 + weldx/tests/asdf_tests/test_asdf_core.py | 4 +- weldx/tests/test_core.py | 24 ++- weldx/tests/test_time.py | 70 ++++--- weldx/tests/test_utility.py | 10 +- .../tests/transformations/test_cs_manager.py | 59 +++--- weldx/tests/transformations/test_local_cs.py | 174 ++++++++++-------- weldx/time.py | 4 +- 12 files changed, 218 insertions(+), 158 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df56ffb2c..8c219869a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,20 @@ # Release Notes +## 0.6.8 (unreleased) + +### Changes + +- use pandas.to_timedelta function to pass units to the TimeDeltaIndex object \[{pull}`918`\]. + +### Dependencies + +- unpin nbval testing dependency. + ## 0.6.7 (2023.08.24) ### Added -- added `weldx.exceptions` module with `WeldxException` \[{pull}`871`\] . +- added `weldx.exceptions` module with `WeldxException` \[{pull}`871`\]. ### Fixes diff --git a/pyproject.toml b/pyproject.toml index e65f52b13..d06cc4ff9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ requires-python = ">=3.9" dependencies = [ "numpy >=1.20", "asdf >=2.15.1", - "pandas >=1.0", + "pandas >=1.5", "xarray >=2022.9.0", "scipy >=1.6.2", "sympy >=1.6", @@ -64,7 +64,7 @@ test = [ "pytest >=6", "pytest-cov", "pytest-xdist", - "nbval <0.10", + "nbval", ] vis = [ "weldx_widgets >=0.2", @@ -125,6 +125,7 @@ filterwarnings = [ "ignore::DeprecationWarning:traittypes.*:", "ignore:Passing method to :FutureWarning:xarray.*:", "error::pint.UnitStrippedWarning", + #"error::FutureWarning", # todo: we want to enable this, as it notifies us about upcoming failures due to upstream changes. ] [tool.coverage.run] diff --git a/weldx/schemas/weldx.bam.de/weldx/time/time-0.1.0.yaml b/weldx/schemas/weldx.bam.de/weldx/time/time-0.1.0.yaml index ddb82852a..0274cb826 100644 --- a/weldx/schemas/weldx.bam.de/weldx/time/time-0.1.0.yaml +++ b/weldx/schemas/weldx.bam.de/weldx/time/time-0.1.0.yaml @@ -34,7 +34,7 @@ examples: values: ! start: ! '2021-01-01T00:00:00' end: ! '2021-01-01T00:00:02' - freq: S + freq: s min: ! '2021-01-01T00:00:00' max: ! '2021-01-01T00:00:02' reference_time: ! '2021-01-01T00:00:00' diff --git a/weldx/schemas/weldx.bam.de/weldx/time/timedeltaindex-0.1.0.yaml b/weldx/schemas/weldx.bam.de/weldx/time/timedeltaindex-0.1.0.yaml index cf83e4f85..e5a8c5587 100644 --- a/weldx/schemas/weldx.bam.de/weldx/time/timedeltaindex-0.1.0.yaml +++ b/weldx/schemas/weldx.bam.de/weldx/time/timedeltaindex-0.1.0.yaml @@ -13,7 +13,7 @@ examples: ! start: ! P0DT0H0M0S end: ! P0DT0H0M10S - freq: 2S + freq: 2s min: ! P0DT0H0M0S max: ! P0DT0H0M10S - diff --git a/weldx/tags/time/timedeltaindex.py b/weldx/tags/time/timedeltaindex.py index d6b72f574..b0aeac6eb 100644 --- a/weldx/tags/time/timedeltaindex.py +++ b/weldx/tags/time/timedeltaindex.py @@ -8,6 +8,14 @@ __all__ = ["TimedeltaIndexConverter"] +PANDAS_OLD_UNIT_SUFFIXES = dict(H="h", T="min", S="s", L="ms", U="us", N="ns") + + +def _handle_converted_pd_tdi_units(node: TaggedDict): + """Convert changed units in Pandas.Datetimeindex to valid values.""" + for suf in PANDAS_OLD_UNIT_SUFFIXES: + node["freq"] = node["freq"].replace(suf, PANDAS_OLD_UNIT_SUFFIXES[suf]) + class TimedeltaIndexConverter(WeldxConverter): """A simple implementation of serializing pandas TimedeltaIndex.""" @@ -33,6 +41,7 @@ def to_yaml_tree(self, obj: pd.TimedeltaIndex, tag: str, ctx) -> dict: def from_yaml_tree(self, node: dict, tag: str, ctx): """Construct TimedeltaIndex from tree.""" if "freq" in node: + _handle_converted_pd_tdi_units(node) return pd.timedelta_range( start=node["start"], end=node["end"], freq=node["freq"] ) @@ -43,6 +52,7 @@ def from_yaml_tree(self, node: dict, tag: str, ctx): def shape_from_tagged(node: TaggedDict) -> list[int]: """Calculate the shape from static tagged tree instance.""" if "freq" in node: + _handle_converted_pd_tdi_units(node) tdi_temp = pd.timedelta_range( start=str(node["start"]), # can't handle TaggedString directly end=str(node["end"]), diff --git a/weldx/tests/asdf_tests/test_asdf_core.py b/weldx/tests/asdf_tests/test_asdf_core.py index 67e92bdc9..dadc7c270 100644 --- a/weldx/tests/asdf_tests/test_asdf_core.py +++ b/weldx/tests/asdf_tests/test_asdf_core.py @@ -424,12 +424,12 @@ def test_coordinate_system_manager_time_dependencies( lcs_tdp_1_time_ref = pd.Timestamp("2000-03-17") lcs_tdp_1 = tf.LocalCoordinateSystem( coordinates=Q_([[1, 2, 3], [4, 5, 6]], "mm"), - time=pd.TimedeltaIndex([1, 2], "D"), + time=pd.to_timedelta([1, 2], "D"), time_ref=lcs_tdp_1_time_ref, ) lcs_tdp_2 = tf.LocalCoordinateSystem( coordinates=Q_([[3, 7, 3], [9, 5, 8]], "mm"), - time=pd.TimedeltaIndex([1, 2], "D"), + time=pd.to_timedelta([1, 2], "D"), time_ref=pd.Timestamp("2000-03-21"), ) diff --git a/weldx/tests/test_core.py b/weldx/tests/test_core.py index a8ac6cdd8..b70d111eb 100644 --- a/weldx/tests/test_core.py +++ b/weldx/tests/test_core.py @@ -227,10 +227,9 @@ class TestTimeSeries: ME = MathematicalExpression DTI = pd.DatetimeIndex - TDI = pd.TimedeltaIndex TS = TimeSeries - time_discrete = pd.TimedeltaIndex([0, 1, 2, 3, 4], unit="s") + time_discrete = pd.to_timedelta([0, 1, 2, 3, 4], "s") value_constant = Q_(1, "m") values_discrete = Q_(np.array([10, 11, 12, 14, 16]), "mm") me_expr_str = "a*t + b" @@ -251,7 +250,7 @@ class TestTimeSeries: "data, time, interpolation, shape_exp", [ (Q_(1, "m"), None, None, (1,)), - (Q_([3, 7, 1], "m"), TDI([0, 1, 2], unit="s"), "step", (3,)), + (Q_([3, 7, 1], "m"), pd.to_timedelta([0, 1, 2], unit="s"), "step", (3,)), (Q_([3, 7, 1], ""), Q_([0, 1, 2], "s"), "step", (3,)), (Q_([3, 7, 1], ""), DTI(["2010", "2011", "2012"]), "step", (3,)), ], @@ -329,12 +328,17 @@ def test_construction_expression(data, shape_exp, unit_exp): @pytest.mark.parametrize( "data, dims, coords, exception_type", [ - (Q_([1, 2, 3], "m"), "time", dict(time=TDI([1, 2, 3])), None), - (Q_([1, 2, 3], "m"), "a", dict(a=TDI([1, 2, 3])), KeyError), - (Q_([[1, 2]], "m"), ("a", "time"), dict(a=[2], time=TDI([1, 2])), None), + (Q_([1, 2, 3], "m"), "time", dict(time=pd.to_timedelta([1, 2, 3])), None), + (Q_([1, 2, 3], "m"), "a", dict(a=pd.to_timedelta([1, 2, 3])), KeyError), + ( + Q_([[1, 2]], "m"), + ("a", "time"), + dict(a=[2], time=pd.to_timedelta([1, 2])), + None, + ), (Q_([1, 2, 3], "m"), "time", None, KeyError), (Q_([1, 2, 3], "m"), "time", dict(time=[1, 2, 3]), TypeError), - ([1, 2, 3], "time", dict(time=TDI([1, 2, 3])), TypeError), + ([1, 2, 3], "time", dict(time=pd.to_timedelta([1, 2, 3])), TypeError), ], ) @pytest.mark.parametrize("reference_time", [None, "2000-01-01"]) @@ -382,7 +386,7 @@ def test_construction_exceptions( # test_comparison ------------------------------------- - time_wrong_values = TDI([0, 1, 2, 3, 5], unit="s") + time_wrong_values = pd.to_timedelta([0, 1, 2, 3, 5], "s") values_discrete_wrong = Q_(np.array([10, 11, 12, 15, 16]), "mm") values_unit_wrong = Q_(np.array([10, 11, 12, 14, 16]), "s") values_unit_prefix_wrong = Q_(np.array([10, 11, 12, 14, 16]), "m") @@ -426,9 +430,9 @@ def test_comparison(ts, ts_other, result_exp): # test_interp_time ----------------------------------------------------------------- - time_single = pd.TimedeltaIndex([2.1], "s") + time_single = pd.to_timedelta([2.1], "s") time_single_q = Q_(2.1, "s") - time_mul = pd.TimedeltaIndex([-3, 0.7, 1.1, 1.9, 2.5, 3, 4, 7], "s") + time_mul = pd.to_timedelta([-3, 0.7, 1.1, 1.9, 2.5, 3, 4, 7], "s") time_mul_q = Q_([-3, 0.7, 1.1, 1.9, 2.5, 3, 4, 7], "s") results_exp_vec = [ [-8, 3, -3], 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/test_utility.py b/weldx/tests/test_utility.py index 6658fd3a9..1caa7847a 100644 --- a/weldx/tests/test_utility.py +++ b/weldx/tests/test_utility.py @@ -333,7 +333,7 @@ def test_xr_fill_all(): "d1": np.array([-1, 1], dtype=float), "d2": np.array([-1, 1], dtype=int), "d3": pd.DatetimeIndex(["2020-05-01", "2020-05-03"]), - "d4": pd.TimedeltaIndex([0, 1, 2, 3], "s"), + "d4": pd.to_timedelta([0, 1, 2, 3], "s"), "d5": ["x", "y", "z"], }, ) @@ -352,7 +352,7 @@ def test_xr_fill_all(): "dtype": ["datetime64[ns]", "timedelta64[ns]"], }, d4={ - "values": pd.TimedeltaIndex([0, 1, 2, 3], "s"), + "values": pd.to_timedelta([0, 1, 2, 3], "s"), "dtype": ["datetime64[ns]", "timedelta64[ns]"], }, d5={"values": ["x", "y", "z"], "dtype": " Date: Tue, 12 Mar 2024 10:47:06 +0100 Subject: [PATCH 14/15] [pre-commit.ci] pre-commit autoupdate (#912) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.9...v0.2.0) - [github.com/abravalheri/validate-pyproject: v0.15 → v0.16](https://github.com/abravalheri/validate-pyproject/compare/v0.15...v0.16) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Çağtay Fabry --- .pre-commit-config.yaml | 6 +++--- conftest.py | 1 + devtools/scripts/clean_notebooks.py | 1 + devtools/scripts/update_manifest.py | 1 + doc/src/tutorials/util.py | 1 + weldx/__init__.py | 1 + weldx/asdf/__init__.py | 1 + weldx/asdf/cli/welding_schema.py | 1 + weldx/asdf/extension.py | 1 + weldx/asdf/file.py | 4 ++-- weldx/asdf/util.py | 1 + weldx/asdf/validators.py | 1 + weldx/config.py | 1 + weldx/constants.py | 1 + weldx/core/__init__.py | 1 + weldx/core/generic_series.py | 1 + weldx/core/math_expression.py | 1 + weldx/core/spatial_series.py | 1 + weldx/core/time_series.py | 1 + weldx/geometry.py | 1 + weldx/tags/base_types.py | 1 + weldx/tags/core/data_array.py | 1 + weldx/tags/core/file.py | 1 + weldx/tags/core/media_file.py | 1 + weldx/tags/core/time_series.py | 1 + weldx/tests/asdf_tests/test_asdf_aws_schema.py | 1 + weldx/tests/asdf_tests/test_asdf_base_types.py | 1 + weldx/tests/asdf_tests/test_asdf_core.py | 1 + weldx/tests/asdf_tests/test_asdf_graph.py | 1 + weldx/tests/asdf_tests/test_asdf_groove.py | 1 + weldx/tests/asdf_tests/test_asdf_time.py | 1 + weldx/tests/asdf_tests/test_asdf_util.py | 1 + weldx/tests/asdf_tests/test_asdf_validators.py | 1 + weldx/tests/asdf_tests/test_media_file.py | 1 + weldx/tests/asdf_tests/test_weldx_file.py | 1 + weldx/tests/conftest.py | 1 + weldx/tests/test_config.py | 1 + weldx/tests/test_core.py | 1 + weldx/tests/test_geometry.py | 1 + weldx/tests/test_measurement.py | 1 + weldx/tests/test_time.py | 1 + weldx/tests/test_utility.py | 1 + weldx/tests/test_visualization.py | 1 + weldx/tests/test_welding_util.py | 1 + weldx/tests/transformations/test_cs_manager.py | 1 + weldx/tests/transformations/test_local_cs.py | 1 + weldx/time.py | 1 + weldx/transformations/__init__.py | 1 + weldx/transformations/cs_manager.py | 1 + weldx/transformations/rotation.py | 1 + weldx/transformations/types.py | 1 + weldx/types.py | 1 + weldx/util/external_file.py | 1 + weldx/util/media_file.py | 1 + weldx/util/util.py | 1 + weldx/util/xarray.py | 8 +++++--- weldx/visualization/__init__.py | 14 ++++---------- weldx/welding/processes.py | 1 + weldx/welding/util.py | 1 + 59 files changed, 69 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d42f1d30d..e283621ea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,18 +34,18 @@ repos: - id: pyupgrade args: [--py39-plus] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.2.0 hooks: - id: ruff args: - --quiet - --fix - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.15 + rev: v0.16 hooks: - id: validate-pyproject # ----- Jupyter Notebooks ----- diff --git a/conftest.py b/conftest.py index 2442ac0e4..944736707 100644 --- a/conftest.py +++ b/conftest.py @@ -1,4 +1,5 @@ """PyTest configuration.""" + import pytest collect_ignore_glob = [ diff --git a/devtools/scripts/clean_notebooks.py b/devtools/scripts/clean_notebooks.py index 2e6bcb02f..445f150d4 100644 --- a/devtools/scripts/clean_notebooks.py +++ b/devtools/scripts/clean_notebooks.py @@ -1,4 +1,5 @@ """Clean up jupyter notebooks in main directory.""" + from __future__ import annotations import json diff --git a/devtools/scripts/update_manifest.py b/devtools/scripts/update_manifest.py index 228d39b07..a38ca4cf9 100644 --- a/devtools/scripts/update_manifest.py +++ b/devtools/scripts/update_manifest.py @@ -1,4 +1,5 @@ """Update the manifest file with schema files found in this directory.""" + from pathlib import Path import yaml diff --git a/doc/src/tutorials/util.py b/doc/src/tutorials/util.py index fc5a9eb68..b8f66afcb 100644 --- a/doc/src/tutorials/util.py +++ b/doc/src/tutorials/util.py @@ -1,4 +1,5 @@ """Common util functions used in weldx tutorials.""" + from pathlib import Path tutorials_dir = Path(__file__).parent.absolute() diff --git a/weldx/__init__.py b/weldx/__init__.py index 14ea4fe47..06e153059 100644 --- a/weldx/__init__.py +++ b/weldx/__init__.py @@ -116,6 +116,7 @@ asdf.validators """ + # isort:skip_file import warnings diff --git a/weldx/asdf/__init__.py b/weldx/asdf/__init__.py index 456ea2002..21b873141 100644 --- a/weldx/asdf/__init__.py +++ b/weldx/asdf/__init__.py @@ -1,4 +1,5 @@ """This submodule contains ASDF related weldx extensions and schemas.""" + # isort:skip_file from weldx import tags # implement tags before the asdf extensions here just to be safe diff --git a/weldx/asdf/cli/welding_schema.py b/weldx/asdf/cli/welding_schema.py index 7e1ad814e..2409a8131 100644 --- a/weldx/asdf/cli/welding_schema.py +++ b/weldx/asdf/cli/welding_schema.py @@ -1,4 +1,5 @@ """single_pass_weld schema.""" + from __future__ import annotations import sys diff --git a/weldx/asdf/extension.py b/weldx/asdf/extension.py index d84cdda21..935fbcb12 100644 --- a/weldx/asdf/extension.py +++ b/weldx/asdf/extension.py @@ -1,4 +1,5 @@ """ASDF-extensions for weldx types.""" + from __future__ import annotations from asdf.extension import ManifestExtension diff --git a/weldx/asdf/file.py b/weldx/asdf/file.py index e0317c06c..d5cf4fd03 100644 --- a/weldx/asdf/file.py +++ b/weldx/asdf/file.py @@ -1,4 +1,5 @@ """`WeldxFile` wraps creation and updating of ASDF files and underlying files.""" + from __future__ import annotations import copy @@ -211,8 +212,7 @@ def __init__( write_kwargs: Mapping = None, tree: Mapping = None, sync: bool = True, - custom_schema: None - | ( + custom_schema: None | ( types_path_like, tuple[None, types_path_like], ) = None, diff --git a/weldx/asdf/util.py b/weldx/asdf/util.py index c7de94c57..a608b5de1 100644 --- a/weldx/asdf/util.py +++ b/weldx/asdf/util.py @@ -1,4 +1,5 @@ """Utilities for asdf files.""" + from __future__ import annotations from collections.abc import Callable, Hashable, Mapping, MutableMapping, Set diff --git a/weldx/asdf/validators.py b/weldx/asdf/validators.py index 18d63cf77..9d8f68773 100644 --- a/weldx/asdf/validators.py +++ b/weldx/asdf/validators.py @@ -1,4 +1,5 @@ """ASDF-validators for weldx types.""" + from __future__ import annotations import re diff --git a/weldx/config.py b/weldx/config.py index 400f0d6af..9033225a5 100644 --- a/weldx/config.py +++ b/weldx/config.py @@ -1,4 +1,5 @@ """Classes and functions to configure the WelDX package.""" + from __future__ import annotations from pathlib import Path diff --git a/weldx/constants.py b/weldx/constants.py index 7f15c2821..1fe816d2c 100644 --- a/weldx/constants.py +++ b/weldx/constants.py @@ -1,4 +1,5 @@ """Define constants for global library use.""" + from pathlib import Path as _Path import pint diff --git a/weldx/core/__init__.py b/weldx/core/__init__.py index 94922e80f..d306343d5 100644 --- a/weldx/core/__init__.py +++ b/weldx/core/__init__.py @@ -1,4 +1,5 @@ """Collection of common classes and functions.""" + # isort:skip_file from weldx.core.math_expression import MathematicalExpression from weldx.core.generic_series import GenericSeries diff --git a/weldx/core/generic_series.py b/weldx/core/generic_series.py index 83849c00d..9c8eeb2a9 100644 --- a/weldx/core/generic_series.py +++ b/weldx/core/generic_series.py @@ -1,4 +1,5 @@ """Contains GenericSeries class.""" + from __future__ import annotations from collections.abc import Callable, Mapping diff --git a/weldx/core/math_expression.py b/weldx/core/math_expression.py index 9c3e19458..8edf3363d 100644 --- a/weldx/core/math_expression.py +++ b/weldx/core/math_expression.py @@ -1,4 +1,5 @@ """Contains the MathematicalExpression class.""" + from __future__ import annotations from typing import Any, Union diff --git a/weldx/core/spatial_series.py b/weldx/core/spatial_series.py index a3660b693..7981bed3d 100644 --- a/weldx/core/spatial_series.py +++ b/weldx/core/spatial_series.py @@ -1,4 +1,5 @@ """Contains the SpatialSeries class.""" + from __future__ import annotations import pint diff --git a/weldx/core/time_series.py b/weldx/core/time_series.py index acfd434fb..64abdec3d 100644 --- a/weldx/core/time_series.py +++ b/weldx/core/time_series.py @@ -1,4 +1,5 @@ """Contains TimeSeries class.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any diff --git a/weldx/geometry.py b/weldx/geometry.py index b7f9818be..8c20085be 100644 --- a/weldx/geometry.py +++ b/weldx/geometry.py @@ -1,4 +1,5 @@ """Provides classes to define lines and surfaces.""" + from __future__ import annotations import copy diff --git a/weldx/tags/base_types.py b/weldx/tags/base_types.py index 3136157fb..6bb6bc582 100644 --- a/weldx/tags/base_types.py +++ b/weldx/tags/base_types.py @@ -1,4 +1,5 @@ """Module providing ASDF implementations for basic python types.""" + from uuid import UUID from asdf.asdf import SerializationContext diff --git a/weldx/tags/core/data_array.py b/weldx/tags/core/data_array.py index 2cd8d62e9..e4c25269f 100644 --- a/weldx/tags/core/data_array.py +++ b/weldx/tags/core/data_array.py @@ -1,4 +1,5 @@ """Serialization for xarray.DataArray.""" + from __future__ import annotations import pint diff --git a/weldx/tags/core/file.py b/weldx/tags/core/file.py index 49741e9de..c011242ae 100644 --- a/weldx/tags/core/file.py +++ b/weldx/tags/core/file.py @@ -1,4 +1,5 @@ """Contains classes for the asdf serialization of an external file.""" + from copy import deepcopy import numpy as np diff --git a/weldx/tags/core/media_file.py b/weldx/tags/core/media_file.py index 5f021aa27..3d54fad3d 100644 --- a/weldx/tags/core/media_file.py +++ b/weldx/tags/core/media_file.py @@ -1,4 +1,5 @@ """Contains classes for the asdf serialization of media files.""" + import pathlib from weldx.asdf.types import WeldxConverter diff --git a/weldx/tags/core/time_series.py b/weldx/tags/core/time_series.py index 95bc7c202..caf6009ff 100644 --- a/weldx/tags/core/time_series.py +++ b/weldx/tags/core/time_series.py @@ -1,4 +1,5 @@ """Contains the serialization class for the weldx.core.TimeSeries.""" + from __future__ import annotations import pint diff --git a/weldx/tests/asdf_tests/test_asdf_aws_schema.py b/weldx/tests/asdf_tests/test_asdf_aws_schema.py index 59eaf6092..554e8a8c7 100644 --- a/weldx/tests/asdf_tests/test_asdf_aws_schema.py +++ b/weldx/tests/asdf_tests/test_asdf_aws_schema.py @@ -1,4 +1,5 @@ """Test ASDF serialization of AWS schema definitions.""" + import pytest from weldx.asdf.util import write_read_buffer_context diff --git a/weldx/tests/asdf_tests/test_asdf_base_types.py b/weldx/tests/asdf_tests/test_asdf_base_types.py index f8cc57eba..adca95d44 100644 --- a/weldx/tests/asdf_tests/test_asdf_base_types.py +++ b/weldx/tests/asdf_tests/test_asdf_base_types.py @@ -1,4 +1,5 @@ """Tests asdf implementations of python base types.""" + import uuid import numpy as np diff --git a/weldx/tests/asdf_tests/test_asdf_core.py b/weldx/tests/asdf_tests/test_asdf_core.py index dadc7c270..bf02d11d3 100644 --- a/weldx/tests/asdf_tests/test_asdf_core.py +++ b/weldx/tests/asdf_tests/test_asdf_core.py @@ -1,4 +1,5 @@ """Tests asdf implementations of core module.""" + from pathlib import Path from tempfile import TemporaryDirectory diff --git a/weldx/tests/asdf_tests/test_asdf_graph.py b/weldx/tests/asdf_tests/test_asdf_graph.py index 30fcf9adf..d40637f1d 100644 --- a/weldx/tests/asdf_tests/test_asdf_graph.py +++ b/weldx/tests/asdf_tests/test_asdf_graph.py @@ -1,4 +1,5 @@ """Test graph serializations.""" + import unittest from uuid import uuid4 diff --git a/weldx/tests/asdf_tests/test_asdf_groove.py b/weldx/tests/asdf_tests/test_asdf_groove.py index e5e45008c..aad47afe3 100644 --- a/weldx/tests/asdf_tests/test_asdf_groove.py +++ b/weldx/tests/asdf_tests/test_asdf_groove.py @@ -1,4 +1,5 @@ """Test all ASDF groove implementations.""" + import pytest from decorator import contextmanager diff --git a/weldx/tests/asdf_tests/test_asdf_time.py b/weldx/tests/asdf_tests/test_asdf_time.py index fe85e64a0..b2171c89e 100644 --- a/weldx/tests/asdf_tests/test_asdf_time.py +++ b/weldx/tests/asdf_tests/test_asdf_time.py @@ -1,4 +1,5 @@ """Test time schema implementation.""" + import numpy as np import pandas as pd import pytest diff --git a/weldx/tests/asdf_tests/test_asdf_util.py b/weldx/tests/asdf_tests/test_asdf_util.py index 9ae9f2a50..ed7c62416 100644 --- a/weldx/tests/asdf_tests/test_asdf_util.py +++ b/weldx/tests/asdf_tests/test_asdf_util.py @@ -1,4 +1,5 @@ """tests for asdf utility functions.""" + from __future__ import annotations import io diff --git a/weldx/tests/asdf_tests/test_asdf_validators.py b/weldx/tests/asdf_tests/test_asdf_validators.py index e838860af..3f6b76f69 100644 --- a/weldx/tests/asdf_tests/test_asdf_validators.py +++ b/weldx/tests/asdf_tests/test_asdf_validators.py @@ -1,4 +1,5 @@ """Test custom weldx ASDF validator functions.""" + import numpy as np import pandas as pd import pytest diff --git a/weldx/tests/asdf_tests/test_media_file.py b/weldx/tests/asdf_tests/test_media_file.py index 34e290f43..3dc9358c5 100644 --- a/weldx/tests/asdf_tests/test_media_file.py +++ b/weldx/tests/asdf_tests/test_media_file.py @@ -1,4 +1,5 @@ """Tests for MediaFile.""" + import numpy as np import pytest import xarray as xr diff --git a/weldx/tests/asdf_tests/test_weldx_file.py b/weldx/tests/asdf_tests/test_weldx_file.py index 863159abf..2bfbd956f 100644 --- a/weldx/tests/asdf_tests/test_weldx_file.py +++ b/weldx/tests/asdf_tests/test_weldx_file.py @@ -1,4 +1,5 @@ """Tests for the WeldxFile class.""" + import itertools import os import pathlib diff --git a/weldx/tests/conftest.py b/weldx/tests/conftest.py index b4c5dce62..8f48f8bfc 100644 --- a/weldx/tests/conftest.py +++ b/weldx/tests/conftest.py @@ -1,4 +1,5 @@ """pytest configuration.""" + import pytest from weldx.asdf.cli.welding_schema import single_pass_weld_example diff --git a/weldx/tests/test_config.py b/weldx/tests/test_config.py index 02e9bf0fc..d8d8e0cd1 100644 --- a/weldx/tests/test_config.py +++ b/weldx/tests/test_config.py @@ -1,4 +1,5 @@ """Test the `config` module.""" + from pathlib import Path import asdf diff --git a/weldx/tests/test_core.py b/weldx/tests/test_core.py index b70d111eb..1e44a8ceb 100644 --- a/weldx/tests/test_core.py +++ b/weldx/tests/test_core.py @@ -1,4 +1,5 @@ """Tests of the core package.""" + import warnings import numpy as np diff --git a/weldx/tests/test_geometry.py b/weldx/tests/test_geometry.py index f1a41c8bd..c31535915 100644 --- a/weldx/tests/test_geometry.py +++ b/weldx/tests/test_geometry.py @@ -1,4 +1,5 @@ """Tests the geometry package.""" + from __future__ import annotations import copy diff --git a/weldx/tests/test_measurement.py b/weldx/tests/test_measurement.py index 19a14d5c4..93c1c2c0e 100644 --- a/weldx/tests/test_measurement.py +++ b/weldx/tests/test_measurement.py @@ -1,4 +1,5 @@ """Test the measurement package.""" + from __future__ import annotations import numpy as np diff --git a/weldx/tests/test_time.py b/weldx/tests/test_time.py index 2ca0028ee..fa6d2cbdd 100644 --- a/weldx/tests/test_time.py +++ b/weldx/tests/test_time.py @@ -1,4 +1,5 @@ """Test the `Time` class.""" + from __future__ import annotations import numpy as np diff --git a/weldx/tests/test_utility.py b/weldx/tests/test_utility.py index 1caa7847a..69d2f5305 100644 --- a/weldx/tests/test_utility.py +++ b/weldx/tests/test_utility.py @@ -1,4 +1,5 @@ """Test the internal utility functions.""" + from __future__ import annotations import copy diff --git a/weldx/tests/test_visualization.py b/weldx/tests/test_visualization.py index 4b4b500b1..cc13f9051 100644 --- a/weldx/tests/test_visualization.py +++ b/weldx/tests/test_visualization.py @@ -1,4 +1,5 @@ """Perform some checks regarding the import redirection if weldx_widgets is missing.""" + from unittest.mock import patch import pytest diff --git a/weldx/tests/test_welding_util.py b/weldx/tests/test_welding_util.py index a25afc178..d080ac097 100644 --- a/weldx/tests/test_welding_util.py +++ b/weldx/tests/test_welding_util.py @@ -1,4 +1,5 @@ """Test welding util functions.""" + import pint import pytest diff --git a/weldx/tests/transformations/test_cs_manager.py b/weldx/tests/transformations/test_cs_manager.py index d69979cab..90250e493 100644 --- a/weldx/tests/transformations/test_cs_manager.py +++ b/weldx/tests/transformations/test_cs_manager.py @@ -1,4 +1,5 @@ """Test the `CoordinateSystemManager` class.""" + from __future__ import annotations from copy import deepcopy diff --git a/weldx/tests/transformations/test_local_cs.py b/weldx/tests/transformations/test_local_cs.py index 7de20db85..3b539dfbc 100644 --- a/weldx/tests/transformations/test_local_cs.py +++ b/weldx/tests/transformations/test_local_cs.py @@ -1,4 +1,5 @@ """Test the `LocalCoordinateSystem` class.""" + from __future__ import annotations import warnings diff --git a/weldx/time.py b/weldx/time.py index 8aded0950..6fccccf0e 100644 --- a/weldx/time.py +++ b/weldx/time.py @@ -1,4 +1,5 @@ """Contains classes and functions related to time.""" + from __future__ import annotations from abc import ABC, abstractmethod diff --git a/weldx/transformations/__init__.py b/weldx/transformations/__init__.py index aa3e45c9d..7ac8f08c4 100644 --- a/weldx/transformations/__init__.py +++ b/weldx/transformations/__init__.py @@ -1,4 +1,5 @@ """Contains methods and classes for coordinate transformations.""" + from .cs_manager import CoordinateSystemManager from .local_cs import LocalCoordinateSystem from .rotation import WXRotation diff --git a/weldx/transformations/cs_manager.py b/weldx/transformations/cs_manager.py index 2d0219b3e..c118b5790 100644 --- a/weldx/transformations/cs_manager.py +++ b/weldx/transformations/cs_manager.py @@ -1,4 +1,5 @@ """Contains methods and classes for coordinate transformations.""" + from __future__ import annotations import itertools diff --git a/weldx/transformations/rotation.py b/weldx/transformations/rotation.py index 9b30a1d97..1b42719a7 100644 --- a/weldx/transformations/rotation.py +++ b/weldx/transformations/rotation.py @@ -1,4 +1,5 @@ """Contains tools to handle rotations.""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/weldx/transformations/types.py b/weldx/transformations/types.py index daaa702a0..2e724913d 100644 --- a/weldx/transformations/types.py +++ b/weldx/transformations/types.py @@ -1,4 +1,5 @@ """shared type definitions.""" + from typing import Union import numpy.typing as npt diff --git a/weldx/types.py b/weldx/types.py index ec994c09b..2069d2ce6 100644 --- a/weldx/types.py +++ b/weldx/types.py @@ -1,4 +1,5 @@ """Common type definitions.""" + import pathlib from io import IOBase from typing import Protocol, Union, runtime_checkable diff --git a/weldx/util/external_file.py b/weldx/util/external_file.py index 1e781101a..34a335e32 100644 --- a/weldx/util/external_file.py +++ b/weldx/util/external_file.py @@ -1,4 +1,5 @@ """External file utilities.""" + import mimetypes import socket from dataclasses import dataclass diff --git a/weldx/util/media_file.py b/weldx/util/media_file.py index cba0e0436..7c9d97a9e 100644 --- a/weldx/util/media_file.py +++ b/weldx/util/media_file.py @@ -1,4 +1,5 @@ """Media file.""" + from __future__ import annotations from pathlib import Path diff --git a/weldx/util/util.py b/weldx/util/util.py index 14a792d0e..677c2de1c 100644 --- a/weldx/util/util.py +++ b/weldx/util/util.py @@ -1,4 +1,5 @@ """Contains general (mostly internal) utility functions.""" + from __future__ import annotations import functools diff --git a/weldx/util/xarray.py b/weldx/util/xarray.py index e8f6ec436..996a7bbe0 100644 --- a/weldx/util/xarray.py +++ b/weldx/util/xarray.py @@ -243,9 +243,11 @@ def _coordinates_from_quantities( ) -> dict[str, tuple[str, np.ndarray, dict[str, pint.Unit]]]: """Create a dict with unit information that can be passed as coords for xarray.""" return { - k: (k, v.m, {UNITS_KEY: v.u}) # type: ignore[dict-item] - if isinstance(v, pint.Quantity) - else v + k: ( + (k, v.m, {UNITS_KEY: v.u}) # type: ignore[dict-item] + if isinstance(v, pint.Quantity) + else v + ) for k, v in q_dict.items() } diff --git a/weldx/visualization/__init__.py b/weldx/visualization/__init__.py index 94cfd60e4..98174f7e0 100644 --- a/weldx/visualization/__init__.py +++ b/weldx/visualization/__init__.py @@ -44,17 +44,11 @@ def __init__(self, *args, **kwargs): CoordinateSystemManagerVisualizerK3D = _Hint SpatialDataVisualizer = _Hint - axes_equal = ( - draw_coordinate_system_matplotlib - ) = ( - new_3d_figure_and_axes - ) = ( + axes_equal = draw_coordinate_system_matplotlib = new_3d_figure_and_axes = ( plot_coordinate_system_manager_matplotlib - ) = ( - plot_coordinate_systems - ) = ( - plot_local_coordinate_system_matplotlib - ) = plot_spatial_data_matplotlib = _warn + ) = plot_coordinate_systems = plot_local_coordinate_system_matplotlib = ( + plot_spatial_data_matplotlib + ) = _warn else: # something else is missing, pass the exception. raise diff --git a/weldx/welding/processes.py b/weldx/welding/processes.py index 422e1b8eb..7b09046aa 100644 --- a/weldx/welding/processes.py +++ b/weldx/welding/processes.py @@ -1,4 +1,5 @@ """Welding process classes.""" + from __future__ import annotations from dataclasses import dataclass diff --git a/weldx/welding/util.py b/weldx/welding/util.py index 31b65bde2..0c5c92f65 100644 --- a/weldx/welding/util.py +++ b/weldx/welding/util.py @@ -1,4 +1,5 @@ """Collection of welding utilities.""" + from __future__ import annotations from typing import TYPE_CHECKING From a295ec923ad916d1901b6dcc6c118ea91c560fce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 11:17:20 +0100 Subject: [PATCH 15/15] Bump pre-commit/action from 3.0.0 to 3.0.1 (#913) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [pre-commit/action](https://github.com/pre-commit/action) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/pre-commit/action/releases) - [Commits](https://github.com/pre-commit/action/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: pre-commit/action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Çağtay Fabry --- .github/workflows/static_analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 1d092f4a8..f814ef22e 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -20,7 +20,7 @@ jobs: with: python-version: 3.x - name: Lint - uses: pre-commit/action@v3.0.0 + uses: pre-commit/action@v3.0.1 with: extra_args: --all-files --show-diff-on-failure