Skip to content

Commit c3a2c62

Browse files
authored
Fix an issue with numpy 2. (#1140)
1 parent 78986ba commit c3a2c62

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# See https://pre-commit.com/hooks.html for more hooks
55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.6.0
7+
rev: v5.0.0
88
hooks:
99
- id: check-added-large-files
1010
- id: check-ast
@@ -57,7 +57,7 @@ repos:
5757
hooks:
5858
- id: circleci-config-validate
5959
- repo: https://github.com/asottile/pyupgrade
60-
rev: v3.17.0
60+
rev: v3.18.0
6161
hooks:
6262
- id: pyupgrade
6363
args:
@@ -73,7 +73,7 @@ repos:
7373
- id: flake8
7474
- repo: https://github.com/astral-sh/ruff-pre-commit
7575
# Ruff version.
76-
rev: v0.6.1
76+
rev: v0.7.0
7777
hooks:
7878
- id: ruff
7979
args: [--fix, --exit-non-zero-on-fix]

histomicstk/features/compute_morphometry_features.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def boxcount(arr, k):
213213
# Fit the successive log(sizes) with log (counts)
214214
coeffs = [0]
215215
with warnings.catch_warnings():
216-
warnings.simplefilter('ignore', np.RankWarning)
216+
if hasattr(np, 'RankWarning'):
217+
warnings.simplefilter('ignore', np.RankWarning)
217218
if len(counts):
218219
try:
219220
coeffs = np.polyfit(np.log(sizes), np.log(counts), 1)

0 commit comments

Comments
 (0)