From d7a119a79206ea2120fe6c44d7eeab1f2a8a6479 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 18:23:46 +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/pycqa/isort: 8.0.1 → 9.0.0a3](https://github.com/pycqa/isort/compare/8.0.1...9.0.0a3) - [github.com/psf/black-pre-commit-mirror: 26.1.0 → 26.3.1](https://github.com/psf/black-pre-commit-mirror/compare/26.1.0...26.3.1) - [github.com/astral-sh/ruff-pre-commit: v0.15.4 → v0.15.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.4...v0.15.12) - [github.com/PyCQA/docformatter: v1.7.7 → v1.7.8](https://github.com/PyCQA/docformatter/compare/v1.7.7...v1.7.8) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eccabac..45057c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: - id: python-use-type-annotations - id: text-unicode-replacement-char - repo: https://github.com/pycqa/isort - rev: 8.0.1 + rev: 9.0.0a3 hooks: - id: isort name: isort @@ -55,13 +55,13 @@ repos: # args: # - --py37-plus - repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.1.0 + rev: 26.3.1 hooks: - id: black language_version: python3.12 exclude: tests/utils/fast_upper_envelope_org.py - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.4 + rev: v0.15.12 hooks: - id: ruff # exclude: | @@ -70,7 +70,7 @@ repos: # docs/source/conf.py| # )$ - repo: https://github.com/PyCQA/docformatter - rev: v1.7.7 + rev: v1.7.8 hooks: - id: docformatter args: From 46d6d511a0ae695166f8c49ea4483bb03e76c08e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 18:24:45 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/upper_envelope/math_funcs.py | 1 - src/upper_envelope/numba/fues_numba/fues_numba.py | 5 ----- tests/test_drued_jorg_numba.py | 7 +++---- tests/utils/upper_envelope_fedor.py | 1 - 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/upper_envelope/math_funcs.py b/src/upper_envelope/math_funcs.py index e13dc6c..a7c60a2 100644 --- a/src/upper_envelope/math_funcs.py +++ b/src/upper_envelope/math_funcs.py @@ -176,7 +176,6 @@ def _find_linear_intersection( tuple: x and y coordinates of the intersection point. """ - slope1 = calc_gradient(x1, y1, x2, y2) slope2 = calc_gradient(x3, y3, x4, y4) diff --git a/src/upper_envelope/numba/fues_numba/fues_numba.py b/src/upper_envelope/numba/fues_numba/fues_numba.py index 7a0ed91..3072ad4 100644 --- a/src/upper_envelope/numba/fues_numba/fues_numba.py +++ b/src/upper_envelope/numba/fues_numba/fues_numba.py @@ -170,7 +170,6 @@ def fues_numba_unconstrained( containing refined value function. """ - endog_grid = endog_grid[np.where(~np.isnan(value))[0]] policy = policy[np.where(~np.isnan(value))] value = value[np.where(~np.isnan(value))] @@ -234,7 +233,6 @@ def scan_value_function( the optimal points are kept. """ - value_refined, policy_refined, endog_grid_refined = _initialize_refined_arrays( value, policy, endog_grid ) @@ -550,7 +548,6 @@ def _forward_scan( the same value function. """ - is_next_on_same_value = 0 idx_on_same_value = 0 grad_next_on_same_value = 0 @@ -623,7 +620,6 @@ def _backward_scan( previous point on the same value function. """ - is_before_on_same_value = 0 sub_idx_point_before_on_same_value = 0 grad_before_on_same_value = 0 @@ -713,7 +709,6 @@ def _linear_intersection( tuple: x and y coordinates of the intersection point. """ - slope1 = (y2 - y1) / (x2 - x1) slope2 = (y4 - y3) / (x4 - x3) diff --git a/tests/test_drued_jorg_numba.py b/tests/test_drued_jorg_numba.py index 4b061e9..859aa5a 100644 --- a/tests/test_drued_jorg_numba.py +++ b/tests/test_drued_jorg_numba.py @@ -1,10 +1,9 @@ """Tests for `drued_jorg_numba`. -This test mirrors `tests/test_jorg_drued_jax.py` but exercises the numba -implementation. +This test mirrors `tests/test_jorg_drued_jax.py` but exercises the numba implementation. -We compare against `upenv.fues_jax`, but only on evaluation points that lie on -reference line segments that are not affected by explicit intersection handling. +We compare against `upenv.fues_jax`, but only on evaluation points that lie on reference +line segments that are not affected by explicit intersection handling. """ diff --git a/tests/utils/upper_envelope_fedor.py b/tests/utils/upper_envelope_fedor.py index 9895e76..97a82a1 100644 --- a/tests/utils/upper_envelope_fedor.py +++ b/tests/utils/upper_envelope_fedor.py @@ -563,7 +563,6 @@ def _augment_grid( Shape (2, *n_grid_augmented*). """ - grid_points_to_add = np.linspace(min_wealth_grid, value[0, 1], n_grid_wealth // 10)[ :-1 ]