From b063cd9bb9f09a8a7e60d8e42ea24807ba19c116 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:12:12 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v6.0.0) - [github.com/igorshubovych/markdownlint-cli: v0.41.0 → v0.45.0](https://github.com/igorshubovych/markdownlint-cli/compare/v0.41.0...v0.45.0) - [github.com/shellcheck-py/shellcheck-py: v0.10.0.1 → v0.11.0.1](https://github.com/shellcheck-py/shellcheck-py/compare/v0.10.0.1...v0.11.0.1) - [github.com/Mateusz-Grzelinski/actionlint-py: v1.7.1.15 → v1.7.7.24](https://github.com/Mateusz-Grzelinski/actionlint-py/compare/v1.7.1.15...v1.7.7.24) - [github.com/adrienverge/yamllint.git: v1.35.1 → v1.37.1](https://github.com/adrienverge/yamllint.git/compare/v1.35.1...v1.37.1) - [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.12.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.2...v0.12.12) - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.17.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.17.1) --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6582edc..9fa1e3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ exclude: | repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -42,7 +42,7 @@ repos: ['--no-error-on-unmatched-pattern', '--ignore-unknown'] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.41.0 + rev: v0.45.0 hooks: - id: markdownlint args: ["--fix"] @@ -59,18 +59,18 @@ repos: args: ["--ignore=E006,E011"] - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.10.0.1 + rev: v0.11.0.1 hooks: - id: shellcheck args: ["-x"] # Check external files - repo: https://github.com/Mateusz-Grzelinski/actionlint-py - rev: v1.7.1.15 + rev: v1.7.7.24 hooks: - id: actionlint - repo: https://github.com/adrienverge/yamllint.git - rev: v1.35.1 + rev: v1.37.1 hooks: - id: yamllint args: @@ -78,7 +78,7 @@ repos: ignore-from-file: [.gitignore],}"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.2 + rev: v0.12.12 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --config=pyproject.toml] @@ -94,7 +94,7 @@ repos: then /bin/mkdir .mypy_cache; fi; exit 0' - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.10.1" + rev: "v1.17.1" hooks: - id: mypy verbose: true From 6497bdf24147c894b1742a21bd1ed5474c731c27 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:17:37 +0000 Subject: [PATCH 2/2] Chore: pre-commit autoupdate --- tests/test_powerPlant.py | 12 ++++++------ tests/test_realstate.py | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/test_powerPlant.py b/tests/test_powerPlant.py index f8e9ee2..03a707a 100644 --- a/tests/test_powerPlant.py +++ b/tests/test_powerPlant.py @@ -52,17 +52,17 @@ def test_power_plants(): loss_var = pp.financial_losses(damages=damage, energy_price=elec_price, r=r_var) - assert np.isclose( - loss_cst.mean(), loss_var.mean() - ), "Losses are not calculated properly" + assert np.isclose(loss_cst.mean(), loss_var.mean()), ( + "Losses are not calculated properly" + ) # Now the same pp in two different ways pp2 = PowerPlants(capacity=900913242.0091324, av_rate=1, name=name) loss_var2 = pp2.financial_losses(damages=damage, energy_price=elec_price, r=r_var) - assert np.isclose( - loss_var.mean(), loss_var2.mean() - ), "Losses are not calculated properly" + assert np.isclose(loss_var.mean(), loss_var2.mean()), ( + "Losses are not calculated properly" + ) print("FINISHED DCV TEST SUCCESSFULLY!!!") diff --git a/tests/test_realstate.py b/tests/test_realstate.py index bffd048..23bfff1 100644 --- a/tests/test_realstate.py +++ b/tests/test_realstate.py @@ -79,15 +79,15 @@ def test_asset(): variance_loss = losses[0].var() expected_variance_loss = 724.0 print( - f'Mean Financial Losses: {real_asset.financial_losses(["2030-02-09"], damage=discrete_rand_var)[0].mean()}' + f"Mean Financial Losses: {real_asset.financial_losses(['2030-02-09'], damage=discrete_rand_var)[0].mean()}" ) print( - f'Variance Financial Losses: {real_asset.financial_losses(["2030-02-09"], damage=discrete_rand_var)[0].var()}' + f"Variance Financial Losses: {real_asset.financial_losses(['2030-02-09'], damage=discrete_rand_var)[0].var()}" ) assert np.allclose(mean_loss, expected_mean_loss), "Mean is not calculated properly" - assert np.allclose( - variance_loss, expected_variance_loss - ), "Variance is not calculated properly" + assert np.allclose(variance_loss, expected_variance_loss), ( + "Variance is not calculated properly" + ) intervals_osc = np.array( [ @@ -150,12 +150,12 @@ def test_asset(): ] ) - assert np.allclose( - discrete_rand_var_osc.intervals, expected_intervals - ), "Intervals are not calculated properly" - assert np.allclose( - discrete_rand_var_osc.probabilities, expected_probabilities - ), "Probabilities are not calculated properly" + assert np.allclose(discrete_rand_var_osc.intervals, expected_intervals), ( + "Intervals are not calculated properly" + ) + assert np.allclose(discrete_rand_var_osc.probabilities, expected_probabilities), ( + "Probabilities are not calculated properly" + ) # zero included @@ -246,7 +246,7 @@ def test_asset(): loan_amounts=loan_amounts, ) - print(f" LTV mean value (first date, fist asset): {ltv[0,0].mean()}") + print(f" LTV mean value (first date, fist asset): {ltv[0, 0].mean()}") means = DiscreteRandomVariable.means_vectorized(ltv) print(f" LTV mean values: {means}") @@ -257,7 +257,7 @@ def test_asset(): assert np.allclose(means, expected_means), "LTV mean values calculation failed" # Variances - print(f" LTV variance (first date, fist asset): {ltv[0,0].var()}") + print(f" LTV variance (first date, fist asset): {ltv[0, 0].var()}") vars = DiscreteRandomVariable.vars_vectorized(ltv) print(f" LTV variances: {vars}")