From 853671cfefe5fdb8adf1505f2f54f7ed17b044e3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 May 2022 18:23:59 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- respy/conditional_draws.py | 2 +- respy/pre_processing/model_processing.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/respy/conditional_draws.py b/respy/conditional_draws.py index 4ac0212b1..fa292369d 100644 --- a/respy/conditional_draws.py +++ b/respy/conditional_draws.py @@ -177,7 +177,7 @@ def update_mean_and_evaluate_likelihood( invariant - log_wage_observed - np.log(sigma) - - shock ** 2 / (2 * sigma_squared) + - shock**2 / (2 * sigma_squared) ) else: for i in range(n_choices): diff --git a/respy/pre_processing/model_processing.py b/respy/pre_processing/model_processing.py index d6a7f95ae..5a98613ea 100644 --- a/respy/pre_processing/model_processing.py +++ b/respy/pre_processing/model_processing.py @@ -189,7 +189,7 @@ def _parse_exogenous_processes(optim_paras, params): names = _parse_observable_or_exog_process_names(params, "exogenous_process") for exog_proc in names: - regex_pattern = fr"\bexogenous_process_{exog_proc}_([0-9a-z_]+)\b" + regex_pattern = rf"\bexogenous_process_{exog_proc}_([0-9a-z_]+)\b" parsed_parameters = _parse_probabilities_or_logit_coefficients( params, regex_pattern ) @@ -205,7 +205,7 @@ def _parse_observables(optim_paras, params): names = _parse_observable_or_exog_process_names(params, "observable") for observable in names: - regex_pattern = fr"\bobservable_{observable}_([0-9a-z_]+)\b" + regex_pattern = rf"\bobservable_{observable}_([0-9a-z_]+)\b" parsed_parameters = _parse_probabilities_or_logit_coefficients( params, regex_pattern ) @@ -286,7 +286,7 @@ def _parse_choice_parameters(optim_paras, params): def _parse_initial_and_max_experience(optim_paras, params, options): """Process initial experience distributions and maximum experience.""" for choice in optim_paras["choices_w_exp"]: - regex_for_levels = fr"\binitial_exp_{choice}_([0-9]+)\b" + regex_for_levels = rf"\binitial_exp_{choice}_([0-9]+)\b" parsed_parameters = _parse_probabilities_or_logit_coefficients( params, regex_for_levels ) @@ -470,7 +470,7 @@ def _infer_choices_with_prefix(params, prefix): """ return sorted( params.index.get_level_values(0) - .str.extract(fr"\b{prefix}_([A-Za-z_]+)\b", expand=False) + .str.extract(rf"\b{prefix}_([A-Za-z_]+)\b", expand=False) .dropna() .unique() ) @@ -544,7 +544,7 @@ def _parse_lagged_choices(optim_paras, options, params): # Add existing lagged choice parameters to ``optim_paras``. for lag in range(1, n_lc_covariates + 1): parsed_parameters = _parse_probabilities_or_logit_coefficients( - params, fr"lagged_choice_{lag}_([A-Za-z_]+)" + params, rf"lagged_choice_{lag}_([A-Za-z_]+)" ) # If there are no parameters for the specific lag, assume equiprobable choices.