Skip to content

Commit

Permalink
fix: histogram validation test for numpy 2.0 (#484)
Browse files Browse the repository at this point in the history
* fix the way histogram indices are represented for numpy 2.0
* updated pre-commit
  • Loading branch information
alexander-held authored Aug 15, 2024
1 parent 7167074 commit 3a9c0fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.11.1
hooks:
- id: mypy
name: mypy with Python 3.9
Expand All @@ -18,17 +18,17 @@ repos:
additional_dependencies: ["numpy>=1.22", "boost-histogram>=1.0.1", "click>=8", "types-tabulate", "types-PyYAML", "hist>=2.3.0"]
args: ["--python-version=3.12"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear, flake8-import-order, flake8-print]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.1
rev: v3.17.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ["--maxkb=100"]
Expand All @@ -40,7 +40,7 @@ repos:
# configuration duplicated in setup.cfg
args: ["--match=(?!setup|example).*\\.py'", "--match-dir='^(?!(tests|utils|docs)).*'", "--convention=google"]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ["-L", "hist", "src", "tests", "utils", "docs/*rst"]
2 changes: 1 addition & 1 deletion src/cabinetry/histo.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def validate(self, name: str) -> None:

# check whether there are any bins with ill-defined stat. uncertainty
# but non-empty yield, those deserve a closer look
not_empty_but_nan = [b for b in nan_pos if b not in empty_bins]
not_empty_but_nan = np.asarray([b for b in nan_pos if b not in empty_bins])
if len(not_empty_but_nan) > 0:
log.warning(
f"{name} has non-empty bins with ill-defined stat. unc.: "
Expand Down

0 comments on commit 3a9c0fa

Please sign in to comment.