Skip to content

Commit

Permalink
Merge branch 'master' into dd/linking_current
Browse files Browse the repository at this point in the history
  • Loading branch information
f0uriest authored Dec 11, 2024
2 parents f060c38 + 61e5034 commit d48f484
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 4 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ 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 }}
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'
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
15 changes: 5 additions & 10 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 14 additions & 2 deletions desc/io/optimizable_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand All @@ -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


Expand Down

0 comments on commit d48f484

Please sign in to comment.