Skip to content

Commit

Permalink
move bounds outside of loops
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-held committed Oct 22, 2024
1 parent 0dd65b9 commit 5ac9e53
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cabinetry/fit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,10 @@ def ranking(
init_pars = init_pars or model.config.suggested_init()
fix_pars = fix_pars or model.config.suggested_fixed()

par_bounds = par_bounds or [
tuple(bound) for bound in model.config.suggested_bounds()
]

all_impacts = []
for i_par, label in enumerate(labels):
if i_par == poi_index:
Expand All @@ -613,9 +617,6 @@ def ranking(
log.debug(f"impact of {label} is zero, skipping fit")
parameter_impacts.append(0.0)
else:
par_bounds = par_bounds or [
tuple(bound) for bound in model.config.suggested_bounds()
]
if not par_bounds[i_par][0] <= np_val <= par_bounds[i_par][1]:
np_val = min(
max(np_val, par_bounds[i_par][0]), par_bounds[i_par][1]
Expand Down

0 comments on commit 5ac9e53

Please sign in to comment.