diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76a36288..72be6896 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,6 @@ repos: hooks: - id: black language_version: python3.10 - exclude: tests/utils/fast_upper_envelope_org.py # - repo: https://github.com/charliermarsh/ruff-pre-commit # rev: v0.0.282 # hooks: @@ -77,7 +76,6 @@ repos: - --wrap-descriptions - '88' - --blank - exclude: tests/utils/fast_upper_envelope_org.py - repo: https://github.com/nbQA-dev/nbQA rev: 1.7.0 hooks: diff --git a/README.md b/README.md index 0678f8cb..9c86cab3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Continuous Integration Workflow](https://github.com/OpenSourceEconomics/dcegm/actions/workflows/main.yml/badge.svg)](https://github.com/OpenSourceEconomics/dcegm/actions/workflows/main.yml) [![Codecov](https://codecov.io/gh/OpenSourceEconomics/dcegm/branch/main/graph/badge.svg)](https://app.codecov.io/gh/OpenSourceEconomics/dcegm) +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/OpenSourceEconomics/dcegm/main.svg)](https://results.pre-commit.ci/latest/github/OpenSourceEconomics/dcegm/main) [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) Python implementation of the Discrete-Continuous Endogenous Grid Method (DC-EGM) for diff --git a/src/dcegm/egm/aggregate_marginal_utility.py b/src/dcegm/egm/aggregate_marginal_utility.py index 44ffeb7a..9c50a00b 100644 --- a/src/dcegm/egm/aggregate_marginal_utility.py +++ b/src/dcegm/egm/aggregate_marginal_utility.py @@ -80,8 +80,7 @@ def aggregate_marg_utils_and_exp_values( def calculate_choice_probs_and_unsqueezed_logsum( - choice_values_per_state: jnp.ndarray, - taste_shock_scale: float + choice_values_per_state: jnp.ndarray, taste_shock_scale: float ) -> Tuple[jnp.ndarray, jnp.ndarray, jnp.ndarray]: max_value_per_state = jnp.nanmax(choice_values_per_state, axis=1, keepdims=True) diff --git a/src/dcegm/pre_processing/state_space.py b/src/dcegm/pre_processing/state_space.py index 984688cc..d547211a 100644 --- a/src/dcegm/pre_processing/state_space.py +++ b/src/dcegm/pre_processing/state_space.py @@ -478,7 +478,7 @@ def create_indexer_for_space(space): max_var_values + 1, fill_value=-99999999, dtype=np.int64 ) index_tuple = tuple(space[:, i] for i in range(space.shape[1])) - + map_vars_to_index[index_tuple] = np.arange(space.shape[0], dtype=np.int64) return map_vars_to_index diff --git a/src/dcegm/simulation/simulate.py b/src/dcegm/simulation/simulate.py index 9deb8e4a..9560b872 100644 --- a/src/dcegm/simulation/simulate.py +++ b/src/dcegm/simulation/simulate.py @@ -5,7 +5,6 @@ import jax.numpy as jnp import numpy as np from dcegm.interface import get_state_choice_index_per_state - from dcegm.simulation.sim_utils import compute_final_utility_for_each_choice from dcegm.simulation.sim_utils import draw_taste_shocks from dcegm.simulation.sim_utils import interpolate_policy_and_value_for_all_agents