From 5bd0a382a1fcb82217e1181835d20e54bde7fb12 Mon Sep 17 00:00:00 2001 From: Patrick Kopper Date: Thu, 2 Apr 2026 12:04:55 +0200 Subject: [PATCH 1/2] CI/CD: Update rules for ty v0.0.27 --- pyhope/mesh/transform/mesh_transform.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyhope/mesh/transform/mesh_transform.py b/pyhope/mesh/transform/mesh_transform.py index 879d2b06..d9a63496 100644 --- a/pyhope/mesh/transform/mesh_transform.py +++ b/pyhope/mesh/transform/mesh_transform.py @@ -27,6 +27,7 @@ # ---------------------------------------------------------------------------------------------------------------------------------- from __future__ import annotations from typing import Final +from typing import cast # ---------------------------------------------------------------------------------------------------------------------------------- # Third-party libraries # ---------------------------------------------------------------------------------------------------------------------------------- @@ -92,6 +93,9 @@ def CalcStretching(nZones: int, zone: int, nElems: npt.NDArray, lEdges: npt.NDAr progFac, l0, dx = handler() if handler else (np.array(()), np.array(()), np.array(())) if stretchingType == 'combination': + if progFac is None or l0 is None or dx is None: + hopout.error(f'Missing parameter {[n for (s, n) in zip((progFac, l0, dx), ("factor", "l0", "dx"), strict=True) if s is None]}, exiting...') # noqa: E501 + for iDim in range(3): if np.isclose(progFac[iDim], 0., atol=mesh_vars.tolInternal): continue # Skip if factor is zero, (nElem, l0) given, factor calculated later @@ -107,6 +111,9 @@ def CalcStretching(nZones: int, zone: int, nElems: npt.NDArray, lEdges: npt.NDAr # Calculate the required factor from ratio or combination input if stretchingType in {'ratio', 'combination'}: + if progFac is None or l0 is None or dx is None: + hopout.error(f'Missing parameter {[n for (s, n) in zip((progFac, l0, dx), ("factor", "l0", "dx"), strict=True) if s is None]}, exiting...') # noqa: E501 + print(hopout.warn(hopout.Colors.WARN + '─'*(46-16) + hopout.Colors.END)) for iDim in range(3): if nElems[iDim] == 1 or dx[iDim] == 0: @@ -146,7 +153,7 @@ def CalcStretching(nZones: int, zone: int, nElems: npt.NDArray, lEdges: npt.NDAr hopout.error('Stretching factor = 0 is invalid, exiting...') # Return stretching factor - return progFac + return cast(np.ndarray, progFac) def TransformMesh() -> None: From 99feed91533faab0c867b264127e7c045cc3291b Mon Sep 17 00:00:00 2001 From: Patrick Kopper Date: Fri, 3 Apr 2026 12:19:18 +0200 Subject: [PATCH 2/2] CI/CD: Reduce Git LFS bandwidth pressure --- .github/workflows/ci.yml | 176 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 165 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22713149..cec30cc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,6 +61,9 @@ jobs: image: python:3.14.3-slim-trixie steps: - uses: actions/checkout@v6 + # with: + # fetch-depth: 0 + # fetch-tags: true - uses: ./.github/actions/setup with: minimal: 'true' @@ -83,9 +86,50 @@ jobs: run: | apt-get update apt-get install -y --no-install-recommends git git-lfs + # - uses: actions/setup-node@v6 + # with: + # node-version: 'latest' + # Cached LFS requires node + # - name: Ensure NodeJS + # shell: bash + # run: | + # if command -v node &> /dev/null; then exit 0; fi + # # Container is Debian-based (apt) + # if command -v apt-get &> /dev/null; then + # apt-get update -y + # apt-get install -y --no-install-recommends nodejs + # fi + # # Container Fedora-based (dnf) + # if command -v dnf &> /dev/null; then + # dnf makecache + # dnf update -y + # dnf install -y node + # fi + # This does not strictly require LFS but we want the checkout before the compatibility matrix - uses: actions/checkout@v6 - with: - lfs: true + # - uses: nschloe/action-cached-lfs-checkout@v1 + # with: Reduce Git LFS bandwidth + # fetch-depth: 0 + # fetch-tags: true + # lfs: true + # - name: Create Git LFS file list + # run: | + # pwd + # ls -al + # ls -al .git + # git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + # - name: Restore Git LFS object cache + # uses: actions/cache@v5 + # with: + # path: .git/lfs/objects + # key: ${{ runner.os }}-lfsdata-v1-${{ hashFiles('.lfs-assets-id') }} + # restore-keys: | + # ${{ runner.os }}-lfsdata-v1- + # ${{ runner.os }}-lfsdata + # - name: Fetch any needed Git LFS objects and prune extraneous ones + # run: git lfs fetch --prune + # - name: Check out Git LFS content + # run: git lfs checkout - uses: ./.github/actions/setup # with: # minimal: 'false' @@ -103,6 +147,9 @@ jobs: image: python:3.14.3-slim-trixie steps: - uses: actions/checkout@v6 + # with: + # fetch-depth: 0 + # fetch-tags: true - uses: ./.github/actions/setup with: minimal: 'true' @@ -138,9 +185,45 @@ jobs: run: | apt-get update apt-get install -y --no-install-recommends git git-lfs + # - uses: actions/setup-node@v6 + # with: + # node-version: 'latest' + # Cached LFS requires node + # - name: Ensure NodeJS + # shell: bash + # run: | + # if command -v node &> /dev/null; then exit 0; fi + # # Container is Debian-based (apt) + # if command -v apt-get &> /dev/null; then + # apt-get update -y + # apt-get install -y --no-install-recommends nodejs + # fi + # # Container Fedora-based (dnf) + # if command -v dnf &> /dev/null; then + # dnf makecache + # dnf update -y + # dnf install -y node + # fi - uses: actions/checkout@v6 + # - uses: nschloe/action-cached-lfs-checkout@v1 with: + # fetch-depth: 0 + # fetch-tags: true lfs: true + # - name: Create Git LFS file list + # run: git lfs ls-files -l | cut -d' ' -f1 | sort > .git/lfs-assets-id + # - name: Restore Git LFS object cache + # uses: actions/cache@v5 + # with: + # path: .git/lfs + # key: ${{ runner.os }}-lfsdata-v1-${{ hashFiles('.git/lfs-assets-id') }} + # restore-keys: | + # ${{ runner.os }}-lfsdata-v1- + # ${{ runner.os }}-lfsdata + # - name: Fetch any needed Git LFS objects and prune extraneous ones + # run: git lfs fetch --prune + # - name: Check out Git LFS content + # run: git lfs checkout - uses: ./.github/actions/setup - name: Run compatibility tests shell: bash @@ -165,12 +248,45 @@ jobs: run: | apt-get update apt-get install -y --no-install-recommends git git-lfs + # - uses: actions/setup-node@v6 + # with: + # node-version: 'latest' + # Cached LFS requires node + # - name: Ensure NodeJS + # shell: bash + # run: | + # if command -v node &> /dev/null; then exit 0; fi + # # Container is Debian-based (apt) + # if command -v apt-get &> /dev/null; then + # apt-get update -y + # apt-get install -y --no-install-recommends nodejs + # fi + # # Container Fedora-based (dnf) + # if command -v dnf &> /dev/null; then + # dnf makecache + # dnf update -y + # dnf install -y node + # fi - uses: actions/checkout@v6 + # - uses: nschloe/action-cached-lfs-checkout@v1 with: + # fetch-depth: 0 + # fetch-tags: true lfs: true - # - uses: actions/setup-node@v6 + # - name: Create Git LFS file list + # run: git lfs ls-files -l | cut -d' ' -f1 | sort > .git/lfs-assets-id + # - name: Restore Git LFS object cache + # uses: actions/cache@v5 # with: - # node-version: 'latest' + # path: .git/lfs + # key: ${{ runner.os }}-lfsdata-v1-${{ hashFiles('.git/lfs-assets-id') }} + # restore-keys: | + # ${{ runner.os }}-lfsdata-v1- + # ${{ runner.os }}-lfsdata + # - name: Fetch any needed Git LFS objects and prune extraneous ones + # run: git lfs fetch --prune + # - name: Check out Git LFS content + # run: git lfs checkout - uses: ./.github/actions/setup with: coverage: 'true' @@ -203,9 +319,42 @@ jobs: # - uses: actions/setup-node@v6 # with: # node-version: 'latest' + # Cached LFS requires node + # - name: Ensure NodeJS + # shell: bash + # run: | + # if command -v node &> /dev/null; then exit 0; fi + # # Container is Debian-based (apt) + # if command -v apt-get &> /dev/null; then + # apt-get update -y + # apt-get install -y --no-install-recommends nodejs + # fi + # # Container Fedora-based (dnf) + # if command -v dnf &> /dev/null; then + # dnf makecache + # dnf update -y + # dnf install -y node + # fi - uses: actions/checkout@v6 + # - uses: nschloe/action-cached-lfs-checkout@v1 with: + # fetch-depth: 0 + # fetch-tags: true lfs: true + # - name: Create Git LFS file list + # run: git lfs ls-files -l | cut -d' ' -f1 | sort > .git/lfs-assets-id + # - name: Restore Git LFS object cache + # uses: actions/cache@v5 + # with: + # path: .git/lfs + # key: ${{ runner.os }}-lfsdata-v1-${{ hashFiles('.git/lfs-assets-id') }} + # restore-keys: | + # ${{ runner.os }}-lfsdata-v1- + # ${{ runner.os }}-lfsdata + # - name: Fetch any needed Git LFS objects and prune extraneous ones + # run: git lfs fetch --prune + # - name: Check out Git LFS content + # run: git lfs checkout - uses: ./.github/actions/setup with: coverage: 'true' @@ -235,17 +384,19 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} steps: # Git LFS requires git - - name: Install Git LFS - shell: bash - run: | - dnf update -y - dnf install -y git-lfs + # - name: Install Git LFS + # shell: bash + # run: | + # dnf update -y + # dnf install -y git-lfs # - uses: actions/setup-node@v6 # with: # node-version: 'latest' - uses: actions/checkout@v6 - with: - lfs: true + # with: Reduce Git LFS bandwidth + # fetch-depth: 0 + # fetch-tags: true + # lfs: true - uses: ./.github/actions/setup with: coverage: 'true' @@ -272,6 +423,9 @@ jobs: image: python:3.14.3-slim-trixie steps: - uses: actions/checkout@v6 + # with: + # fetch-depth: 0 + # fetch-tags: true # - uses: actions/setup-node@v6 # with: # node-version: 'latest'