From c54546af8b7646b037726be83a8d257e204d2c72 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 19:27:26 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- development/testing/regression.py | 1 + development/testing/testing_pull_request.py | 1 + docs/projects/_numerical_integration.py | 1 + respy/__init__.py | 1 + respy/_numba.py | 1 + respy/conditional_draws.py | 1 + respy/config.py | 1 + respy/conftest.py | 1 + respy/data.py | 1 + respy/exogenous_processes.py | 1 + respy/interface.py | 1 + respy/interpolate.py | 1 + respy/likelihood.py | 1 + respy/method_of_simulated_moments.py | 1 + respy/parallelization.py | 1 + respy/pre_processing/data_checking.py | 1 + respy/pre_processing/model_checking.py | 1 + respy/pre_processing/model_processing.py | 7 ++++--- respy/pre_processing/process_covariates.py | 1 + respy/shared.py | 1 + respy/simulate.py | 1 + respy/solve.py | 1 + respy/state_space.py | 1 + respy/tests/random_model.py | 1 + respy/tests/test_flexible_choices.py | 1 + respy/tests/test_method_of_simulated_moments.py | 1 + respy/tests/test_model_processing.py | 1 + respy/tests/test_randomness.py | 1 + respy/tests/test_regression.py | 1 + respy/tests/test_replication_kw_94.py | 1 + respy/tests/test_simulate.py | 1 + setup.py | 1 + 32 files changed, 35 insertions(+), 3 deletions(-) diff --git a/development/testing/regression.py b/development/testing/regression.py index 05c5e6102..1b0103933 100644 --- a/development/testing/regression.py +++ b/development/testing/regression.py @@ -1,4 +1,5 @@ """Create, run or investigate regression checks.""" + import pickle import socket diff --git a/development/testing/testing_pull_request.py b/development/testing/testing_pull_request.py index b0bc92def..e39b7eff8 100644 --- a/development/testing/testing_pull_request.py +++ b/development/testing/testing_pull_request.py @@ -1,4 +1,5 @@ """Run a series of tests that are required for any pull request to be merged.""" + import socket import click diff --git a/docs/projects/_numerical_integration.py b/docs/projects/_numerical_integration.py index b1bfadc26..bb7bed46b 100644 --- a/docs/projects/_numerical_integration.py +++ b/docs/projects/_numerical_integration.py @@ -1,4 +1,5 @@ """Auxiliary and plotting functions for the respy tutorial numerical integration.""" + import matplotlib.pyplot as plt from matplotlib import ticker diff --git a/respy/__init__.py b/respy/__init__.py index 343dad74a..66147dd52 100755 --- a/respy/__init__.py +++ b/respy/__init__.py @@ -9,6 +9,7 @@ rp. """ + import pytest from respy.config import ROOT_DIR diff --git a/respy/_numba.py b/respy/_numba.py index 93b9d50fd..bb55d9d31 100644 --- a/respy/_numba.py +++ b/respy/_numba.py @@ -1,4 +1,5 @@ """Special functions for using numba.""" + import warnings import numba as nb diff --git a/respy/conditional_draws.py b/respy/conditional_draws.py index 52b313391..fd25832f1 100644 --- a/respy/conditional_draws.py +++ b/respy/conditional_draws.py @@ -1,4 +1,5 @@ """Everything related to conditional draws for the maximum likelihood estimation.""" + import numpy as np from estimagic.utilities import robust_cholesky from numba import guvectorize diff --git a/respy/config.py b/respy/config.py index daf66830d..447d2bea1 100644 --- a/respy/config.py +++ b/respy/config.py @@ -1,4 +1,5 @@ """General configuration for respy.""" + from pathlib import Path import numpy as np diff --git a/respy/conftest.py b/respy/conftest.py index d85201eb4..bbe244b07 100644 --- a/respy/conftest.py +++ b/respy/conftest.py @@ -1,4 +1,5 @@ """This module includes code to configure pytest.""" + import os import numpy as np diff --git a/respy/data.py b/respy/data.py index 78642c4f7..979be88d1 100644 --- a/respy/data.py +++ b/respy/data.py @@ -1,4 +1,5 @@ """Everything related to the original data from Keane and Wolpin (1997).""" + import numpy as np import pandas as pd diff --git a/respy/exogenous_processes.py b/respy/exogenous_processes.py index f34b03c38..61a8c62ea 100644 --- a/respy/exogenous_processes.py +++ b/respy/exogenous_processes.py @@ -1,4 +1,5 @@ """Utils for the inclusion of exogenous processes.""" + import functools import numpy as np diff --git a/respy/interface.py b/respy/interface.py index 1287e1296..39ed6cdbe 100644 --- a/respy/interface.py +++ b/respy/interface.py @@ -1,4 +1,5 @@ """General interface functions for respy.""" + import warnings import pandas as pd diff --git a/respy/interpolate.py b/respy/interpolate.py index fb7977076..616231e87 100644 --- a/respy/interpolate.py +++ b/respy/interpolate.py @@ -1,4 +1,5 @@ """This module contains the code for approximate solutions to the DCDP.""" + import warnings import numba as nb diff --git a/respy/likelihood.py b/respy/likelihood.py index 8c8947abf..944e9f746 100644 --- a/respy/likelihood.py +++ b/respy/likelihood.py @@ -1,4 +1,5 @@ """Everything related to the estimation with maximum likelihood.""" + import warnings from functools import partial diff --git a/respy/method_of_simulated_moments.py b/respy/method_of_simulated_moments.py index 0d259f569..dd5d9680b 100644 --- a/respy/method_of_simulated_moments.py +++ b/respy/method_of_simulated_moments.py @@ -15,6 +15,7 @@ of Asset Prices. Econometrica, 61(4), 929-952. """ + import copy import functools diff --git a/respy/parallelization.py b/respy/parallelization.py index b3cf7400a..09111e955 100644 --- a/respy/parallelization.py +++ b/respy/parallelization.py @@ -1,4 +1,5 @@ """This module contains the code to control parallel execution.""" + import functools import joblib diff --git a/respy/pre_processing/data_checking.py b/respy/pre_processing/data_checking.py index 59f3f6a0b..bc361fcd2 100644 --- a/respy/pre_processing/data_checking.py +++ b/respy/pre_processing/data_checking.py @@ -1,4 +1,5 @@ """Test functions to ensure the validity of data.""" + import numpy as np from respy.shared import generate_column_dtype_dict_for_estimation diff --git a/respy/pre_processing/model_checking.py b/respy/pre_processing/model_checking.py index 97ce3d90e..e0bf8baa0 100644 --- a/respy/pre_processing/model_checking.py +++ b/respy/pre_processing/model_checking.py @@ -1,4 +1,5 @@ """Everything related to validate the model.""" + import numba as nb import numpy as np diff --git a/respy/pre_processing/model_processing.py b/respy/pre_processing/model_processing.py index fc6d08be7..0b764b99f 100644 --- a/respy/pre_processing/model_processing.py +++ b/respy/pre_processing/model_processing.py @@ -1,4 +1,5 @@ """Process model specification files or objects.""" + import copy import itertools import os @@ -802,9 +803,9 @@ def _convert_labels_in_formulas_to_codes(options, optim_paras): for choice in optim_paras["choices"]: for i, formula in enumerate(options["negative_choice_set"].get(choice, [])): - options["negative_choice_set"][choice][ - i - ] = _replace_choices_and_observables_in_formula(formula, optim_paras) + options["negative_choice_set"][choice][i] = ( + _replace_choices_and_observables_in_formula(formula, optim_paras) + ) return options diff --git a/respy/pre_processing/process_covariates.py b/respy/pre_processing/process_covariates.py index b15b79534..036d3d638 100644 --- a/respy/pre_processing/process_covariates.py +++ b/respy/pre_processing/process_covariates.py @@ -1,4 +1,5 @@ """This module comprises all functions which process the definition of covariates.""" + import copy diff --git a/respy/shared.py b/respy/shared.py index d49722083..7562db8dc 100644 --- a/respy/shared.py +++ b/respy/shared.py @@ -4,6 +4,7 @@ import from respy itself. This is to prevent circular imports. """ + import shutil import numba as nb diff --git a/respy/simulate.py b/respy/simulate.py index 680e95cd9..f396f5236 100644 --- a/respy/simulate.py +++ b/respy/simulate.py @@ -1,4 +1,5 @@ """Everything related to the simulation of data with structural models.""" + import functools import warnings diff --git a/respy/solve.py b/respy/solve.py index 76550da14..f6f505902 100644 --- a/respy/solve.py +++ b/respy/solve.py @@ -1,4 +1,5 @@ """Everything related to the solution of a structural model.""" + import functools import numpy as np diff --git a/respy/state_space.py b/respy/state_space.py index dd7133b9c..75e76e798 100644 --- a/respy/state_space.py +++ b/respy/state_space.py @@ -1,4 +1,5 @@ """Everything related to the state space of a structural model.""" + import itertools import numba as nb diff --git a/respy/tests/random_model.py b/respy/tests/random_model.py index 0af2a3237..5cdd460b3 100644 --- a/respy/tests/random_model.py +++ b/respy/tests/random_model.py @@ -1,4 +1,5 @@ """This module contains the functions for the generation of random requests.""" + import collections import copy diff --git a/respy/tests/test_flexible_choices.py b/respy/tests/test_flexible_choices.py index 5200f1f79..cb3e72255 100644 --- a/respy/tests/test_flexible_choices.py +++ b/respy/tests/test_flexible_choices.py @@ -1,4 +1,5 @@ """Contains code for testing for flexible choices.""" + import pandas as pd import pytest diff --git a/respy/tests/test_method_of_simulated_moments.py b/respy/tests/test_method_of_simulated_moments.py index 53f7698a5..d22e19f70 100644 --- a/respy/tests/test_method_of_simulated_moments.py +++ b/respy/tests/test_method_of_simulated_moments.py @@ -1,4 +1,5 @@ """Test the msm interface of respy.""" + import copy import numpy as np diff --git a/respy/tests/test_model_processing.py b/respy/tests/test_model_processing.py index 60425d4c0..2f664644e 100644 --- a/respy/tests/test_model_processing.py +++ b/respy/tests/test_model_processing.py @@ -1,4 +1,5 @@ """Test model generation.""" + import io import textwrap diff --git a/respy/tests/test_randomness.py b/respy/tests/test_randomness.py index 7d3cd0e63..ab413d0f2 100644 --- a/respy/tests/test_randomness.py +++ b/respy/tests/test_randomness.py @@ -1,4 +1,5 @@ """This module includes test to specifically test that randomness is held constant.""" + import numpy as np import pytest diff --git a/respy/tests/test_regression.py b/respy/tests/test_regression.py index e442446c3..92bb64f09 100644 --- a/respy/tests/test_regression.py +++ b/respy/tests/test_regression.py @@ -1,4 +1,5 @@ """Run a few regression tests.""" + import pickle import numpy as np diff --git a/respy/tests/test_replication_kw_94.py b/respy/tests/test_replication_kw_94.py index 19a3dc372..7f1dae9d8 100644 --- a/respy/tests/test_replication_kw_94.py +++ b/respy/tests/test_replication_kw_94.py @@ -23,6 +23,7 @@ 181. """ + import numpy as np import pandas as pd import pytest diff --git a/respy/tests/test_simulate.py b/respy/tests/test_simulate.py index b5a5421a0..f62ecb06d 100644 --- a/respy/tests/test_simulate.py +++ b/respy/tests/test_simulate.py @@ -1,4 +1,5 @@ """Test the simulation routine.""" + import numpy as np import pandas as pd import pytest diff --git a/setup.py b/setup.py index eb7a57bd7..d32c58e21 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """The general package information for respy.""" + from pathlib import Path from setuptools import find_packages