From d874bfc1b063210ce071d44281eed52c8fa6d419 Mon Sep 17 00:00:00 2001 From: gavinmacaulay <4051869+gavinmacaulay@users.noreply.github.com> Date: Sun, 6 Sep 2026 04:15:27 +0000 Subject: [PATCH 1/3] Update pre-commit hooks --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3585a83..979233f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: args: ["--skip=src/otherCode,*.ipynb,*.pdf,*.svg", "-w", "docs", "src"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.4 + rev: v0.16.6 hooks: - id: ruff-check args: ["--color", "always"] From b5f853c10d6ccc5eec67d75434677ca36e32d9df Mon Sep 17 00:00:00 2001 From: Gavin Macaulay Date: Mon, 7 Sep 2026 11:13:48 +1200 Subject: [PATCH 2/3] Fix or ignore ruff warnings from updating ruff version in pre-commit --- pyproject.toml | 1 + tests/test_misc.py | 2 ++ tests/test_model_outputs.py | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 265a03f..a1ea1b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,6 +120,7 @@ ignore = [ "E226", # missing whitespace around arthmetic operator "TD002", # missing todo author "TD003", # missing todo link + "float-equality-comparison", ] extend-select = [ diff --git a/tests/test_misc.py b/tests/test_misc.py index af4b6e6..32dacb4 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -33,6 +33,8 @@ def models(): def test_theoretical_Sa(): with pytest.raises(ValueError): theoretical_Sa(ts=-45.0, eba=20.1, r=10) + + with pytest.raises(ValueError): theoretical_Sa(ts=-45.0, eba=-20.1, r=0.0) diff --git a/tests/test_model_outputs.py b/tests/test_model_outputs.py index d7a911a..a097394 100644 --- a/tests/test_model_outputs.py +++ b/tests/test_model_outputs.py @@ -90,6 +90,8 @@ def test_psmsmodel(rm, reference_model, f, theta, ts): with pytest.raises(ValueError): m['boundary_type'] = echosms.boundary_type.none + + with pytest.raises(ValueError): mod.calculate_ts_single(**m, validate_parameters=False) @@ -171,6 +173,8 @@ def test_kamodel(rm): # check the invalid boundary type code with pytest.raises(ValueError): p['boundary_type'] = echosms.boundary_type.none + + with pytest.raises(ValueError): mod.calculate_ts_single(**p, validate_parameters=False) From 02f1e54ae92d40571725c6ada64b8c7b94f1511f Mon Sep 17 00:00:00 2001 From: Gavin Macaulay Date: Mon, 7 Sep 2026 11:23:23 +1200 Subject: [PATCH 3/3] fix previous commit re tests that failed --- tests/test_model_outputs.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_model_outputs.py b/tests/test_model_outputs.py index a097394..cce51d6 100644 --- a/tests/test_model_outputs.py +++ b/tests/test_model_outputs.py @@ -88,9 +88,7 @@ def test_psmsmodel(rm, reference_model, f, theta, ts): mod.calculate_ts_single(**m, validate_parameters=True) - with pytest.raises(ValueError): - m['boundary_type'] = echosms.boundary_type.none - + m['boundary_type'] = echosms.boundary_type.none with pytest.raises(ValueError): mod.calculate_ts_single(**m, validate_parameters=False) @@ -171,9 +169,7 @@ def test_kamodel(rm): assert np.allclose(mod.calculate_ts(p), -44.4474, atol=0.0001), "Incorrect TS value" # check the invalid boundary type code - with pytest.raises(ValueError): - p['boundary_type'] = echosms.boundary_type.none - + p['boundary_type'] = echosms.boundary_type.none with pytest.raises(ValueError): mod.calculate_ts_single(**p, validate_parameters=False)