Skip to content

Commit

Permalink
Rename variable to make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaniyaki committed Apr 2, 2023
1 parent 9b0f8b7 commit 9dab4fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/estimagic/parameters/check_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def check_fixes_and_bounds(constr_info, transformations, parnames):
parnames (list): List of parameter names.
"""
dict = constr_info.copy()
dict["index"] = parnames
constr_dict = constr_info.copy()
constr_dict["index"] = parnames

prob_msg = (
"{} constraints are incompatible with fixes or bounds. "
Expand All @@ -200,7 +200,7 @@ def check_fixes_and_bounds(constr_info, transformations, parnames):

for constr in transformations:
if constr["type"] in ["covariance", "sdcorr"]:
subset = _iloc(dictionary=dict, position=constr["index"][1:])
subset = _iloc(dictionary=constr_dict, position=constr["index"][1:])
if any(subset["is_fixed_to_value"]):
problematic = np.where(subset["is_fixed_to_value"])[0]

Check warning on line 205 in src/estimagic/parameters/check_constraints.py

View check run for this annotation

Codecov / codecov/patch

src/estimagic/parameters/check_constraints.py#L205

Added line #L205 was not covered by tests
raise InvalidConstraintError(
Expand All @@ -212,7 +212,7 @@ def check_fixes_and_bounds(constr_info, transformations, parnames):
prob_msg.format(constr["type"], problematic)
)
elif constr["type"] == "probability":
subset = _iloc(dictionary=dict, position=constr["index"])
subset = _iloc(dictionary=constr_dict, position=constr["index"])
if any(subset["is_fixed_to_value"]):
problematic = np.where(subset["is_fixed_to_value"])[0].tolist()

Check warning on line 217 in src/estimagic/parameters/check_constraints.py

View check run for this annotation

Codecov / codecov/patch

src/estimagic/parameters/check_constraints.py#L217

Added line #L217 was not covered by tests
raise InvalidConstraintError(
Expand All @@ -226,8 +226,8 @@ def check_fixes_and_bounds(constr_info, transformations, parnames):
)

invalid = {}
lower_bounds = dict["lower_bounds"]
upper_bounds = dict["upper_bounds"]
lower_bounds = constr_dict["lower_bounds"]
upper_bounds = constr_dict["upper_bounds"]

invalid = np.where(lower_bounds >= upper_bounds)[0]

Expand Down

0 comments on commit 9dab4fb

Please sign in to comment.