Skip to content

Commit 2e64698

Browse files
committed
Fix typing.
1 parent 86a71e6 commit 2e64698

File tree

6 files changed

+5
-5
lines changed

6 files changed

+5
-5
lines changed

scinum/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ def infer_uncertainty_precision(
23322332

23332333
prec = method
23342334
if _is_numpy:
2335-
prec = np.ones(sig.shape, int) * prec # type: ignore[union-attr, assignment]
2335+
prec = np.ones(sig.shape, int) * prec # type: ignore[union-attr, assignment, type-var, operator] # noqa
23362336

23372337
elif method in ["pdg", "pdg+1", "publication", "pub"]:
23382338
# default precision
@@ -2358,7 +2358,7 @@ def infer_uncertainty_precision(
23582358
f"{sig}\nand\n{mag}",
23592359
)
23602360

2361-
prec = np.ones(sig.shape, int) * prec # type: ignore[union-attr, assignment]
2361+
prec = np.ones(sig.shape, int) * prec # type: ignore[union-attr, assignment, type-var, operator] # noqa
23622362

23632363
# make all decisions based on the three leading digits
23642364
first_three = np.round(sig * 100).astype(int) # type: ignore[assignment]
@@ -2462,15 +2462,15 @@ def round_uncertainty(
24622462
if precision is not None:
24632463
if _is_numpy:
24642464
if not is_numpy(precision):
2465-
precision = np.ones(digits.shape, int) * precision # type: ignore[union-attr]
2466-
if np.any(precision <= 0):
2465+
precision = np.ones(digits.shape, int) * precision # type: ignore[union-attr, type-var, operator] # noqa
2466+
if np.any(precision <= 0): # type: ignore[operator]
24672467
raise ValueError(f"precision must be positive: {precision}")
24682468
elif precision <= 0:
24692469
raise ValueError(f"precision must be positive: {precision}")
24702470

24712471
digits_float = np.array(digits, float) if _is_numpy else float(digits)
24722472
digits = match_precision(digits_float * 10.0**(precision - prec), "1", **kwargs) # type: ignore[operator] # noqa
2473-
mag -= precision - prec
2473+
mag -= precision - prec # type: ignore[operator]
24742474

24752475
return ( # type: ignore[return-value]
24762476
digits,

tests/all.sh

100755100644
File mode changed.

tests/coverage.sh

100755100644
File mode changed.

tests/linting.sh

100755100644
File mode changed.

tests/typecheck.sh

100755100644
File mode changed.

tests/unittest.sh

100755100644
File mode changed.

0 commit comments

Comments
 (0)