Skip to content

Commit fd69c2e

Browse files
ftorrresdnsmith-
andauthored
Add "--ignore-float-inf" for "correction summary" (#289)
* Add "--ignore-float-inf" for "correction summary" * Pin dask for tests Since dask-awkward does not have a release yet dask-contrib/dask-awkward#582 --------- Co-authored-by: Nicholas Smith <[email protected]>
1 parent 093ce46 commit fd69c2e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ test = [
4646
"awkward >=2.2.2;python_version>'3.7'",
4747
"awkward <2;python_version<='3.7'",
4848
"dask-awkward >=2024.1.1;python_version>'3.7'",
49+
"dask <2025.4.0;python_version>'3.7'",
4950
]
5051
dev = [
5152
"pytest >=4.6",

src/correctionlib/cli.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
"""Command-line interface to correctionlib.
1+
"""Command-line interface to correctionlib."""
22

3-
"""
43
import argparse
54
import sys
65

@@ -77,6 +76,9 @@ def setup_validate(subparsers):
7776

7877

7978
def summary(console: Console, args: argparse.Namespace) -> int:
79+
if args.ignore_float_inf:
80+
schemav2.IGNORE_FLOAT_INF = True
81+
8082
for file in args.files:
8183
console.rule(f"[blue]Corrections in file {file}")
8284
cset = model_auto(open_auto(file))
@@ -89,6 +91,11 @@ def setup_summary(subparsers):
8991
"summary", help="Print a summmary of the corrections"
9092
)
9193
parser.set_defaults(command=summary)
94+
parser.add_argument(
95+
"--ignore-float-inf",
96+
action="store_true",
97+
help="Disable errors for use of float infinities in bin edges (as required in v2.6 and later)",
98+
)
9299
parser.add_argument("files", nargs="+", metavar="FILE")
93100
return parser
94101

0 commit comments

Comments
 (0)