From 695fcba6bd9cfc885a1801e59c141dcf85d8969a Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Mon, 9 Dec 2024 16:55:47 -0500 Subject: [PATCH 1/5] Don't mark containers as static unless all members are static --- desc/io/optimizable_io.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/desc/io/optimizable_io.py b/desc/io/optimizable_io.py index e15a21756e..2755a6a212 100644 --- a/desc/io/optimizable_io.py +++ b/desc/io/optimizable_io.py @@ -82,9 +82,9 @@ def _unjittable(x): # strings and functions can't be args to jitted functions, and ints/bools are pretty # much always flags or array sizes which also need to be a compile time constant if isinstance(x, (list, tuple)): - return any([_unjittable(y) for y in x]) + return all([_unjittable(y) or y is None for y in x]) if isinstance(x, dict): - return any([_unjittable(y) for y in x.values()]) + return all([_unjittable(y) or y is None for y in x.values()]) if hasattr(x, "dtype") and np.ndim(x) == 0: return np.issubdtype(x.dtype, np.bool_) or np.issubdtype(x.dtype, np.int_) return isinstance( @@ -94,6 +94,12 @@ def _unjittable(x): def _make_hashable(x): # turn unhashable ndarray of ints into a hashable tuple + if isinstance(x, list): + return [_make_hashable(y) for y in x] + if isinstance(x, tuple): + return tuple([_make_hashable(y) for y in x]) + if isinstance(x, dict): + return {key: _make_hashable(val) for key, val in x.items()} if hasattr(x, "shape"): return ("ndarray", x.shape, tuple(x.flatten())) return x @@ -103,6 +109,12 @@ def _unmake_hashable(x): # turn tuple of ints and shape to ndarray if isinstance(x, tuple) and x[0] == "ndarray": return np.array(x[2]).reshape(x[1]) + if isinstance(x, list): + return [_unmake_hashable(y) for y in x] + if isinstance(x, tuple): + return tuple([_unmake_hashable(y) for y in x]) + if isinstance(x, dict): + return {key: _unmake_hashable(val) for key, val in x.items()} return x From 065dbf2943736f2eb57711822f8b626ced46f2af Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Tue, 10 Dec 2024 13:28:49 -0500 Subject: [PATCH 2/5] Update github action versions --- .github/dependabot.yml | 5 +++++ .github/workflows/regression_tests.yml | 15 +++++---------- .github/workflows/unit_tests.yml | 15 +++++---------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1c3b05f99c..60841fd13d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,8 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 8c7e450607..9e648d3ec1 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -107,14 +107,9 @@ jobs: - name: Upload coverage if: env.has_changes == 'true' id : codecov - uses: Wandalen/wretry.action@v3.5.0 + uses: codecov/codecov-action@v5 with: - action: codecov/codecov-action@v4 - with: | - token: ${{ secrets.CODECOV_TOKEN }} - name: codecov-umbrella - files: ./cov.xml - fail_ci_if_error: true - verbose: true - attempt_limit: 10 - attempt_delay: 60000 # ms, 1 min + name: codecov-umbrella + files: ./cov.xml + fail_ci_if_error: true + verbose: true diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8a094ea55e..6e8ebc7a66 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -113,14 +113,9 @@ jobs: - name: Upload coverage if: env.has_changes == 'true' id : codecov - uses: Wandalen/wretry.action@v3.5.0 + uses: codecov/codecov-action@v5 with: - action: codecov/codecov-action@v4 - with: | - token: ${{ secrets.CODECOV_TOKEN }} - name: codecov-umbrella - files: ./cov.xml - fail_ci_if_error: true - verbose: true - attempt_limit: 10 - attempt_delay: 60000 # ms, 1 min + name: codecov-umbrella + files: ./cov.xml + fail_ci_if_error: true + verbose: true From 46ea3a67875ed001835acef1b5cbf5557ff16bc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:39:44 +0000 Subject: [PATCH 3/5] Bump thollander/actions-comment-pull-request from 2 to 3 Bumps [thollander/actions-comment-pull-request](https://github.com/thollander/actions-comment-pull-request) from 2 to 3. - [Release notes](https://github.com/thollander/actions-comment-pull-request/releases) - [Commits](https://github.com/thollander/actions-comment-pull-request/compare/v2...v3) --- updated-dependencies: - dependency-name: thollander/actions-comment-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e0e00fc9ab..e2489e9fca 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -151,7 +151,7 @@ jobs: - name: Comment PR with the results if: env.has_changes == 'true' - uses: thollander/actions-comment-pull-request@v2 + uses: thollander/actions-comment-pull-request@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 3095e50d468cd0ab21632290f29d8bf584b1a934 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:34:24 +0000 Subject: [PATCH 4/5] Bump pypa/gh-action-pypi-publish from 1.4.2 to 1.12.3 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.4.2 to 1.12.3. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/27b31702a0e7fc50959f5ad993c78deac1bdfc29...67339c736fd9354cd4f8cb0b744f2b82a74b5c70) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d1439cc21..74a37b4e58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: Build package run: python -m build --sdist --wheel - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} From 273515b231a2b4d187961a06abcdb54325e369ed Mon Sep 17 00:00:00 2001 From: Rory Conlin Date: Wed, 11 Dec 2024 11:20:59 -0500 Subject: [PATCH 5/5] Update syntax for pr commenter action --- .github/workflows/benchmark.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e2489e9fca..9f13a85de7 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -153,10 +153,10 @@ jobs: if: env.has_changes == 'true' uses: thollander/actions-comment-pull-request@v3 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} with: - filePath: tests/benchmarks/commit_msg.txt - comment_tag: benchmark + file-path: tests/benchmarks/commit_msg.txt + comment-tag: benchmark - name: Upload benchmark data if: always() && env.has_changes == 'true'