Skip to content

Commit 41843a2

Browse files
committed
fix(lint): UP038 isinstance tuple wrappers + codespell matric whitelist
- src/audit_chain.py: isinstance(v, (np.integer,)) -> isinstance(v, np.integer) same for np.floating. Single-element tuples are semantically equivalent but ruff UP038 prefers the bare type for readability. - .pre-commit-config.yaml: add "matric" to codespell -L list. "matric potential" is a real soil-physics term used in the Philip-de Vries formulation, not a typo of metric/matrix.
1 parent b106fa0 commit 41843a2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
rev: v2.3.0
3030
hooks:
3131
- id: codespell
32-
args: ["-L", "ans,nd,te,thi,fro,ot"]
32+
args: ["-L", "ans,nd,te,thi,fro,ot,matric"] # "matric potential" is a real term in unsaturated porous-media physics
3333
exclude: "^(assets|notebooks|week9_brief_latex\\.html)/"
3434

3535
ci:

src/audit_chain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def _s(d):
4242
for k, v in d.items():
4343
if isinstance(v, np.ndarray):
4444
out[k] = v.tolist()
45-
elif isinstance(v, (np.integer,)):
45+
elif isinstance(v, np.integer):
4646
out[k] = int(v)
47-
elif isinstance(v, (np.floating,)):
47+
elif isinstance(v, np.floating):
4848
out[k] = float(v)
4949
elif isinstance(v, dict):
5050
out[k] = _s(v)

0 commit comments

Comments
 (0)