Skip to content

Commit

Permalink
Fix an issue with numpy 2. (#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey authored Oct 22, 2024
1 parent 78986ba commit c3a2c62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand Down Expand Up @@ -57,7 +57,7 @@ repos:
hooks:
- id: circleci-config-validate
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
rev: v3.18.0
hooks:
- id: pyupgrade
args:
Expand All @@ -73,7 +73,7 @@ repos:
- id: flake8
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.1
rev: v0.7.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
3 changes: 2 additions & 1 deletion histomicstk/features/compute_morphometry_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ def boxcount(arr, k):
# Fit the successive log(sizes) with log (counts)
coeffs = [0]
with warnings.catch_warnings():
warnings.simplefilter('ignore', np.RankWarning)
if hasattr(np, 'RankWarning'):
warnings.simplefilter('ignore', np.RankWarning)
if len(counts):
try:
coeffs = np.polyfit(np.log(sizes), np.log(counts), 1)
Expand Down

0 comments on commit c3a2c62

Please sign in to comment.