From 7682f6f3c583b01b4699fb5957e6a2c6d6862923 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 18:27:20 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/lyz-code/yamlfix: 1.17.0 → 1.19.1](https://github.com/lyz-code/yamlfix/compare/1.17.0...1.19.1) - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/pycqa/isort: 6.0.1 → 7.0.0](https://github.com/pycqa/isort/compare/6.0.1...7.0.0) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 25.1.0 → 25.12.0](https://github.com/psf/black-pre-commit-mirror/compare/25.1.0...25.12.0) - [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.14.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.8...v0.14.10) - [github.com/executablebooks/mdformat: 0.7.22 → 1.0.0](https://github.com/executablebooks/mdformat/compare/0.7.22...1.0.0) --- .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 80e3965..548f73b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,11 +10,11 @@ repos: hooks: - id: yamllint - repo: https://github.com/lyz-code/yamlfix - rev: 1.17.0 + rev: 1.19.1 hooks: - id: yamlfix - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files args: @@ -42,7 +42,7 @@ repos: - id: python-use-type-annotations - id: text-unicode-replacement-char - repo: https://github.com/pycqa/isort - rev: 6.0.1 + rev: 7.0.0 hooks: - id: isort name: isort @@ -54,14 +54,14 @@ repos: # - id: reorder-python-imports # args: # - --py37-plus - - repo: https://github.com/psf/black - rev: 25.1.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 hooks: - id: black language_version: python3.11 exclude: tests/utils/fast_upper_envelope_org.py - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.8 + rev: v0.14.10 hooks: - id: ruff # exclude: | @@ -87,7 +87,7 @@ repos: - id: nbqa-black - id: nbqa-ruff - repo: https://github.com/executablebooks/mdformat - rev: 0.7.22 + rev: 1.0.0 hooks: - id: mdformat additional_dependencies: From 17afca627c76a0bb5a06231e8d74039cb835e3b5 Mon Sep 17 00:00:00 2001 From: MaxBlesch Date: Tue, 27 Jan 2026 12:15:30 +0100 Subject: [PATCH 2/3] Fixed pre commit --- src/upper_envelope/fues_jax/fues_jax.py | 3 +-- tests/test_fues_numba.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/upper_envelope/fues_jax/fues_jax.py b/src/upper_envelope/fues_jax/fues_jax.py index 44abb7c..91de7fc 100644 --- a/src/upper_envelope/fues_jax/fues_jax.py +++ b/src/upper_envelope/fues_jax/fues_jax.py @@ -11,7 +11,6 @@ import jax import jax.numpy as jnp -import numpy as np from jax import vmap from upper_envelope.fues_jax.check_and_scan_funcs import ( @@ -124,7 +123,7 @@ def fues_jax( # Because of jax, we always need to perform the same set of computations. Hence, # if there is no wealth grid point below the first, we just add nans thereafter. - min_id = np.argmin(endog_grid) + min_id = jnp.argmin(endog_grid) min_wealth_grid = endog_grid[min_id] # This is the condition, which we do not use at the moment. diff --git a/tests/test_fues_numba.py b/tests/test_fues_numba.py index 98189cf..b4ab325 100644 --- a/tests/test_fues_numba.py +++ b/tests/test_fues_numba.py @@ -161,9 +161,9 @@ def test_fast_upper_envelope_against_org_fues(setup_model): policy_expected = policy_org[~np.isnan(policy_org)] value_expected = value_org[~np.isnan(value_org)] - assert np.all(np.in1d(endog_grid_expected, endog_grid_refined)) - assert np.all(np.in1d(policy_expected, policy_refined)) - assert np.all(np.in1d(value_expected, value_refined)) + assert np.all(np.isin(endog_grid_expected, endog_grid_refined)) + assert np.all(np.isin(policy_expected, policy_refined)) + assert np.all(np.isin(value_expected, value_refined)) @pytest.mark.parametrize("period", [2, 4, 10, 9, 18]) From 3209248912626c92da17224bad4d6cef4dcc6ee9 Mon Sep 17 00:00:00 2001 From: MaxBlesch Date: Tue, 27 Jan 2026 13:57:04 +0100 Subject: [PATCH 3/3] Fix --- src/upper_envelope/fues_jax/fues_jax.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/upper_envelope/fues_jax/fues_jax.py b/src/upper_envelope/fues_jax/fues_jax.py index 91de7fc..acb430a 100644 --- a/src/upper_envelope/fues_jax/fues_jax.py +++ b/src/upper_envelope/fues_jax/fues_jax.py @@ -129,8 +129,8 @@ def fues_jax( # This is the condition, which we do not use at the moment. # closed_form_cond = min_wealth_grid < endog_grid[0] grid_points_to_add = jnp.linspace( - min_wealth_grid, endog_grid[0], n_constrained_points_to_add + 1 - )[:-1] + min_wealth_grid, endog_grid[0], n_constrained_points_to_add + ) # Compute closed form values values_to_add = vmap(_compute_value, in_axes=(0, None, None, None))( grid_points_to_add, value_function, value_function_args, value_function_kwargs